Exemplo n.º 1
0
# limitations under the License.
"""This script is used to synthesize generated parts of this library."""

import logging
from pathlib import Path
import subprocess

import synthtool as s
from synthtool.languages import php

logging.basicConfig(level=logging.DEBUG)

src = Path(f"../{php.STAGING_DIR}/ApiGateway").resolve()
dest = Path().resolve()

php.owlbot_main(src=src, dest=dest)

# document and utilize apiEndpoint instead of serviceAddress
s.replace("**/Gapic/*GapicClient.php", r"'serviceAddress' =>",
          r"'apiEndpoint' =>")
s.replace(
    "**/Gapic/*GapicClient.php",
    r"@type string \$serviceAddress\n\s+\*\s+The address",
    r"""@type string $serviceAddress
     *           **Deprecated**. This option will be removed in a future major release. Please
     *           utilize the `$apiEndpoint` option instead.
     *     @type string $apiEndpoint
     *           The address""")
s.replace("**/Gapic/*GapicClient.php",
          r"\$transportConfig, and any \$serviceAddress",
          r"$transportConfig, and any `$apiEndpoint`")
Exemplo n.º 2
0
import synthtool as s
import subprocess
from synthtool.languages import php
from synthtool import _tracked_paths

logging.basicConfig(level=logging.DEBUG)

src = Path(f"../{php.STAGING_DIR}/Compute").resolve()
dest = Path().resolve()

# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

# Exclude backwards-compatibility files for protos
php.owlbot_main(
    src=src,
    dest=dest,
    copy_excludes=[src / "*/proto/src/Google/Cloud/Compute/*/*_*.php"])

# remove class_alias code
s.replace(
    "src/V*/**/*.php",
    r"^// Adding a class alias for backwards compatibility with the previous class name.$"
    + "\n" + r"^class_alias\(.*\);$" + "\n", '')

# document and utilize apiEndpoint instead of serviceAddress
s.replace("**/Gapic/*GapicClient.php", r"'serviceAddress' =>",
          r"'apiEndpoint' =>")
s.replace(
    "**/Gapic/*GapicClient.php",
    r"@type string \$serviceAddress\n\s+\*\s+The address",
    r"""@type string $serviceAddress
Exemplo n.º 3
0
from pathlib import Path
import subprocess

import synthtool as s
from synthtool.languages import php
from synthtool import _tracked_paths

logging.basicConfig(level=logging.DEBUG)

src = Path(f"../{php.STAGING_DIR}/VpcAccess").resolve()
dest = Path().resolve()

# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

php.owlbot_main(src=src, dest=dest, copy_excludes=[src / "**/[A-Z]*_*.php"])

# remove class_alias code
s.replace(
    "src/V*/**/*.php",
    r"^// Adding a class alias for backwards compatibility with the previous class name.$"
    + "\n" + r"^class_alias\(.*\);$" + "\n", '')

# document and utilize apiEndpoint instead of serviceAddress
s.replace("**/Gapic/*GapicClient.php", r"'serviceAddress' =>",
          r"'apiEndpoint' =>")
s.replace(
    "**/Gapic/*GapicClient.php",
    r"@type string \$serviceAddress\n\s+\*\s+The address",
    r"""@type string $serviceAddress
     *           **Deprecated**. This option will be removed in a future major release. Please
Exemplo n.º 4
0
import synthtool as s
from synthtool.languages import php
from synthtool import _tracked_paths

logging.basicConfig(level=logging.DEBUG)

src = Path(f"../{php.STAGING_DIR}/Speech").resolve()
dest = Path().resolve()

# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

# Exclude the partial veneer.
php.owlbot_main(src=src,
                dest=dest,
                copy_excludes=[src / "*/src/V1/SpeechClient.php"])

# document and utilize apiEndpoint instead of serviceAddress
s.replace("**/Gapic/*GapicClient.php", r"'serviceAddress' =>",
          r"'apiEndpoint' =>")
s.replace(
    "**/Gapic/*GapicClient.php",
    r"@type string \$serviceAddress\n\s+\*\s+The address",
    r"""@type string $serviceAddress
     *           **Deprecated**. This option will be removed in a future major release. Please
     *           utilize the `$apiEndpoint` option instead.
     *     @type string $apiEndpoint
     *           The address""")
s.replace("**/Gapic/*GapicClient.php",
          r"\$transportConfig, and any \$serviceAddress",
Exemplo n.º 5
0
import synthtool as s
from synthtool.languages import php
from synthtool import _tracked_paths

logging.basicConfig(level=logging.DEBUG)

src = Path(f"../{php.STAGING_DIR}/BigQueryDataTransfer").resolve()
dest = Path().resolve()

# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

php.owlbot_main(
    src=src,
    dest=dest,
    copy_excludes=[
        src / "*/src/V1/DataTransferServiceClient.php"
    ]
)



# document and utilize apiEndpoint instead of serviceAddress
s.replace(
    "**/Gapic/*GapicClient.php",
    r"'serviceAddress' =>",
    r"'apiEndpoint' =>")
s.replace(
    "**/Gapic/*GapicClient.php",
    r"@type string \$serviceAddress\n\s+\*\s+The address",
    r"""@type string $serviceAddress
Exemplo n.º 6
0
from synthtool import _tracked_paths

logging.basicConfig(level=logging.DEBUG)

src = Path(f"../{php.STAGING_DIR}/Firestore").resolve()
dest = Path().resolve()

# For preserving the copyright year, we use php._merge function
preserve_copyright_year = php._merge

# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

php.owlbot_main(src=src,
                dest=dest,
                copy_excludes=[
                    src / '*/src/V1/FirestoreClient.php',
                    src / '*/src/Admin/V1/FirestoreAdminClient.php',
                ])

# Firestore Admin also lives here
admin_library = Path(f"../{php.STAGING_DIR}/Firestore/v1/Admin").resolve()

# copy all src
s.move(admin_library / f'src',
       'src/Admin',
       merge=preserve_copyright_year,
       excludes=[
           admin_library / 'src/V1/FirestoreAdminClient.php',
       ])

# copy proto files to src also
Exemplo n.º 7
0
from synthtool.languages import php
from synthtool import _tracked_paths

logging.basicConfig(level=logging.DEBUG)

src = Path(f"../{php.STAGING_DIR}/Vision").resolve()
dest = Path().resolve()

# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

# Exclude partial veneer files.
php.owlbot_main(
    src=src,
    dest=dest,
    copy_excludes=[
        src / "*/src/V1/ProductSearchClient.php",
        src / "*/src/V1/ImageAnnotatorClient.php",
    ]
)

# document and utilize apiEndpoint instead of serviceAddress
s.replace(
    "**/Gapic/*GapicClient.php",
    r"'serviceAddress' =>",
    r"'apiEndpoint' =>")
s.replace(
    "**/Gapic/*GapicClient.php",
    r"@type string \$serviceAddress\n\s+\*\s+The address",
    r"""@type string $serviceAddress
     *           **Deprecated**. This option will be removed in a future major release. Please
     *           utilize the `$apiEndpoint` option instead.
Exemplo n.º 8
0
from synthtool.languages import php
from synthtool import _tracked_paths

logging.basicConfig(level=logging.DEBUG)

src = Path(f"../{php.STAGING_DIR}/Monitoring").resolve()
dest = Path().resolve()

# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

php.owlbot_main(src=src,
                dest=dest,
                copy_excludes=[
                    src / "*/src/V3/AlertPolicyServiceClient.php",
                    src / "*/src/V3/GroupServiceClient.php",
                    src / "*/src/V3/NotificationChannelServiceClient.php",
                    src / "*/src/V3/ServiceMonitoringServiceClient.php",
                    src / "*/src/V3/UptimeCheckServiceGapicClient.php",
                ])

# document and utilize apiEndpoint instead of serviceAddress
s.replace("**/Gapic/*GapicClient.php", r"'serviceAddress' =>",
          r"'apiEndpoint' =>")
s.replace(
    "**/Gapic/*GapicClient.php",
    r"@type string \$serviceAddress\n\s+\*\s+The address",
    r"""@type string $serviceAddress
     *           **Deprecated**. This option will be removed in a future major release. Please
     *           utilize the `$apiEndpoint` option instead.
     *     @type string $apiEndpoint
from synthtool import _tracked_paths

logging.basicConfig(level=logging.DEBUG)

src = Path(f"../{php.STAGING_DIR}/Bigtable").resolve()
dest = Path().resolve()

# For preserving the copyright year, we use php._merge function
preserve_copyright_year = php._merge

# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

# Excluding the partial veneer files.
php.owlbot_main(src=src,
                dest=dest,
                copy_excludes=[src / "*/src/V2/BigtableClient.php"])

# First copy the Bigtable Admin
admin_library = Path(f"../{php.STAGING_DIR}/Bigtable/v2/Admin").resolve()

# copy all src except handwritten partial veneers
s.move(admin_library / f'src/V2/Gapic',
       'src/Admin/V2/Gapic',
       merge=preserve_copyright_year)
s.move(admin_library / f'src/V2/resources',
       f'src/Admin/V2/resources',
       merge=preserve_copyright_year)

# copy proto files to src also
s.move(admin_library / f'proto/src/Google/Cloud/Bigtable',
Exemplo n.º 10
0
import subprocess

import synthtool as s
from synthtool.languages import php
from synthtool import _tracked_paths

logging.basicConfig(level=logging.DEBUG)

src = Path(f"../{php.STAGING_DIR}/Monitoring").resolve()
dest = Path().resolve()

# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

php.owlbot_main(src=src,
                dest=dest,
                copy_excludes=[src / "*/src/V3/AlertPolicyServiceClient.php"])

# document and utilize apiEndpoint instead of serviceAddress
s.replace("**/Gapic/*GapicClient.php", r"'serviceAddress' =>",
          r"'apiEndpoint' =>")
s.replace(
    "**/Gapic/*GapicClient.php",
    r"@type string \$serviceAddress\n\s+\*\s+The address",
    r"""@type string $serviceAddress
     *           **Deprecated**. This option will be removed in a future major release. Please
     *           utilize the `$apiEndpoint` option instead.
     *     @type string $apiEndpoint
     *           The address""")
s.replace("**/Gapic/*GapicClient.php",
          r"\$transportConfig, and any \$serviceAddress",
Exemplo n.º 11
0
import synthtool as s
import subprocess
from synthtool.languages import php
from synthtool import _tracked_paths

logging.basicConfig(level=logging.DEBUG)

src = Path(f"../{php.STAGING_DIR}/Vision").resolve()
dest = Path().resolve()

# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

# Exclude gapic_metadata.json and partial veneer files.
php.owlbot_main(
    src=src,
    dest=dest,
    copy_excludes=[src / "*/src/*/gapic_metadata.json", src / "*/src/*/*.php"])

# document and utilize apiEndpoint instead of serviceAddress
s.replace("**/Gapic/*GapicClient.php", r"'serviceAddress' =>",
          r"'apiEndpoint' =>")
s.replace(
    "**/Gapic/*GapicClient.php",
    r"@type string \$serviceAddress\n\s+\*\s+The address",
    r"""@type string $serviceAddress
     *           **Deprecated**. This option will be removed in a future major release. Please
     *           utilize the `$apiEndpoint` option instead.
     *     @type string $apiEndpoint
     *           The address""")
s.replace("**/Gapic/*GapicClient.php",
          r"\$transportConfig, and any \$serviceAddress",
Exemplo n.º 12
0
import synthtool as s
from synthtool.languages import php
from synthtool import _tracked_paths

logging.basicConfig(level=logging.DEBUG)

src = Path(f"../{php.STAGING_DIR}/Redis").resolve()
dest = Path().resolve()

# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

php.owlbot_main(src=src,
                dest=dest,
                copy_excludes=[
                    src / "*/src/V1/CloudRedisClient.php",
                    src / "*/src/V1beta1/CloudRedisClient.php"
                ])

# document and utilize apiEndpoint instead of serviceAddress
s.replace("**/Gapic/*GapicClient.php", r"'serviceAddress' =>",
          r"'apiEndpoint' =>")
s.replace(
    "**/Gapic/*GapicClient.php",
    r"@type string \$serviceAddress\n\s+\*\s+The address",
    r"""@type string $serviceAddress
     *           **Deprecated**. This option will be removed in a future major release. Please
     *           utilize the `$apiEndpoint` option instead.
     *     @type string $apiEndpoint
     *           The address""")
s.replace("**/Gapic/*GapicClient.php",
Exemplo n.º 13
0
import subprocess

import synthtool as s
from synthtool.languages import php
from synthtool import _tracked_paths

logging.basicConfig(level=logging.DEBUG)

src = Path(f"../{php.STAGING_DIR}/Kms").resolve()
dest = Path().resolve()

# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

php.owlbot_main(
    src=src,
    dest=dest,
    copy_excludes=[src / "*/src/V1/KeyManagementServiceClient.php"])

# document and utilize apiEndpoint instead of serviceAddress
s.replace("**/Gapic/*GapicClient.php", r"'serviceAddress' =>",
          r"'apiEndpoint' =>")
s.replace(
    "**/Gapic/*GapicClient.php",
    r"@type string \$serviceAddress\n\s+\*\s+The address",
    r"""@type string $serviceAddress
     *           **Deprecated**. This option will be removed in a future major release. Please
     *           utilize the `$apiEndpoint` option instead.
     *     @type string $apiEndpoint
     *           The address""")
s.replace("**/Gapic/*GapicClient.php",
          r"\$transportConfig, and any \$serviceAddress",
Exemplo n.º 14
0
import subprocess

import synthtool as s
from synthtool.languages import php
from synthtool import _tracked_paths

logging.basicConfig(level=logging.DEBUG)

src = Path(f"../{php.STAGING_DIR}/Translate").resolve()
dest = Path().resolve()

# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

php.owlbot_main(src=src,
                dest=dest,
                copy_excludes=[src / "*/src/V2/TranslateClient.php"])

# document and utilize apiEndpoint instead of serviceAddress
s.replace("**/Gapic/*GapicClient.php", r"'serviceAddress' =>",
          r"'apiEndpoint' =>")
s.replace(
    "**/Gapic/*GapicClient.php",
    r"@type string \$serviceAddress\n\s+\*\s+The address",
    r"""@type string $serviceAddress
     *           **Deprecated**. This option will be removed in a future major release. Please
     *           utilize the `$apiEndpoint` option instead.
     *     @type string $apiEndpoint
     *           The address""")
s.replace("**/Gapic/*GapicClient.php",
          r"\$transportConfig, and any \$serviceAddress",