├── .bazeliskrc ├── .bazelrc ├── .coveragerc ├── .dockerignore ├── .flake8 ├── .githooks └── pre-commit ├── .github ├── .OwlBot.lock.yaml ├── .OwlBot.yaml ├── CODEOWNERS ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── support_request.md ├── PULL_REQUEST_TEMPLATE.md ├── auto-label.yaml ├── blunderbuss.yml ├── header-checker-lint.yml ├── release-please.yml ├── release-trigger.yml ├── snippet-bot.yml ├── sync-repo-settings.yaml └── workflows │ └── tests.yaml ├── .gitignore ├── .kokoro ├── build.sh ├── continuous │ ├── common.cfg │ └── continuous.cfg ├── populate-secrets.sh ├── presubmit │ ├── common.cfg │ └── presubmit.cfg ├── trampoline.sh └── trampoline_v2.sh ├── .readthedocs.yml ├── .repo-metadata.json ├── .trampolinerc ├── BUILD.bazel ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── DEVELOPMENT.md ├── LICENSE ├── MANIFEST.in ├── README.rst ├── SECURITY.md ├── WORKSPACE ├── docs ├── Makefile ├── conf.py ├── getting-started │ ├── _example.rst │ ├── _samplegen.rst │ ├── _usage_intro.rst │ ├── _verifying.rst │ ├── bazel.rst │ ├── index.rst │ └── local.rst ├── index.rst ├── process.rst ├── reference │ ├── generator.rst │ ├── index.rst │ ├── schema.rst │ └── utils.rst ├── status.rst └── templates.rst ├── gapic ├── ads-templates │ ├── %namespace │ │ └── %name │ │ │ ├── %version │ │ │ ├── %sub │ │ │ │ ├── __init__.py.j2 │ │ │ │ ├── gapic_version.py.j2 │ │ │ │ ├── services │ │ │ │ │ ├── %service │ │ │ │ │ │ ├── __init__.py.j2 │ │ │ │ │ │ ├── _mixins.py.j2 │ │ │ │ │ │ ├── _shared_macros.j2 │ │ │ │ │ │ ├── client.py.j2 │ │ │ │ │ │ ├── pagers.py.j2 │ │ │ │ │ │ └── transports │ │ │ │ │ │ │ ├── __init__.py.j2 │ │ │ │ │ │ │ ├── _mixins.py.j2 │ │ │ │ │ │ │ ├── _rest_mixins.py.j2 │ │ │ │ │ │ │ ├── _rest_mixins_base.py.j2 │ │ │ │ │ │ │ ├── base.py.j2 │ │ │ │ │ │ │ ├── grpc.py.j2 │ │ │ │ │ │ │ ├── rest.py.j2 │ │ │ │ │ │ │ └── rest_base.py.j2 │ │ │ │ │ └── __init__.py.j2 │ │ │ │ └── types │ │ │ │ │ ├── %proto.py.j2 │ │ │ │ │ ├── __init__.py.j2 │ │ │ │ │ ├── _enum.py.j2 │ │ │ │ │ └── _message.py.j2 │ │ │ ├── __init__.py.j2 │ │ │ └── gapic_metadata.json.j2 │ │ │ ├── __init__.py.j2 │ │ │ └── py.typed.j2 │ ├── .coveragerc.j2 │ ├── MANIFEST.in.j2 │ ├── _base.py.j2 │ ├── _license.j2 │ ├── docs │ │ ├── %name_%version │ │ │ ├── services.rst.j2 │ │ │ └── types.rst.j2 │ │ ├── _static │ │ │ └── custom.css.j2 │ │ ├── conf.py.j2 │ │ └── index.rst.j2 │ ├── examples │ │ ├── feature_fragments.j2 │ │ └── sample.py.j2 │ ├── mypy.ini.j2 │ ├── noxfile.py.j2 │ ├── scripts │ │ └── fixup_%name_%version_keywords.py.j2 │ ├── setup.py.j2 │ └── tests │ │ ├── __init__.py.j2 │ │ └── unit │ │ ├── __init__.py.j2 │ │ └── gapic │ │ ├── %name_%version │ │ ├── %sub │ │ │ ├── __init__.py.j2 │ │ │ ├── _test_mixins.py.j2 │ │ │ └── test_%service.py.j2 │ │ └── test_module_import.py.j2 │ │ └── __init__.py.j2 ├── cli │ ├── __init__.py │ ├── dump.py │ ├── generate.py │ └── generate_with_pandoc.py ├── configurable_snippetgen │ ├── __init__.py │ ├── configured_snippet.py │ ├── libcst_utils.py │ ├── snippet_config_language.proto │ ├── snippet_config_language_pb2.py │ └── snippet_config_language_pb2.pyi ├── generator │ ├── __init__.py │ ├── formatter.py │ └── generator.py ├── samplegen │ ├── __init__.py │ ├── manifest.py │ └── samplegen.py ├── samplegen_utils │ ├── __init__.py │ ├── snippet_index.py │ ├── snippet_metadata.proto │ ├── snippet_metadata_pb2.py │ ├── types.py │ ├── utils.py │ └── yaml.py ├── schema │ ├── __init__.py │ ├── api.py │ ├── imp.py │ ├── metadata.py │ ├── mixins.py │ ├── naming.py │ └── wrappers.py ├── templates │ ├── %namespace │ │ ├── %name │ │ │ ├── __init__.py.j2 │ │ │ ├── gapic_version.py.j2 │ │ │ └── py.typed.j2 │ │ └── %name_%version │ │ │ ├── %sub │ │ │ ├── __init__.py.j2 │ │ │ ├── services │ │ │ │ ├── %service │ │ │ │ │ ├── __init__.py.j2 │ │ │ │ │ ├── _async_mixins.py.j2 │ │ │ │ │ ├── _client_macros.j2 │ │ │ │ │ ├── _mixins.py.j2 │ │ │ │ │ ├── _shared_macros.j2 │ │ │ │ │ ├── async_client.py.j2 │ │ │ │ │ ├── client.py.j2 │ │ │ │ │ ├── pagers.py.j2 │ │ │ │ │ └── transports │ │ │ │ │ │ ├── README.rst.j2 │ │ │ │ │ │ ├── __init__.py.j2 │ │ │ │ │ │ ├── _mixins.py.j2 │ │ │ │ │ │ ├── _rest_mixins.py.j2 │ │ │ │ │ │ ├── _rest_mixins_base.py.j2 │ │ │ │ │ │ ├── base.py.j2 │ │ │ │ │ │ ├── grpc.py.j2 │ │ │ │ │ │ ├── grpc_asyncio.py.j2 │ │ │ │ │ │ ├── rest.py.j2 │ │ │ │ │ │ ├── rest_asyncio.py.j2 │ │ │ │ │ │ └── rest_base.py.j2 │ │ │ │ └── __init__.py.j2 │ │ │ └── types │ │ │ │ ├── %proto.py.j2 │ │ │ │ ├── __init__.py.j2 │ │ │ │ ├── _enum.py.j2 │ │ │ │ └── _message.py.j2 │ │ │ ├── gapic_metadata.json.j2 │ │ │ ├── gapic_version.py.j2 │ │ │ └── py.typed.j2 │ ├── .coveragerc.j2 │ ├── .flake8.j2 │ ├── LICENSE.j2 │ ├── MANIFEST.in.j2 │ ├── README.rst.j2 │ ├── _base.py.j2 │ ├── _license.j2 │ ├── _pypi_packages.j2 │ ├── docs │ │ ├── %name_%version │ │ │ ├── %service.rst.j2 │ │ │ ├── services_.rst.j2 │ │ │ └── types_.rst.j2 │ │ ├── _static │ │ │ └── custom.css.j2 │ │ ├── _templates │ │ │ └── layout.html.j2 │ │ ├── conf.py.j2 │ │ ├── index.rst.j2 │ │ └── multiprocessing.rst.j2 │ ├── examples │ │ ├── _generated_sample_comment.j2 │ │ ├── feature_fragments.j2 │ │ └── sample.py.j2 │ ├── mypy.ini.j2 │ ├── noxfile.py.j2 │ ├── scripts │ │ └── fixup_%name_%version_keywords.py.j2 │ ├── setup.py.j2 │ ├── testing │ │ ├── _default_constraints.j2 │ │ ├── constraints-3.10.txt.j2 │ │ ├── constraints-3.11.txt.j2 │ │ ├── constraints-3.12.txt.j2 │ │ ├── constraints-3.13.txt.j2 │ │ ├── constraints-3.7.txt.j2 │ │ ├── constraints-3.8.txt.j2 │ │ └── constraints-3.9.txt.j2 │ └── tests │ │ ├── __init__.py.j2 │ │ └── unit │ │ ├── __init__.py.j2 │ │ └── gapic │ │ ├── %name_%version │ │ └── %sub │ │ │ ├── __init__.py.j2 │ │ │ ├── _test_mixins.py.j2 │ │ │ ├── test_%service.py.j2 │ │ │ └── test_macros.j2 │ │ └── __init__.py.j2 └── utils │ ├── __init__.py │ ├── cache.py │ ├── case.py │ ├── checks.py │ ├── code.py │ ├── doc.py │ ├── filename.py │ ├── lines.py │ ├── options.py │ ├── reserved_names.py │ ├── rst.py │ ├── uri_conv.py │ └── uri_sample.py ├── gapic_generator_python.bzl ├── mypy.ini ├── noxfile.py ├── owlbot.py ├── pyenv3wrapper.sh ├── renovate.json ├── repositories.bzl ├── requirements.in ├── requirements.txt ├── rules_python_gapic ├── BUILD.bazel ├── py_gapic.bzl ├── py_gapic_pkg.bzl ├── pytest.py ├── test.py └── test │ ├── BUILD.bazel │ └── integration_test.bzl ├── setup.py ├── test_utils ├── __init__.py └── test_utils.py └── tests ├── cert ├── mtls.crt └── mtls.key ├── fragments ├── google │ ├── README.rst │ ├── api │ │ ├── annotations.proto │ │ ├── client.proto │ │ ├── field_behavior.proto │ │ ├── http.proto │ │ ├── httpbody.proto │ │ └── routing.proto │ ├── cloud │ │ └── extended_operations.proto │ ├── longrunning │ │ └── operations.proto │ ├── protobuf │ │ ├── any.proto │ │ ├── descriptor.proto │ │ └── struct.proto │ ├── rpc │ │ └── status.proto │ └── type │ │ └── dayofweek.proto ├── import.proto ├── test_api_version.proto ├── test_compute_operation.proto ├── test_dynamic_routing.proto ├── test_enum_indexed_types.proto ├── test_enum_indexed_types_nonlocal.proto ├── test_extended_operation_forwardcompat_lro.proto ├── test_flattened_value.proto ├── test_google_protobuf_type.proto ├── test_keyword_import.proto ├── test_multiple_required_fields.proto ├── test_nested_messages.proto ├── test_non_primitive_body.proto ├── test_oneof_imported_response.proto ├── test_optional_signature.proto ├── test_pagination_max_results_and_wrapper.proto ├── test_recursive_messages.proto ├── test_repeated_double.proto ├── test_required_non_string.proto ├── test_reserved_field_name.proto ├── test_reserved_method_names.proto └── test_rest_streaming.proto ├── integration ├── BUILD.bazel ├── cloudasset_grpc_service_config.json ├── cloudasset_v1.yaml ├── eventarc_grpc_service_config.json ├── eventarc_v1.yaml ├── goldens │ ├── asset │ │ ├── .coveragerc │ │ ├── .flake8 │ │ ├── BUILD.bazel │ │ ├── LICENSE │ │ ├── MANIFEST.in │ │ ├── README.rst │ │ ├── docs │ │ │ ├── _static │ │ │ │ └── custom.css │ │ │ ├── _templates │ │ │ │ └── layout.html │ │ │ ├── asset_v1 │ │ │ │ ├── asset_service.rst │ │ │ │ ├── services_.rst │ │ │ │ └── types_.rst │ │ │ ├── conf.py │ │ │ ├── index.rst │ │ │ └── multiprocessing.rst │ │ ├── google │ │ │ └── cloud │ │ │ │ ├── asset │ │ │ │ ├── __init__.py │ │ │ │ ├── gapic_version.py │ │ │ │ └── py.typed │ │ │ │ └── asset_v1 │ │ │ │ ├── __init__.py │ │ │ │ ├── gapic_metadata.json │ │ │ │ ├── gapic_version.py │ │ │ │ ├── py.typed │ │ │ │ ├── services │ │ │ │ ├── __init__.py │ │ │ │ └── asset_service │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── async_client.py │ │ │ │ │ ├── client.py │ │ │ │ │ ├── pagers.py │ │ │ │ │ └── transports │ │ │ │ │ ├── README.rst │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base.py │ │ │ │ │ ├── grpc.py │ │ │ │ │ ├── grpc_asyncio.py │ │ │ │ │ ├── rest.py │ │ │ │ │ └── rest_base.py │ │ │ │ └── types │ │ │ │ ├── __init__.py │ │ │ │ ├── asset_service.py │ │ │ │ └── assets.py │ │ ├── mypy.ini │ │ ├── noxfile.py │ │ ├── samples │ │ │ └── generated_samples │ │ │ │ ├── cloudasset_v1_generated_asset_service_analyze_iam_policy_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_analyze_iam_policy_longrunning_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_analyze_iam_policy_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_analyze_move_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_analyze_move_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_analyze_org_policies_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_analyze_org_policies_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_analyze_org_policy_governed_assets_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_analyze_org_policy_governed_assets_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_analyze_org_policy_governed_containers_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_analyze_org_policy_governed_containers_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_batch_get_assets_history_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_batch_get_assets_history_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_batch_get_effective_iam_policies_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_batch_get_effective_iam_policies_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_create_feed_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_create_feed_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_create_saved_query_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_create_saved_query_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_delete_feed_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_delete_feed_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_delete_saved_query_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_delete_saved_query_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_export_assets_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_export_assets_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_get_feed_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_get_feed_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_get_saved_query_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_get_saved_query_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_list_assets_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_list_assets_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_list_feeds_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_list_feeds_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_list_saved_queries_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_list_saved_queries_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_query_assets_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_query_assets_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_search_all_iam_policies_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_search_all_iam_policies_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_search_all_resources_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_search_all_resources_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_update_feed_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_update_feed_sync.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_update_saved_query_async.py │ │ │ │ ├── cloudasset_v1_generated_asset_service_update_saved_query_sync.py │ │ │ │ └── snippet_metadata_google.cloud.asset.v1.json │ │ ├── scripts │ │ │ └── fixup_asset_v1_keywords.py │ │ ├── setup.py │ │ ├── testing │ │ │ ├── constraints-3.10.txt │ │ │ ├── constraints-3.11.txt │ │ │ ├── constraints-3.12.txt │ │ │ ├── constraints-3.13.txt │ │ │ ├── constraints-3.7.txt │ │ │ ├── constraints-3.8.txt │ │ │ └── constraints-3.9.txt │ │ └── tests │ │ │ ├── __init__.py │ │ │ └── unit │ │ │ ├── __init__.py │ │ │ └── gapic │ │ │ ├── __init__.py │ │ │ └── asset_v1 │ │ │ ├── __init__.py │ │ │ └── test_asset_service.py │ ├── credentials │ │ ├── .coveragerc │ │ ├── .flake8 │ │ ├── BUILD.bazel │ │ ├── LICENSE │ │ ├── MANIFEST.in │ │ ├── README.rst │ │ ├── docs │ │ │ ├── _static │ │ │ │ └── custom.css │ │ │ ├── _templates │ │ │ │ └── layout.html │ │ │ ├── conf.py │ │ │ ├── credentials_v1 │ │ │ │ ├── iam_credentials.rst │ │ │ │ ├── services_.rst │ │ │ │ └── types_.rst │ │ │ ├── index.rst │ │ │ └── multiprocessing.rst │ │ ├── google │ │ │ └── iam │ │ │ │ ├── credentials │ │ │ │ ├── __init__.py │ │ │ │ ├── gapic_version.py │ │ │ │ └── py.typed │ │ │ │ └── credentials_v1 │ │ │ │ ├── __init__.py │ │ │ │ ├── gapic_metadata.json │ │ │ │ ├── gapic_version.py │ │ │ │ ├── py.typed │ │ │ │ ├── services │ │ │ │ ├── __init__.py │ │ │ │ └── iam_credentials │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── async_client.py │ │ │ │ │ ├── client.py │ │ │ │ │ └── transports │ │ │ │ │ ├── README.rst │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base.py │ │ │ │ │ ├── grpc.py │ │ │ │ │ ├── grpc_asyncio.py │ │ │ │ │ ├── rest.py │ │ │ │ │ └── rest_base.py │ │ │ │ └── types │ │ │ │ ├── __init__.py │ │ │ │ ├── common.py │ │ │ │ └── iamcredentials.py │ │ ├── mypy.ini │ │ ├── noxfile.py │ │ ├── samples │ │ │ └── generated_samples │ │ │ │ ├── iamcredentials_v1_generated_iam_credentials_generate_access_token_async.py │ │ │ │ ├── iamcredentials_v1_generated_iam_credentials_generate_access_token_sync.py │ │ │ │ ├── iamcredentials_v1_generated_iam_credentials_generate_id_token_async.py │ │ │ │ ├── iamcredentials_v1_generated_iam_credentials_generate_id_token_sync.py │ │ │ │ ├── iamcredentials_v1_generated_iam_credentials_sign_blob_async.py │ │ │ │ ├── iamcredentials_v1_generated_iam_credentials_sign_blob_sync.py │ │ │ │ ├── iamcredentials_v1_generated_iam_credentials_sign_jwt_async.py │ │ │ │ ├── iamcredentials_v1_generated_iam_credentials_sign_jwt_sync.py │ │ │ │ └── snippet_metadata_google.iam.credentials.v1.json │ │ ├── scripts │ │ │ └── fixup_credentials_v1_keywords.py │ │ ├── setup.py │ │ ├── testing │ │ │ ├── constraints-3.10.txt │ │ │ ├── constraints-3.11.txt │ │ │ ├── constraints-3.12.txt │ │ │ ├── constraints-3.13.txt │ │ │ ├── constraints-3.7.txt │ │ │ ├── constraints-3.8.txt │ │ │ └── constraints-3.9.txt │ │ └── tests │ │ │ ├── __init__.py │ │ │ └── unit │ │ │ ├── __init__.py │ │ │ └── gapic │ │ │ ├── __init__.py │ │ │ └── credentials_v1 │ │ │ ├── __init__.py │ │ │ └── test_iam_credentials.py │ ├── eventarc │ │ ├── .coveragerc │ │ ├── .flake8 │ │ ├── BUILD.bazel │ │ ├── LICENSE │ │ ├── MANIFEST.in │ │ ├── README.rst │ │ ├── docs │ │ │ ├── _static │ │ │ │ └── custom.css │ │ │ ├── _templates │ │ │ │ └── layout.html │ │ │ ├── conf.py │ │ │ ├── eventarc_v1 │ │ │ │ ├── eventarc.rst │ │ │ │ ├── services_.rst │ │ │ │ └── types_.rst │ │ │ ├── index.rst │ │ │ └── multiprocessing.rst │ │ ├── google │ │ │ └── cloud │ │ │ │ └── eventarc_v1 │ │ │ │ ├── __init__.py │ │ │ │ ├── gapic_metadata.json │ │ │ │ ├── gapic_version.py │ │ │ │ ├── py.typed │ │ │ │ ├── services │ │ │ │ ├── __init__.py │ │ │ │ └── eventarc │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── async_client.py │ │ │ │ │ ├── client.py │ │ │ │ │ ├── pagers.py │ │ │ │ │ └── transports │ │ │ │ │ ├── README.rst │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base.py │ │ │ │ │ ├── grpc.py │ │ │ │ │ ├── grpc_asyncio.py │ │ │ │ │ ├── rest.py │ │ │ │ │ └── rest_base.py │ │ │ │ └── types │ │ │ │ ├── __init__.py │ │ │ │ ├── channel.py │ │ │ │ ├── channel_connection.py │ │ │ │ ├── discovery.py │ │ │ │ ├── eventarc.py │ │ │ │ ├── google_channel_config.py │ │ │ │ └── trigger.py │ │ ├── mypy.ini │ │ ├── noxfile.py │ │ ├── samples │ │ │ └── generated_samples │ │ │ │ ├── eventarc_v1_generated_eventarc_create_channel_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_create_channel_connection_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_create_channel_connection_sync.py │ │ │ │ ├── eventarc_v1_generated_eventarc_create_channel_sync.py │ │ │ │ ├── eventarc_v1_generated_eventarc_create_trigger_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_create_trigger_sync.py │ │ │ │ ├── eventarc_v1_generated_eventarc_delete_channel_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_delete_channel_connection_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_delete_channel_connection_sync.py │ │ │ │ ├── eventarc_v1_generated_eventarc_delete_channel_sync.py │ │ │ │ ├── eventarc_v1_generated_eventarc_delete_trigger_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_delete_trigger_sync.py │ │ │ │ ├── eventarc_v1_generated_eventarc_get_channel_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_get_channel_connection_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_get_channel_connection_sync.py │ │ │ │ ├── eventarc_v1_generated_eventarc_get_channel_sync.py │ │ │ │ ├── eventarc_v1_generated_eventarc_get_google_channel_config_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_get_google_channel_config_sync.py │ │ │ │ ├── eventarc_v1_generated_eventarc_get_provider_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_get_provider_sync.py │ │ │ │ ├── eventarc_v1_generated_eventarc_get_trigger_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_get_trigger_sync.py │ │ │ │ ├── eventarc_v1_generated_eventarc_list_channel_connections_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_list_channel_connections_sync.py │ │ │ │ ├── eventarc_v1_generated_eventarc_list_channels_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_list_channels_sync.py │ │ │ │ ├── eventarc_v1_generated_eventarc_list_providers_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_list_providers_sync.py │ │ │ │ ├── eventarc_v1_generated_eventarc_list_triggers_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_list_triggers_sync.py │ │ │ │ ├── eventarc_v1_generated_eventarc_update_channel_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_update_channel_sync.py │ │ │ │ ├── eventarc_v1_generated_eventarc_update_google_channel_config_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_update_google_channel_config_sync.py │ │ │ │ ├── eventarc_v1_generated_eventarc_update_trigger_async.py │ │ │ │ ├── eventarc_v1_generated_eventarc_update_trigger_sync.py │ │ │ │ └── snippet_metadata_google.cloud.eventarc.v1.json │ │ ├── scripts │ │ │ └── fixup_eventarc_v1_keywords.py │ │ ├── setup.py │ │ ├── testing │ │ │ ├── constraints-3.10.txt │ │ │ ├── constraints-3.11.txt │ │ │ ├── constraints-3.12.txt │ │ │ ├── constraints-3.13.txt │ │ │ ├── constraints-3.7.txt │ │ │ ├── constraints-3.8.txt │ │ │ └── constraints-3.9.txt │ │ └── tests │ │ │ ├── __init__.py │ │ │ └── unit │ │ │ ├── __init__.py │ │ │ └── gapic │ │ │ ├── __init__.py │ │ │ └── eventarc_v1 │ │ │ ├── __init__.py │ │ │ └── test_eventarc.py │ ├── logging │ │ ├── .coveragerc │ │ ├── .flake8 │ │ ├── BUILD.bazel │ │ ├── LICENSE │ │ ├── MANIFEST.in │ │ ├── README.rst │ │ ├── docs │ │ │ ├── _static │ │ │ │ └── custom.css │ │ │ ├── _templates │ │ │ │ └── layout.html │ │ │ ├── conf.py │ │ │ ├── index.rst │ │ │ ├── logging_v2 │ │ │ │ ├── config_service_v2.rst │ │ │ │ ├── logging_service_v2.rst │ │ │ │ ├── metrics_service_v2.rst │ │ │ │ ├── services_.rst │ │ │ │ └── types_.rst │ │ │ └── multiprocessing.rst │ │ ├── google │ │ │ └── cloud │ │ │ │ ├── logging │ │ │ │ ├── __init__.py │ │ │ │ ├── gapic_version.py │ │ │ │ └── py.typed │ │ │ │ └── logging_v2 │ │ │ │ ├── __init__.py │ │ │ │ ├── gapic_metadata.json │ │ │ │ ├── gapic_version.py │ │ │ │ ├── py.typed │ │ │ │ ├── services │ │ │ │ ├── __init__.py │ │ │ │ ├── config_service_v2 │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── async_client.py │ │ │ │ │ ├── client.py │ │ │ │ │ ├── pagers.py │ │ │ │ │ └── transports │ │ │ │ │ │ ├── README.rst │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ ├── base.py │ │ │ │ │ │ ├── grpc.py │ │ │ │ │ │ └── grpc_asyncio.py │ │ │ │ ├── logging_service_v2 │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── async_client.py │ │ │ │ │ ├── client.py │ │ │ │ │ ├── pagers.py │ │ │ │ │ └── transports │ │ │ │ │ │ ├── README.rst │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ ├── base.py │ │ │ │ │ │ ├── grpc.py │ │ │ │ │ │ └── grpc_asyncio.py │ │ │ │ └── metrics_service_v2 │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── async_client.py │ │ │ │ │ ├── client.py │ │ │ │ │ ├── pagers.py │ │ │ │ │ └── transports │ │ │ │ │ ├── README.rst │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base.py │ │ │ │ │ ├── grpc.py │ │ │ │ │ └── grpc_asyncio.py │ │ │ │ └── types │ │ │ │ ├── __init__.py │ │ │ │ ├── log_entry.py │ │ │ │ ├── logging.py │ │ │ │ ├── logging_config.py │ │ │ │ └── logging_metrics.py │ │ ├── mypy.ini │ │ ├── noxfile.py │ │ ├── samples │ │ │ └── generated_samples │ │ │ │ ├── logging_v2_generated_config_service_v2_copy_log_entries_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_copy_log_entries_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_bucket_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_bucket_async_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_bucket_async_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_bucket_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_exclusion_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_exclusion_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_link_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_link_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_sink_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_sink_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_view_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_view_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_bucket_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_bucket_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_exclusion_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_exclusion_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_link_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_link_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_sink_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_sink_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_view_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_view_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_bucket_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_bucket_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_cmek_settings_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_cmek_settings_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_exclusion_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_exclusion_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_link_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_link_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_settings_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_settings_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_sink_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_sink_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_view_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_view_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_buckets_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_buckets_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_exclusions_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_exclusions_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_links_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_links_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_sinks_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_sinks_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_views_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_views_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_undelete_bucket_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_undelete_bucket_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_bucket_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_bucket_async_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_bucket_async_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_bucket_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_cmek_settings_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_cmek_settings_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_exclusion_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_exclusion_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_settings_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_settings_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_sink_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_sink_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_view_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_view_sync.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_delete_log_async.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_delete_log_sync.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_list_log_entries_async.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_list_log_entries_sync.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_list_logs_async.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_list_logs_sync.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_list_monitored_resource_descriptors_async.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_list_monitored_resource_descriptors_sync.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_tail_log_entries_async.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_tail_log_entries_sync.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_write_log_entries_async.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_write_log_entries_sync.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_create_log_metric_async.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_create_log_metric_sync.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_delete_log_metric_async.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_delete_log_metric_sync.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_get_log_metric_async.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_get_log_metric_sync.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_list_log_metrics_async.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_list_log_metrics_sync.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_update_log_metric_async.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_update_log_metric_sync.py │ │ │ │ └── snippet_metadata_google.logging.v2.json │ │ ├── scripts │ │ │ └── fixup_logging_v2_keywords.py │ │ ├── setup.py │ │ ├── testing │ │ │ ├── constraints-3.10.txt │ │ │ ├── constraints-3.11.txt │ │ │ ├── constraints-3.12.txt │ │ │ ├── constraints-3.13.txt │ │ │ ├── constraints-3.7.txt │ │ │ ├── constraints-3.8.txt │ │ │ └── constraints-3.9.txt │ │ └── tests │ │ │ ├── __init__.py │ │ │ └── unit │ │ │ ├── __init__.py │ │ │ └── gapic │ │ │ ├── __init__.py │ │ │ └── logging_v2 │ │ │ ├── __init__.py │ │ │ ├── test_config_service_v2.py │ │ │ ├── test_logging_service_v2.py │ │ │ └── test_metrics_service_v2.py │ ├── logging_internal │ │ ├── .coveragerc │ │ ├── .flake8 │ │ ├── BUILD.bazel │ │ ├── LICENSE │ │ ├── MANIFEST.in │ │ ├── README.rst │ │ ├── docs │ │ │ ├── _static │ │ │ │ └── custom.css │ │ │ ├── _templates │ │ │ │ └── layout.html │ │ │ ├── conf.py │ │ │ ├── index.rst │ │ │ ├── logging_v2 │ │ │ │ ├── config_service_v2.rst │ │ │ │ ├── logging_service_v2.rst │ │ │ │ ├── metrics_service_v2.rst │ │ │ │ ├── services_.rst │ │ │ │ └── types_.rst │ │ │ └── multiprocessing.rst │ │ ├── google │ │ │ └── cloud │ │ │ │ ├── logging │ │ │ │ ├── __init__.py │ │ │ │ ├── gapic_version.py │ │ │ │ └── py.typed │ │ │ │ └── logging_v2 │ │ │ │ ├── __init__.py │ │ │ │ ├── gapic_metadata.json │ │ │ │ ├── gapic_version.py │ │ │ │ ├── py.typed │ │ │ │ ├── services │ │ │ │ ├── __init__.py │ │ │ │ ├── config_service_v2 │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── async_client.py │ │ │ │ │ ├── client.py │ │ │ │ │ ├── pagers.py │ │ │ │ │ └── transports │ │ │ │ │ │ ├── README.rst │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ ├── base.py │ │ │ │ │ │ ├── grpc.py │ │ │ │ │ │ └── grpc_asyncio.py │ │ │ │ ├── logging_service_v2 │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── async_client.py │ │ │ │ │ ├── client.py │ │ │ │ │ ├── pagers.py │ │ │ │ │ └── transports │ │ │ │ │ │ ├── README.rst │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ ├── base.py │ │ │ │ │ │ ├── grpc.py │ │ │ │ │ │ └── grpc_asyncio.py │ │ │ │ └── metrics_service_v2 │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── async_client.py │ │ │ │ │ ├── client.py │ │ │ │ │ ├── pagers.py │ │ │ │ │ └── transports │ │ │ │ │ ├── README.rst │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base.py │ │ │ │ │ ├── grpc.py │ │ │ │ │ └── grpc_asyncio.py │ │ │ │ └── types │ │ │ │ ├── __init__.py │ │ │ │ ├── log_entry.py │ │ │ │ ├── logging.py │ │ │ │ ├── logging_config.py │ │ │ │ └── logging_metrics.py │ │ ├── mypy.ini │ │ ├── noxfile.py │ │ ├── samples │ │ │ └── generated_samples │ │ │ │ ├── logging_v2_generated_config_service_v2_copy_log_entries_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_copy_log_entries_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_bucket_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_bucket_async_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_bucket_async_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_bucket_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_exclusion_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_exclusion_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_link_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_link_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_sink_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_sink_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_view_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_create_view_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_bucket_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_bucket_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_exclusion_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_exclusion_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_link_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_link_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_sink_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_sink_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_view_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_delete_view_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_bucket_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_bucket_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_cmek_settings_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_cmek_settings_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_exclusion_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_exclusion_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_link_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_link_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_settings_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_settings_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_sink_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_sink_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_view_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_get_view_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_buckets_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_buckets_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_exclusions_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_exclusions_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_links_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_links_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_sinks_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_sinks_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_views_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_list_views_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_undelete_bucket_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_undelete_bucket_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_bucket_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_bucket_async_async.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_bucket_async_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_bucket_sync.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_cmek_settings_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_cmek_settings_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_exclusion_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_exclusion_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_settings_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_settings_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_sink_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_sink_sync_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_view_async_internal.py │ │ │ │ ├── logging_v2_generated_config_service_v2_update_view_sync_internal.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_delete_log_async.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_delete_log_sync.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_list_log_entries_async.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_list_log_entries_sync.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_list_logs_async.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_list_logs_sync.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_list_monitored_resource_descriptors_async.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_list_monitored_resource_descriptors_sync.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_tail_log_entries_async.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_tail_log_entries_sync.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_write_log_entries_async.py │ │ │ │ ├── logging_v2_generated_logging_service_v2_write_log_entries_sync.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_create_log_metric_async_internal.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_create_log_metric_sync_internal.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_delete_log_metric_async_internal.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_delete_log_metric_sync_internal.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_get_log_metric_async_internal.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_get_log_metric_sync_internal.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_list_log_metrics_async_internal.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_list_log_metrics_sync_internal.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_update_log_metric_async_internal.py │ │ │ │ ├── logging_v2_generated_metrics_service_v2_update_log_metric_sync_internal.py │ │ │ │ └── snippet_metadata_google.logging.v2.json │ │ ├── scripts │ │ │ └── fixup_logging_v2_keywords.py │ │ ├── setup.py │ │ ├── testing │ │ │ ├── constraints-3.10.txt │ │ │ ├── constraints-3.11.txt │ │ │ ├── constraints-3.12.txt │ │ │ ├── constraints-3.13.txt │ │ │ ├── constraints-3.7.txt │ │ │ ├── constraints-3.8.txt │ │ │ └── constraints-3.9.txt │ │ └── tests │ │ │ ├── __init__.py │ │ │ └── unit │ │ │ ├── __init__.py │ │ │ └── gapic │ │ │ ├── __init__.py │ │ │ └── logging_v2 │ │ │ ├── __init__.py │ │ │ ├── test_config_service_v2.py │ │ │ ├── test_logging_service_v2.py │ │ │ └── test_metrics_service_v2.py │ ├── redis │ │ ├── .coveragerc │ │ ├── .flake8 │ │ ├── BUILD.bazel │ │ ├── LICENSE │ │ ├── MANIFEST.in │ │ ├── README.rst │ │ ├── docs │ │ │ ├── _static │ │ │ │ └── custom.css │ │ │ ├── _templates │ │ │ │ └── layout.html │ │ │ ├── conf.py │ │ │ ├── index.rst │ │ │ ├── multiprocessing.rst │ │ │ └── redis_v1 │ │ │ │ ├── cloud_redis.rst │ │ │ │ ├── services_.rst │ │ │ │ └── types_.rst │ │ ├── google │ │ │ └── cloud │ │ │ │ ├── redis │ │ │ │ ├── __init__.py │ │ │ │ ├── gapic_version.py │ │ │ │ └── py.typed │ │ │ │ └── redis_v1 │ │ │ │ ├── __init__.py │ │ │ │ ├── gapic_metadata.json │ │ │ │ ├── gapic_version.py │ │ │ │ ├── py.typed │ │ │ │ ├── services │ │ │ │ ├── __init__.py │ │ │ │ └── cloud_redis │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── async_client.py │ │ │ │ │ ├── client.py │ │ │ │ │ ├── pagers.py │ │ │ │ │ └── transports │ │ │ │ │ ├── README.rst │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── base.py │ │ │ │ │ ├── grpc.py │ │ │ │ │ ├── grpc_asyncio.py │ │ │ │ │ ├── rest.py │ │ │ │ │ ├── rest_asyncio.py │ │ │ │ │ └── rest_base.py │ │ │ │ └── types │ │ │ │ ├── __init__.py │ │ │ │ └── cloud_redis.py │ │ ├── mypy.ini │ │ ├── noxfile.py │ │ ├── samples │ │ │ └── generated_samples │ │ │ │ ├── redis_v1_generated_cloud_redis_create_instance_async.py │ │ │ │ ├── redis_v1_generated_cloud_redis_create_instance_sync.py │ │ │ │ ├── redis_v1_generated_cloud_redis_delete_instance_async.py │ │ │ │ ├── redis_v1_generated_cloud_redis_delete_instance_sync.py │ │ │ │ ├── redis_v1_generated_cloud_redis_export_instance_async.py │ │ │ │ ├── redis_v1_generated_cloud_redis_export_instance_sync.py │ │ │ │ ├── redis_v1_generated_cloud_redis_failover_instance_async.py │ │ │ │ ├── redis_v1_generated_cloud_redis_failover_instance_sync.py │ │ │ │ ├── redis_v1_generated_cloud_redis_get_instance_async.py │ │ │ │ ├── redis_v1_generated_cloud_redis_get_instance_auth_string_async.py │ │ │ │ ├── redis_v1_generated_cloud_redis_get_instance_auth_string_sync.py │ │ │ │ ├── redis_v1_generated_cloud_redis_get_instance_sync.py │ │ │ │ ├── redis_v1_generated_cloud_redis_import_instance_async.py │ │ │ │ ├── redis_v1_generated_cloud_redis_import_instance_sync.py │ │ │ │ ├── redis_v1_generated_cloud_redis_list_instances_async.py │ │ │ │ ├── redis_v1_generated_cloud_redis_list_instances_sync.py │ │ │ │ ├── redis_v1_generated_cloud_redis_reschedule_maintenance_async.py │ │ │ │ ├── redis_v1_generated_cloud_redis_reschedule_maintenance_sync.py │ │ │ │ ├── redis_v1_generated_cloud_redis_update_instance_async.py │ │ │ │ ├── redis_v1_generated_cloud_redis_update_instance_sync.py │ │ │ │ ├── redis_v1_generated_cloud_redis_upgrade_instance_async.py │ │ │ │ ├── redis_v1_generated_cloud_redis_upgrade_instance_sync.py │ │ │ │ └── snippet_metadata_google.cloud.redis.v1.json │ │ ├── scripts │ │ │ └── fixup_redis_v1_keywords.py │ │ ├── setup.py │ │ ├── testing │ │ │ ├── constraints-3.10.txt │ │ │ ├── constraints-3.11.txt │ │ │ ├── constraints-3.12.txt │ │ │ ├── constraints-3.13.txt │ │ │ ├── constraints-3.7.txt │ │ │ ├── constraints-3.8.txt │ │ │ └── constraints-3.9.txt │ │ └── tests │ │ │ ├── __init__.py │ │ │ └── unit │ │ │ ├── __init__.py │ │ │ └── gapic │ │ │ ├── __init__.py │ │ │ └── redis_v1 │ │ │ ├── __init__.py │ │ │ └── test_cloud_redis.py │ └── redis_selective │ │ ├── .coveragerc │ │ ├── .flake8 │ │ ├── BUILD.bazel │ │ ├── LICENSE │ │ ├── MANIFEST.in │ │ ├── README.rst │ │ ├── docs │ │ ├── _static │ │ │ └── custom.css │ │ ├── _templates │ │ │ └── layout.html │ │ ├── conf.py │ │ ├── index.rst │ │ ├── multiprocessing.rst │ │ └── redis_v1 │ │ │ ├── cloud_redis.rst │ │ │ ├── services_.rst │ │ │ └── types_.rst │ │ ├── google │ │ └── cloud │ │ │ ├── redis │ │ │ ├── __init__.py │ │ │ ├── gapic_version.py │ │ │ └── py.typed │ │ │ └── redis_v1 │ │ │ ├── __init__.py │ │ │ ├── gapic_metadata.json │ │ │ ├── gapic_version.py │ │ │ ├── py.typed │ │ │ ├── services │ │ │ ├── __init__.py │ │ │ └── cloud_redis │ │ │ │ ├── __init__.py │ │ │ │ ├── async_client.py │ │ │ │ ├── client.py │ │ │ │ ├── pagers.py │ │ │ │ └── transports │ │ │ │ ├── README.rst │ │ │ │ ├── __init__.py │ │ │ │ ├── base.py │ │ │ │ ├── grpc.py │ │ │ │ ├── grpc_asyncio.py │ │ │ │ ├── rest.py │ │ │ │ ├── rest_asyncio.py │ │ │ │ └── rest_base.py │ │ │ └── types │ │ │ ├── __init__.py │ │ │ └── cloud_redis.py │ │ ├── mypy.ini │ │ ├── noxfile.py │ │ ├── samples │ │ └── generated_samples │ │ │ ├── redis_v1_generated_cloud_redis_create_instance_async.py │ │ │ ├── redis_v1_generated_cloud_redis_create_instance_sync.py │ │ │ ├── redis_v1_generated_cloud_redis_delete_instance_async.py │ │ │ ├── redis_v1_generated_cloud_redis_delete_instance_sync.py │ │ │ ├── redis_v1_generated_cloud_redis_get_instance_async.py │ │ │ ├── redis_v1_generated_cloud_redis_get_instance_sync.py │ │ │ ├── redis_v1_generated_cloud_redis_list_instances_async.py │ │ │ ├── redis_v1_generated_cloud_redis_list_instances_sync.py │ │ │ ├── redis_v1_generated_cloud_redis_update_instance_async.py │ │ │ ├── redis_v1_generated_cloud_redis_update_instance_sync.py │ │ │ └── snippet_metadata_google.cloud.redis.v1.json │ │ ├── scripts │ │ └── fixup_redis_v1_keywords.py │ │ ├── setup.py │ │ ├── testing │ │ ├── constraints-3.10.txt │ │ ├── constraints-3.11.txt │ │ ├── constraints-3.12.txt │ │ ├── constraints-3.13.txt │ │ ├── constraints-3.7.txt │ │ ├── constraints-3.8.txt │ │ └── constraints-3.9.txt │ │ └── tests │ │ ├── __init__.py │ │ └── unit │ │ ├── __init__.py │ │ └── gapic │ │ ├── __init__.py │ │ └── redis_v1 │ │ ├── __init__.py │ │ └── test_cloud_redis.py ├── iamcredentials_grpc_service_config.json ├── iamcredentials_v1.yaml ├── logging_grpc_service_config.json ├── logging_internal_v2.yaml ├── logging_v2.yaml ├── redis_grpc_service_config.json ├── redis_selective_v1.yaml └── redis_v1.yaml ├── snippetgen ├── goldens │ ├── mollusca_v1_generated_snippets_list_resources_async.py │ ├── mollusca_v1_generated_snippets_list_resources_sync.py │ ├── mollusca_v1_generated_snippets_method_bidi_streaming_async.py │ ├── mollusca_v1_generated_snippets_method_bidi_streaming_sync.py │ ├── mollusca_v1_generated_snippets_method_lro_signatures_async.py │ ├── mollusca_v1_generated_snippets_method_lro_signatures_sync.py │ ├── mollusca_v1_generated_snippets_method_one_signature_async.py │ ├── mollusca_v1_generated_snippets_method_one_signature_sync.py │ ├── mollusca_v1_generated_snippets_method_server_streaming_async.py │ ├── mollusca_v1_generated_snippets_method_server_streaming_sync.py │ ├── mollusca_v1_generated_snippets_one_of_method_async.py │ ├── mollusca_v1_generated_snippets_one_of_method_required_field_async.py │ ├── mollusca_v1_generated_snippets_one_of_method_required_field_sync.py │ ├── mollusca_v1_generated_snippets_one_of_method_sync.py │ └── snippet_metadata_mollusca_v1.json ├── snippets.proto └── test_snippetgen.py ├── system ├── conftest.py ├── test_api_version_header.py ├── test_client_context_manager.py ├── test_error_details.py ├── test_grpc_interceptor_streams.py ├── test_lro.py ├── test_mixins.py ├── test_pagination.py ├── test_request_metadata.py ├── test_resource_crud.py ├── test_response_metadata.py ├── test_retry.py ├── test_streams.py ├── test_unary.py └── test_universe_domain.py └── unit ├── __init__.py ├── common_types.py ├── configurable_snippetgen ├── resources │ ├── README.md │ └── speech │ │ ├── request.desc │ │ ├── speech_createCustomClass.json │ │ └── speech_v1_generated_adaptation_create_custom_class_basic_async.py ├── test_configured_snippet.py ├── test_libcst_utils.py └── test_resources.py ├── generator ├── __init__.py ├── test_formatter.py ├── test_generator.py └── test_options.py ├── samplegen ├── __init__.py ├── golden_snippets │ ├── sample_basic.py │ ├── sample_basic_async.py │ ├── sample_basic_internal.py │ ├── sample_basic_unflattenable.py │ └── sample_basic_void_method.py ├── test_integration.py ├── test_manifest.py ├── test_samplegen.py ├── test_snippet_index.py └── test_template.py ├── schema ├── test_api.py ├── test_imp.py ├── test_metadata.py ├── test_naming.py └── wrappers │ ├── test_enums.py │ ├── test_field.py │ ├── test_message.py │ ├── test_method.py │ ├── test_oneof.py │ ├── test_python.py │ ├── test_routing.py │ └── test_service.py └── utils ├── test_cache.py ├── test_case.py ├── test_checks.py ├── test_code.py ├── test_filename.py ├── test_lines.py ├── test_rst.py ├── test_uri_conv.py └── test_uri_sample.py /.bazeliskrc: -------------------------------------------------------------------------------- 1 | # See https://github.com/bazelbuild/bazelisk 2 | USE_BAZEL_VERSION=6.5.0 3 | -------------------------------------------------------------------------------- /.bazelrc: -------------------------------------------------------------------------------- 1 | # New protobuf requires C++17 2 | build --repo_env=BAZEL_CXXOPTS="-std=c++17" 3 | -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | omit = 4 | gapic/cli/*.py 5 | *_pb2.py 6 | 7 | [report] 8 | fail_under = 100 9 | show_missing = True 10 | exclude_lines = 11 | # Re-enable the standard pragma 12 | pragma: NO COVER 13 | # Enable an English version. 14 | Impossible; skip coverage checks. 15 | # Ignore debug-only repr 16 | def __repr__ 17 | # Abstract methods by definition are not invoked 18 | @abstractmethod 19 | @abc.abstractmethod 20 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # Version control scaffolding 2 | .git 3 | .gitignore 4 | 5 | # Python scaffolding 6 | *.py[cod] 7 | *.egg 8 | *.egg-info 9 | dist 10 | build 11 | eggs 12 | parts 13 | bin 14 | var 15 | sdist 16 | develop-eggs 17 | .installed.cfg 18 | lib 19 | lib64 20 | __pycache__ 21 | 22 | # Installer logs 23 | pip-log.txt 24 | 25 | # Unit test / coverage reports 26 | .coverage 27 | .nox 28 | .tox 29 | .cache 30 | .pytest_cache 31 | htmlcov 32 | 33 | # Translations 34 | *.mo 35 | 36 | # Mac 37 | .DS_Store 38 | 39 | # Mr Developer 40 | .mr.developer.cfg 41 | .project 42 | .pydevproject 43 | 44 | # JetBrains 45 | .idea 46 | 47 | # Built documentation 48 | docs/_build 49 | docs/_build_doc2dash 50 | 51 | # Virtual environment 52 | env/ 53 | coverage.xml 54 | 55 | # Make sure a generated file isn't accidentally committed. 56 | pylintrc 57 | pylintrc.test 58 | -------------------------------------------------------------------------------- /.github/.OwlBot.lock.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | docker: 15 | image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest 16 | digest: sha256:5581906b957284864632cde4e9c51d1cc66b0094990b27e689132fe5cd036046 17 | # created: 2025-03-05 18 | -------------------------------------------------------------------------------- /.github/.OwlBot.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | docker: 16 | image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest 17 | 18 | begin-after-commit-hash: 70f7f0525414fe4dfeb2fc2e81546b073f83a621 19 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Code owners file. 2 | # This file controls who is tagged for review for any given pull request. 3 | 4 | * @googleapis/python-core-client-libraries 5 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. There are 4 | just a few small guidelines you need to follow. 5 | 6 | ## Contributor License Agreement 7 | 8 | Contributions to this project must be accompanied by a Contributor License 9 | Agreement. You (or your employer) retain the copyright to your contribution; 10 | this simply gives us permission to use and redistribute your contributions as 11 | part of the project. Head over to to see 12 | your current agreements on file or to sign a new one. 13 | 14 | You generally only need to submit a CLA once, so if you've already submitted one 15 | (even if it was for a different project), you probably don't need to do it 16 | again. 17 | 18 | ## Code reviews 19 | 20 | All submissions, including submissions by project members, require review. We 21 | use GitHub pull requests for this purpose. Consult 22 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 23 | information on using pull requests. 24 | 25 | ## Community Guidelines 26 | 27 | This project follows [Google's Open Source Community 28 | Guidelines](https://opensource.google.com/conduct/). 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | Thanks for stopping by to let us know something could be better! 8 | 9 | **PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. 10 | 11 | Please run down the following list and make sure you've tried the usual "quick fixes": 12 | 13 | - Search the issues already opened: https://github.com/googleapis/gapic-generator-python/issues 14 | - Search StackOverflow: https://stackoverflow.com/questions/tagged/google-cloud-platform+python 15 | 16 | If you are still having issues, please be sure to include as much information as possible: 17 | 18 | #### Environment details 19 | 20 | - OS type and version: 21 | - Python version: `python --version` 22 | - pip version: `pip --version` 23 | - `gapic-generator` version: `pip show gapic-generator` 24 | 25 | #### Steps to reproduce 26 | 27 | 1. ? 28 | 2. ? 29 | 30 | #### Code example 31 | 32 | ```python 33 | # example 34 | ``` 35 | 36 | #### Stack trace 37 | ``` 38 | # example 39 | ``` 40 | 41 | Making sure to follow these steps will guarantee the quickest resolution possible. 42 | 43 | Thanks! 44 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this library 4 | 5 | --- 6 | 7 | Thanks for stopping by to let us know something could be better! 8 | 9 | **PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. 10 | 11 | **Is your feature request related to a problem? Please describe.** 12 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | **Describe alternatives you've considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | **Additional context** 18 | Add any other context or screenshots about the feature request here. 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/support_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Support request 3 | about: If you have a support contract with Google, please create an issue in the Google Cloud Support console. 4 | 5 | --- 6 | 7 | **PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response. 8 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: 2 | - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/gapic-generator-python/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea 3 | - [ ] Ensure the tests and linter pass 4 | - [ ] Code coverage does not decrease (if any source code was changed) 5 | - [ ] Appropriate docs were updated (if necessary) 6 | 7 | Fixes # 🦕 8 | -------------------------------------------------------------------------------- /.github/auto-label.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2024 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | requestsize: 15 | enabled: true 16 | 17 | path: 18 | pullrequest: true 19 | paths: 20 | samples: "samples" 21 | -------------------------------------------------------------------------------- /.github/blunderbuss.yml: -------------------------------------------------------------------------------- 1 | # Blunderbuss config 2 | # 3 | # This file controls who is assigned for pull requests and issues. 4 | # Note: This file is autogenerated. To make changes to the assignee 5 | # team, please update `codeowner_team` in `.repo-metadata.json`. 6 | assign_issues: 7 | - googleapis/actools-python 8 | 9 | assign_issues_by: 10 | - labels: 11 | - "samples" 12 | to: 13 | - googleapis/python-samples-reviewers 14 | - googleapis/actools-python 15 | 16 | assign_prs: 17 | - googleapis/actools-python 18 | -------------------------------------------------------------------------------- /.github/header-checker-lint.yml: -------------------------------------------------------------------------------- 1 | {"allowedCopyrightHolders": ["Google LLC"], 2 | "allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"], 3 | "ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt", "**/__init__.py", "samples/**/constraints.txt", "samples/**/constraints-test.txt"], 4 | "sourceFileExtensions": [ 5 | "ts", 6 | "js", 7 | "java", 8 | "sh", 9 | "Dockerfile", 10 | "yaml", 11 | "py", 12 | "html", 13 | "txt" 14 | ] 15 | } -------------------------------------------------------------------------------- /.github/release-please.yml: -------------------------------------------------------------------------------- 1 | releaseType: python 2 | handleGHRelease: true 3 | -------------------------------------------------------------------------------- /.github/release-trigger.yml: -------------------------------------------------------------------------------- 1 | enabled: true 2 | multiScmName: gapic-generator-python 3 | -------------------------------------------------------------------------------- /.github/snippet-bot.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/gapic-generator-python/890731963ce033745b6804fa27b86b32ccc2564c/.github/snippet-bot.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.py[cod] 2 | *.sw[op] 3 | 4 | # Bazel 5 | bazel-* 6 | 7 | # C extensions 8 | *.so 9 | 10 | # Packages 11 | *.egg 12 | *.egg-info 13 | dist 14 | build 15 | eggs 16 | parts 17 | bin 18 | var 19 | sdist 20 | develop-eggs 21 | .installed.cfg 22 | lib 23 | lib64 24 | __pycache__ 25 | 26 | # Installer logs 27 | pip-log.txt 28 | 29 | # Unit test / coverage reports 30 | .coverage 31 | .nox 32 | .tox 33 | .cache 34 | .pytest_cache 35 | htmlcov 36 | 37 | # Translations 38 | *.mo 39 | 40 | # Mac 41 | .DS_Store 42 | 43 | # Mr Developer 44 | .mr.developer.cfg 45 | .project 46 | .pydevproject 47 | 48 | # JetBrains 49 | .idea 50 | 51 | # VS Code 52 | .vscode 53 | 54 | # Built documentation 55 | docs/_build 56 | docs/_build_doc2dash 57 | 58 | # Virtual environment 59 | env/ 60 | coverage.xml 61 | 62 | # Make sure a generated file isn't accidentally committed. 63 | pylintrc 64 | pylintrc.test 65 | 66 | # Mypy 67 | .mypy_cache 68 | 69 | # pyenv 70 | .python-version 71 | 72 | # Test dependencies and output 73 | api-common-protos 74 | tests/snippetgen/.test_output 75 | -------------------------------------------------------------------------------- /.kokoro/continuous/common.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Build logs will be here 4 | action { 5 | define_artifacts { 6 | regex: "**/*sponge_log.xml" 7 | } 8 | } 9 | 10 | # Download trampoline resources. 11 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" 12 | 13 | # Download resources for system tests (service account key, etc.) 14 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-python" 15 | 16 | # Use the trampoline script to run in docker. 17 | build_file: "gapic-generator-python/.kokoro/trampoline.sh" 18 | 19 | # Configure the docker image for kokoro-trampoline. 20 | env_vars: { 21 | key: "TRAMPOLINE_IMAGE" 22 | value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" 23 | } 24 | env_vars: { 25 | key: "TRAMPOLINE_BUILD_FILE" 26 | value: "github/gapic-generator-python/.kokoro/build.sh" 27 | } 28 | -------------------------------------------------------------------------------- /.kokoro/continuous/continuous.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto -------------------------------------------------------------------------------- /.kokoro/presubmit/common.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto 2 | 3 | # Build logs will be here 4 | action { 5 | define_artifacts { 6 | regex: "**/*sponge_log.xml" 7 | } 8 | } 9 | 10 | # Download trampoline resources. 11 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" 12 | 13 | # Download resources for system tests (service account key, etc.) 14 | gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-python" 15 | 16 | # Use the trampoline script to run in docker. 17 | build_file: "gapic-generator-python/.kokoro/trampoline.sh" 18 | 19 | # Configure the docker image for kokoro-trampoline. 20 | env_vars: { 21 | key: "TRAMPOLINE_IMAGE" 22 | value: "gcr.io/cloud-devrel-kokoro-resources/python-multi" 23 | } 24 | env_vars: { 25 | key: "TRAMPOLINE_BUILD_FILE" 26 | value: "github/gapic-generator-python/.kokoro/build.sh" 27 | } 28 | -------------------------------------------------------------------------------- /.kokoro/presubmit/presubmit.cfg: -------------------------------------------------------------------------------- 1 | # Format: //devtools/kokoro/config/proto/build.proto -------------------------------------------------------------------------------- /.kokoro/trampoline.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright 2024 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | set -eo pipefail 17 | 18 | # Always run the cleanup script, regardless of the success of bouncing into 19 | # the container. 20 | function cleanup() { 21 | chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh 22 | ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh 23 | echo "cleanup"; 24 | } 25 | trap cleanup EXIT 26 | 27 | $(dirname $0)/populate-secrets.sh # Secret Manager secrets. 28 | python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | --- 2 | build: 3 | image: latest 4 | python: 5 | pip_install: true 6 | version: 3.7 7 | -------------------------------------------------------------------------------- /.repo-metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gapic-generator", 3 | "name_pretty": "Google API Client Generator for Python", 4 | "client_documentation": "https://gapic-generator-python.readthedocs.io/en/stable/", 5 | "product_documentation": "", 6 | "issue_tracker": "https://github.com/googleapis/gapic-generator-python/issues", 7 | "release_level": "stable", 8 | "language": "python", 9 | "library_type": "CORE", 10 | "repo": "googleapis/gapic-generator-python", 11 | "distribution_name": "gapic-generator", 12 | "default_version": "", 13 | "codeowner_team": "@googleapis/actools-python" 14 | } 15 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. There are 4 | just a few small guidelines you need to follow. 5 | 6 | ## Contributor License Agreement 7 | 8 | Contributions to this project must be accompanied by a Contributor License 9 | Agreement. You (or your employer) retain the copyright to your contribution; 10 | this simply gives us permission to use and redistribute your contributions as 11 | part of the project. Head over to to see 12 | your current agreements on file or to sign a new one. 13 | 14 | You generally only need to submit a CLA once, so if you've already submitted one 15 | (even if it was for a different project), you probably don't need to do it 16 | again. 17 | 18 | ## Code Reviews 19 | 20 | All submissions, including submissions by project members, require review. We 21 | use GitHub pull requests for this purpose. Consult 22 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 23 | information on using pull requests. 24 | 25 | ## Community Guidelines 26 | 27 | This project follows [Google's Open Source Community 28 | Guidelines](https://opensource.google/conduct/). 29 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.rst LICENSE 2 | recursive-include gapic *.json *.proto 3 | recursive-include gapic/templates *.j2 4 | recursive-include tests * 5 | global-exclude *.py[co] 6 | global-exclude __pycache__ 7 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). 4 | 5 | The Google Security Team will respond within 5 working days of your report on g.co/vulnz. 6 | 7 | We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. 8 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SPHINXPROJ = APIClientGeneratorforPython 8 | SOURCEDIR = . 9 | BUILDDIR = _build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/getting-started/_example.rst: -------------------------------------------------------------------------------- 1 | If you want to experiment with an already-existing API, one example is 2 | available. (Reminder that this is still considered experimental, so apologies 3 | for this part being a bit strange.) 4 | 5 | You need to clone the `googleapis`_ repository from GitHub: 6 | 7 | .. code-block:: shell 8 | 9 | $ git clone https://github.com/googleapis/googleapis.git 10 | 11 | It is possible to generate libraries for most (possibly all) APIs described 12 | here. The API we use as an example is the `Google Cloud Vision`_ API, 13 | available in the ``google/cloud/vision/v1/`` subdirectory. This will be used 14 | for the remainder of the examples on this page. 15 | 16 | .. _googleapis: https://github.com/googleapis/googleapis 17 | .. _Google Cloud Vision: https://cloud.google.com/vision/ 18 | -------------------------------------------------------------------------------- /docs/getting-started/_samplegen.rst: -------------------------------------------------------------------------------- 1 | Generating Samples 2 | ~~~~~~~~~~~~~~~~~~ 3 | 4 | In addition to generating client libraries, the generator can also create standalone executable code samples. 5 | 6 | The user can specify individual sample config files or can pass paths to directories that contain sample configs. Directories are searched recursively, and any file that is not a sample config is ignored. 7 | 8 | .. 9 | TODO: provide documentation links when they are present 10 | 11 | A full description of the sample config, generated manifest, and generated samples is outside the scope of this documentation. 12 | We will provide links to such documentation when it is ready. 13 | 14 | Samples and manifests are always generated in a 'samples' subdir of the destination directory. 15 | -------------------------------------------------------------------------------- /docs/getting-started/_usage_intro.rst: -------------------------------------------------------------------------------- 1 | To use this plugin, you will need an API which is specified using 2 | protocol buffers. Additionally, this plugin makes some assumptions at the 3 | margins according to Google API design conventions as described in 4 | `AIPs`_, so following those conventions is recommended. 5 | 6 | .. _AIPs: https://aip.dev 7 | -------------------------------------------------------------------------------- /docs/getting-started/index.rst: -------------------------------------------------------------------------------- 1 | Getting Started 2 | --------------- 3 | 4 | This code generator is implemented as a plugin to ``protoc``, the compiler 5 | for `protocol buffers`_, and will run in any environment that Python 3.7+ and 6 | protocol buffers do. 7 | 8 | It is recommended to install the tool locally and run it through ``protoc``. 9 | 10 | 11 | .. _protocol buffers: https://developers.google.com/protocol-buffers/ 12 | 13 | .. toctree:: 14 | :maxdepth: 4 15 | 16 | local 17 | bazel 18 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | API Client Generator for Python 2 | =============================== 3 | 4 | A generator for protocol buffer described APIs for and in Python 3. 5 | 6 | This tool is a client library generator that implements the 7 | `client library generators`_ specification. 8 | 9 | It accepts an API specified in `protocol buffers`_ and generates 10 | a client library, which can be used to interact with that API. It is 11 | implemented as a plugin to ``protoc``, the protocol buffer compiler. 12 | 13 | .. _protocol buffers: https://developers.google.com/protocol-buffers/ 14 | .. _client library generators: https://aip.dev/client-libraries 15 | 16 | .. toctree:: 17 | :maxdepth: 2 18 | 19 | getting-started/index 20 | process 21 | templates 22 | status 23 | reference/index 24 | -------------------------------------------------------------------------------- /docs/reference/generator.rst: -------------------------------------------------------------------------------- 1 | generator 2 | --------- 3 | 4 | .. automodule:: gapic.generator 5 | 6 | .. automodule:: gapic.generator.generator 7 | :members: 8 | -------------------------------------------------------------------------------- /docs/reference/index.rst: -------------------------------------------------------------------------------- 1 | Reference 2 | --------- 3 | 4 | Below is a reference for the major classes and functions within this 5 | module. 6 | 7 | It is split into three main sections: 8 | 9 | - The ``schema`` module contains data classes that make up the internal 10 | representation for an :class:`~.API`. The API contains thin wrappers 11 | around protocol buffer descriptors; the goal of the wrappers is to 12 | mostly expose the underlying descriptors, but make some of the more 13 | complicated access and references easier in templates. 14 | - The ``generator`` module contains most of the logic. Its 15 | :class:`~.Generator` class is the thing that takes a request from ``protoc`` 16 | and gives it back a response. 17 | - The ``utils`` module contains utility functions needed elsewhere, 18 | including some functions that are sent to all templates as Jinja filters. 19 | 20 | .. note:: 21 | 22 | Templates are housed in the ``templates`` directory, which is a sibling 23 | to the modules listed above. 24 | 25 | .. toctree:: 26 | :maxdepth: 4 27 | 28 | generator 29 | schema 30 | utils 31 | -------------------------------------------------------------------------------- /docs/reference/schema.rst: -------------------------------------------------------------------------------- 1 | schema 2 | ------ 3 | 4 | .. automodule:: gapic.schema 5 | 6 | api 7 | ~~~ 8 | 9 | .. automodule:: gapic.schema.api 10 | :members: 11 | 12 | metadata 13 | ~~~~~~~~ 14 | 15 | .. automodule:: gapic.schema.metadata 16 | :members: 17 | 18 | naming 19 | ~~~~~~ 20 | 21 | .. automodule:: gapic.schema.naming 22 | :members: 23 | 24 | 25 | wrappers 26 | ~~~~~~~~ 27 | 28 | .. automodule:: gapic.schema.wrappers 29 | :members: 30 | -------------------------------------------------------------------------------- /docs/reference/utils.rst: -------------------------------------------------------------------------------- 1 | utils 2 | ----- 3 | 4 | .. automodule:: gapic.utils.case 5 | :members: 6 | 7 | .. automodule:: gapic.utils.lines 8 | :members: 9 | -------------------------------------------------------------------------------- /docs/status.rst: -------------------------------------------------------------------------------- 1 | Features and Limitations 2 | ------------------------ 3 | 4 | Nice things this client does: 5 | 6 | - Implemented in pure Python, with language-idiomatic templating tools. 7 | - It supports multiple transports: both gRPC and protobuf over HTTP/1.1. 8 | A JSON-based transport would be easy to add. 9 | - It uses a lighter-weight configuration, specified in the protocol 10 | buffer itself. 11 | 12 | As this is experimental work, please note the following limitations: 13 | 14 | - The output only works on Python 3.5 and above. 15 | - The configuration annotations are experimental and provided in 16 | `an awkward location`_. 17 | - gRPC must be installed even if you are not using it (this is due to 18 | some minor issues in ``api-core``). 19 | - No support for samples yet. 20 | 21 | .. _an awkward location: https://github.com/googleapis/api-common-protos/blob/input-contract/google/api/ 22 | -------------------------------------------------------------------------------- /gapic/ads-templates/%namespace/%name/%version/%sub/__init__.py.j2: -------------------------------------------------------------------------------- 1 | {% extends '_base.py.j2' %} 2 | 3 | {% block content %} 4 | 5 | 6 | {# Define __all__. 7 | This requires the full set of imported names, so we iterate over 8 | them again. 9 | -#} 10 | __all__ = ( 11 | {% filter sort_lines -%} 12 | {% for subpackage in api.subpackages -%} 13 | '{{ subpackage }}', 14 | {% endfor -%} 15 | {% for service in api.services.values() 16 | if service.meta.address.subpackage == api.subpackage_view -%} 17 | '{{ service.client_name }}', 18 | {% endfor -%} 19 | {% for proto in api.protos.values() 20 | if proto.meta.address.subpackage == api.subpackage_view -%} 21 | {% for message in proto.messages.values() -%} 22 | '{{ message.name }}', 23 | {% endfor -%} 24 | {% for enum in proto.enums.values() -%} 25 | '{{ enum.name }}', 26 | {% endfor -%} 27 | {% endfor -%} 28 | {% endfilter -%} 29 | ) 30 | {% endblock %} 31 | -------------------------------------------------------------------------------- /gapic/ads-templates/%namespace/%name/%version/%sub/gapic_version.py.j2: -------------------------------------------------------------------------------- 1 | {% extends '_base.py.j2' %} 2 | {% block content %} 3 | 4 | __version__ = "0.0.0" 5 | {% endblock %} 6 | -------------------------------------------------------------------------------- /gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/__init__.py.j2: -------------------------------------------------------------------------------- 1 | {% extends '_base.py.j2' %} 2 | 3 | {% block content %} 4 | 5 | from .client import {{ service.client_name }} 6 | 7 | __all__ = ( 8 | '{{ service.client_name }}', 9 | ) 10 | {% endblock %} 11 | -------------------------------------------------------------------------------- /gapic/ads-templates/%namespace/%name/%version/%sub/services/%service/transports/__init__.py.j2: -------------------------------------------------------------------------------- 1 | {% extends '_base.py.j2' %} 2 | 3 | {% block content %} 4 | 5 | from collections import OrderedDict 6 | from typing import Dict, Type 7 | 8 | from .base import {{ service.name }}Transport 9 | {% if 'grpc' in opts.transport %} 10 | from .grpc import {{ service.name }}GrpcTransport 11 | {% endif %} 12 | {% if 'rest' in opts.transport %} 13 | from .rest import {{ service.name }}RestTransport 14 | from .rest import {{ service.name }}RestInterceptor 15 | {% endif %} 16 | 17 | # Compile a registry of transports. 18 | _transport_registry = OrderedDict() # type: Dict[str, Type[{{ service.name }}Transport]] 19 | {% if 'grpc' in opts.transport %} 20 | _transport_registry['grpc'] = {{ service.name }}GrpcTransport 21 | {% endif %} 22 | {% if 'rest' in opts.transport %} 23 | _transport_registry['rest'] = {{ service.name }}RestTransport 24 | {% endif %} 25 | 26 | __all__ = ( 27 | '{{ service.name }}Transport', 28 | {% if 'grpc' in opts.transport %} 29 | '{{ service.name }}GrpcTransport', 30 | {% endif %} 31 | {% if 'rest' in opts.transport %} 32 | '{{ service.name }}RestTransport', 33 | '{{ service.name }}RestInterceptor', 34 | {% endif %} 35 | ) 36 | {% endblock %} 37 | -------------------------------------------------------------------------------- /gapic/ads-templates/%namespace/%name/%version/%sub/services/__init__.py.j2: -------------------------------------------------------------------------------- 1 | {% extends '_base.py.j2' %} 2 | -------------------------------------------------------------------------------- /gapic/ads-templates/%namespace/%name/%version/%sub/types/__init__.py.j2: -------------------------------------------------------------------------------- 1 | {% extends '_base.py.j2' %} 2 | -------------------------------------------------------------------------------- /gapic/ads-templates/%namespace/%name/%version/%sub/types/_enum.py.j2: -------------------------------------------------------------------------------- 1 | class {{ enum.name }}({{ p }}.Enum): 2 | r"""{{ enum.meta.doc|rst(indent=4) }}""" 3 | {% if enum.enum_pb.HasField("options") %} 4 | _pb_options = {{ enum.options_dict }} 5 | {% endif %} 6 | {% for enum_value in enum.values %} 7 | {{ enum_value.name }} = {{ enum_value.number }} 8 | {% endfor %} 9 | {{ '\n\n' }} 10 | -------------------------------------------------------------------------------- /gapic/ads-templates/%namespace/%name/%version/gapic_metadata.json.j2: -------------------------------------------------------------------------------- 1 | {# {{ api.gapic_metadata_json(opts) }} #} {# TODO(dovs): This is temporarily commented out pending the addition of a flag #} 2 | -------------------------------------------------------------------------------- /gapic/ads-templates/%namespace/%name/py.typed.j2: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. 2 | # The {{ api.naming.warehouse_package_name }} package uses inline types. 3 | -------------------------------------------------------------------------------- /gapic/ads-templates/.coveragerc.j2: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | 4 | [report] 5 | fail_under = 100 6 | show_missing = True 7 | omit = 8 | {{ api.naming.module_namespace|join("/") }}/{{ api.naming.module_name }}/__init__.py 9 | exclude_lines = 10 | # Re-enable the standard pragma 11 | pragma: NO COVER 12 | # Ignore debug-only repr 13 | def __repr__ 14 | # This is used to indicate a python version mismatch, 15 | # which is not easily tested in unit tests. 16 | raise ImportError 17 | -------------------------------------------------------------------------------- /gapic/ads-templates/MANIFEST.in.j2: -------------------------------------------------------------------------------- 1 | recursive-include {{ '/'.join(api.naming.module_namespace + (api.naming.module_name,)) }} *.py 2 | recursive-include {{ '/'.join(api.naming.module_namespace + (api.naming.versioned_module_name,)) }} *.py 3 | -------------------------------------------------------------------------------- /gapic/ads-templates/_base.py.j2: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | {% block license %} 3 | {% include "_license.j2" %} 4 | {% endblock %} 5 | {% block content %} 6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /gapic/ads-templates/_license.j2: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | -------------------------------------------------------------------------------- /gapic/ads-templates/docs/%name_%version/services.rst.j2: -------------------------------------------------------------------------------- 1 | Services for {{ api.naming.long_name }} {{ api.naming.version }} API 2 | {{ '=' * (18 + api.naming.long_name|length + api.naming.version|length) }} 3 | 4 | {% for service in api.services.values()|sort(attribute='name') %} 5 | .. automodule:: {{ (api.naming.module_namespace + (api.naming.versioned_module_name,) + service.meta.address.subpackage)|join(".") }}.services.{{ service.name|snake_case }} 6 | :members: 7 | :inherited-members: 8 | {% endfor %} 9 | -------------------------------------------------------------------------------- /gapic/ads-templates/docs/%name_%version/types.rst.j2: -------------------------------------------------------------------------------- 1 | Types for {{ api.naming.long_name }} {{ api.naming.version }} API 2 | {{ '=' * (15 + api.naming.long_name|length + api.naming.version|length) }} 3 | 4 | .. automodule:: {{ api.naming.namespace|join('.')|lower }}.{{ api.naming.versioned_module_name }}.types 5 | :members: 6 | :undoc-members: 7 | -------------------------------------------------------------------------------- /gapic/ads-templates/docs/_static/custom.css.j2: -------------------------------------------------------------------------------- 1 | dl.field-list > dt { 2 | min-width: 100px 3 | } -------------------------------------------------------------------------------- /gapic/ads-templates/docs/index.rst.j2: -------------------------------------------------------------------------------- 1 | API Reference 2 | ------------- 3 | .. toctree:: 4 | :maxdepth: 2 5 | 6 | {{ api.naming.versioned_module_name }}/services 7 | {{ api.naming.versioned_module_name }}/types 8 | -------------------------------------------------------------------------------- /gapic/ads-templates/mypy.ini.j2: -------------------------------------------------------------------------------- 1 | [mypy] 2 | python_version = 3.7 3 | namespace_packages = True 4 | -------------------------------------------------------------------------------- /gapic/ads-templates/tests/__init__.py.j2: -------------------------------------------------------------------------------- 1 | 2 | {% extends '_base.py.j2' %} -------------------------------------------------------------------------------- /gapic/ads-templates/tests/unit/__init__.py.j2: -------------------------------------------------------------------------------- 1 | 2 | {% extends '_base.py.j2' %} -------------------------------------------------------------------------------- /gapic/ads-templates/tests/unit/gapic/%name_%version/%sub/__init__.py.j2: -------------------------------------------------------------------------------- 1 | 2 | {% extends '_base.py.j2' %} -------------------------------------------------------------------------------- /gapic/ads-templates/tests/unit/gapic/__init__.py.j2: -------------------------------------------------------------------------------- 1 | 2 | {% extends '_base.py.j2' %} -------------------------------------------------------------------------------- /gapic/cli/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /gapic/cli/generate_with_pandoc.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | if __name__ == "__main__": 5 | os.environ["PYPANDOC_PANDOC"] = os.path.join( 6 | os.path.abspath(__file__).rsplit("gapic", 1)[0], "pandoc" 7 | ) 8 | os.environ["LC_ALL"] = "C.UTF-8" 9 | os.environ["PYTHONNOUSERSITE"] = "True" 10 | 11 | entry_point_script = os.path.join( 12 | os.path.dirname(os.path.abspath(__file__)), "generate.py" 13 | ) 14 | args = [sys.executable, entry_point_script] + sys.argv[1:] 15 | 16 | os.execv(args[0], args) 17 | -------------------------------------------------------------------------------- /gapic/configurable_snippetgen/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /gapic/generator/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """The ``generator`` module contains the code generation logic. 16 | 17 | The core of this work is around the :class:`~.generator.Generator` class, 18 | which divides up the processing of individual templates. 19 | """ 20 | 21 | from .generator import Generator 22 | 23 | 24 | __all__ = ("Generator",) 25 | -------------------------------------------------------------------------------- /gapic/samplegen/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2019 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from gapic.samplegen import samplegen 16 | from gapic.samplegen import manifest 17 | 18 | __all__ = ( 19 | "manifest", 20 | "samplegen", 21 | ) 22 | -------------------------------------------------------------------------------- /gapic/samplegen_utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2019 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import gapic.samplegen_utils.types 16 | import gapic.samplegen_utils.utils 17 | import gapic.samplegen_utils.yaml 18 | 19 | __all__ = ( 20 | "types", 21 | "utils", 22 | "yaml", 23 | ) 24 | -------------------------------------------------------------------------------- /gapic/schema/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | """The ``schema`` module provides a normalized API representation. 16 | 17 | In general, this module can be considered in three parts: wrappers, 18 | metadata, and a roll-up view of an API as a whole. 19 | 20 | These three parts are divided into the three component modules. 21 | """ 22 | 23 | from gapic.schema.api import API 24 | from gapic.schema import metadata 25 | from gapic.schema import wrappers 26 | 27 | 28 | __all__ = ( 29 | "API", 30 | "metadata", 31 | "wrappers", 32 | ) 33 | -------------------------------------------------------------------------------- /gapic/templates/%namespace/%name/gapic_version.py.j2: -------------------------------------------------------------------------------- 1 | {% extends '_base.py.j2' %} 2 | {% block content %} 3 | 4 | __version__ = "0.0.0" # {x-release-please-version} 5 | {% endblock %} 6 | -------------------------------------------------------------------------------- /gapic/templates/%namespace/%name/py.typed.j2: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. 2 | # The {{ api.naming.warehouse_package_name }} package uses inline types. 3 | -------------------------------------------------------------------------------- /gapic/templates/%namespace/%name_%version/%sub/services/%service/__init__.py.j2: -------------------------------------------------------------------------------- 1 | {% extends '_base.py.j2' %} 2 | 3 | {% block content %} 4 | 5 | from .client import {{ service.client_name }} 6 | {% if 'grpc' in opts.transport %} 7 | from .async_client import {{ service.async_client_name }} 8 | {% endif %} 9 | 10 | __all__ = ( 11 | '{{ service.client_name }}', 12 | {% if 'grpc' in opts.transport %} 13 | '{{ service.async_client_name }}', 14 | {% endif %} 15 | ) 16 | {% endblock %} 17 | -------------------------------------------------------------------------------- /gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/README.rst.j2: -------------------------------------------------------------------------------- 1 | 2 | transport inheritance structure 3 | _______________________________ 4 | 5 | `{{ service.name }}Transport` is the ABC for all transports. 6 | - public child `{{ service.name }}GrpcTransport` for sync gRPC transport (defined in `grpc.py`). 7 | - public child `{{ service.name }}GrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`). 8 | - private child `_Base{{ service.name }}RestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`). 9 | - public child `{{ service.name }}RestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`). 10 | {# Since the service mixins have a similar structure, we factor out shared code into `_shared_macros.j2` to avoid duplication. #} 11 | -------------------------------------------------------------------------------- /gapic/templates/%namespace/%name_%version/%sub/services/%service/transports/_rest_mixins.py.j2: -------------------------------------------------------------------------------- 1 | {# 2 | # Copyright (C) 2024 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | #} 16 | 17 | {% import "%namespace/%name_%version/%sub/services/%service/_shared_macros.j2" as shared_macros %} 18 | 19 | {% if "rest" in opts.transport %} 20 | {% for name, sig in api.mixin_api_signatures.items() %} 21 | {{ shared_macros.generate_mixin_call_method(service, api, name, sig, is_async=False) | indent(4) }} 22 | {% endfor %} 23 | {% endif %} {# rest in opts.transport #} 24 | -------------------------------------------------------------------------------- /gapic/templates/%namespace/%name_%version/%sub/services/__init__.py.j2: -------------------------------------------------------------------------------- 1 | {% extends '_base.py.j2' %} 2 | -------------------------------------------------------------------------------- /gapic/templates/%namespace/%name_%version/%sub/types/__init__.py.j2: -------------------------------------------------------------------------------- 1 | {% extends '_base.py.j2' %} 2 | 3 | {% block content %} 4 | 5 | {% for _, proto in api.protos|dictsort if proto.file_to_generate and proto.messages or proto.enums %} 6 | from .{{proto.module_name }} import ( 7 | {% for _, message in proto.messages|dictsort %} 8 | {{message.name }}, 9 | {% endfor %} 10 | {% for _, enum in proto.enums|dictsort %} 11 | {{ enum.name }}, 12 | {% endfor %} 13 | ) 14 | {% endfor %} 15 | 16 | __all__ = ( 17 | {% for _, proto in api.protos|dictsort if proto.file_to_generate %} 18 | {% for _, message in proto.messages|dictsort %} 19 | '{{ message.name }}', 20 | {% endfor %} 21 | {% for _, enum in proto.enums|dictsort %} 22 | '{{ enum.name }}', 23 | {% endfor %} 24 | {% endfor %} 25 | ) 26 | {% endblock %} 27 | -------------------------------------------------------------------------------- /gapic/templates/%namespace/%name_%version/%sub/types/_enum.py.j2: -------------------------------------------------------------------------------- 1 | class {{ enum.name }}({{ p }}.Enum): 2 | r"""{{ enum.meta.doc|rst(indent=4) }} 3 | 4 | Values: 5 | {% for enum_value in enum.values %} 6 | {{ enum_value.name }} ({{ enum_value.number }}): 7 | {% if enum_value.meta.doc|length > 0 %} 8 | {{ enum_value.meta.doc|rst(width=72, indent=12, nl=False) }} 9 | {% else %} 10 | No description available. 11 | {% endif %} 12 | {%- endfor %} 13 | """ 14 | {% if enum.enum_pb.HasField("options") %} 15 | _pb_options = {{ enum.options_dict }} 16 | {% endif %} 17 | {% for enum_value in enum.values %} 18 | {{ enum_value.name }} = {{ enum_value.number }} 19 | {% endfor %} 20 | {{ '\n\n' }} 21 | -------------------------------------------------------------------------------- /gapic/templates/%namespace/%name_%version/gapic_metadata.json.j2: -------------------------------------------------------------------------------- 1 | {{ api.gapic_metadata_json(opts) }} 2 | -------------------------------------------------------------------------------- /gapic/templates/%namespace/%name_%version/gapic_version.py.j2: -------------------------------------------------------------------------------- 1 | {% extends '_base.py.j2' %} 2 | {% block content %} 3 | 4 | __version__ = "0.0.0" # {x-release-please-version} 5 | {% endblock %} 6 | -------------------------------------------------------------------------------- /gapic/templates/%namespace/%name_%version/py.typed.j2: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. 2 | # The {{ api.naming.warehouse_package_name }} package uses inline types. 3 | -------------------------------------------------------------------------------- /gapic/templates/.coveragerc.j2: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | 4 | [report] 5 | show_missing = True 6 | omit = 7 | {{ api.naming.module_namespace|join("/") }}/{{ api.naming.module_name }}/__init__.py 8 | {{ api.naming.module_namespace|join("/") }}/{{ api.naming.module_name }}/gapic_version.py 9 | exclude_lines = 10 | # Re-enable the standard pragma 11 | pragma: NO COVER 12 | # Ignore debug-only repr 13 | def __repr__ 14 | -------------------------------------------------------------------------------- /gapic/templates/.flake8.j2: -------------------------------------------------------------------------------- 1 | {% extends "_base.py.j2" %} 2 | 3 | {% block content %} 4 | 5 | [flake8] 6 | # TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): 7 | # Resolve flake8 lint issues 8 | ignore = E203, E231, E266, E501, W503 9 | exclude = 10 | # TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): 11 | # Ensure that generated code passes flake8 lint 12 | **/gapic/** 13 | **/services/** 14 | **/types/** 15 | # Exclude Protobuf gencode 16 | *_pb2.py 17 | 18 | # Standard linting exemptions. 19 | **/.nox/** 20 | __pycache__, 21 | .git, 22 | *.pyc, 23 | conf.py 24 | 25 | {% endblock %} 26 | -------------------------------------------------------------------------------- /gapic/templates/MANIFEST.in.j2: -------------------------------------------------------------------------------- 1 | {% extends "_base.py.j2" %} 2 | 3 | {% block content %} 4 | 5 | include README.rst LICENSE 6 | {% if api.naming.module_namespace %} 7 | recursive-include {{ api.naming.module_namespace[0] }} *.py *.pyi *.json *.proto py.typed 8 | {% else %} 9 | recursive-include {{ api.naming.versioned_module_name }} *.py *.pyi *.json *.proto py.typed 10 | {% endif %} 11 | recursive-include tests * 12 | global-exclude *.py[co] 13 | global-exclude __pycache__ 14 | 15 | {% endblock %} 16 | -------------------------------------------------------------------------------- /gapic/templates/_base.py.j2: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | {% block license %} 3 | {% include "_license.j2" %} 4 | {% endblock %} 5 | {% block content %} 6 | {% endblock %} 7 | -------------------------------------------------------------------------------- /gapic/templates/_license.j2: -------------------------------------------------------------------------------- 1 | # Copyright 2025 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # 15 | -------------------------------------------------------------------------------- /gapic/templates/docs/%name_%version/%service.rst.j2: -------------------------------------------------------------------------------- 1 | {{ service.name }} 2 | {{ '-' * (18 + service.name|length) }} 3 | 4 | .. automodule:: {{ (api.naming.module_namespace + (api.naming.versioned_module_name,) + service.meta.address.subpackage)|join(".") }}.services.{{ service.name|snake_case }} 5 | :members: 6 | :inherited-members: 7 | 8 | {% if service.has_pagers %} 9 | .. automodule:: {{ (api.naming.module_namespace + (api.naming.versioned_module_name,) + service.meta.address.subpackage)|join(".") }}.services.{{ service.name|snake_case }}.pagers 10 | :members: 11 | :inherited-members: 12 | {% endif %} -------------------------------------------------------------------------------- /gapic/templates/docs/%name_%version/services_.rst.j2: -------------------------------------------------------------------------------- 1 | Services for {{ api.naming.long_name }} {{ api.naming.version }} API 2 | {{ '=' * (18 + api.naming.long_name|length + api.naming.version|length) }} 3 | .. toctree:: 4 | :maxdepth: 2 5 | 6 | {% for service in api.services.values()|sort(attribute='name') %} 7 | {{ service.name|snake_case }} 8 | {% endfor %} 9 | -------------------------------------------------------------------------------- /gapic/templates/docs/%name_%version/types_.rst.j2: -------------------------------------------------------------------------------- 1 | Types for {{ api.naming.long_name }} {{ api.naming.version }} API 2 | {{ '=' * (15 + api.naming.long_name|length + api.naming.version|length) }} 3 | 4 | .. automodule:: {{ api.naming.namespace|join('.')|lower }}.{{ api.naming.versioned_module_name }}.types 5 | :members: 6 | :show-inheritance: 7 | -------------------------------------------------------------------------------- /gapic/templates/docs/_static/custom.css.j2: -------------------------------------------------------------------------------- 1 | div#python2-eol { 2 | border-color: red; 3 | border-width: medium; 4 | } 5 | 6 | /* Ensure minimum width for 'Parameters' / 'Returns' column */ 7 | dl.field-list > dt { 8 | min-width: 100px 9 | } 10 | 11 | /* Insert space between methods for readability */ 12 | dl.method { 13 | padding-top: 10px; 14 | padding-bottom: 10px 15 | } 16 | 17 | /* Insert empty space between classes */ 18 | dl.class { 19 | padding-bottom: 50px 20 | } 21 | -------------------------------------------------------------------------------- /gapic/templates/docs/index.rst.j2: -------------------------------------------------------------------------------- 1 | .. include:: multiprocessing.rst 2 | 3 | 4 | API Reference 5 | ------------- 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | {{ api.naming.versioned_module_name }}/services_ 10 | {{ api.naming.versioned_module_name }}/types_ 11 | -------------------------------------------------------------------------------- /gapic/templates/docs/multiprocessing.rst.j2: -------------------------------------------------------------------------------- 1 | .. note:: 2 | 3 | Because this client uses :mod:`grpc` library, it is safe to 4 | share instances across threads. In multiprocessing scenarios, the best 5 | practice is to create client instances *after* the invocation of 6 | :func:`os.fork` by :class:`multiprocessing.pool.Pool` or 7 | :class:`multiprocessing.Process`. 8 | -------------------------------------------------------------------------------- /gapic/templates/examples/_generated_sample_comment.j2: -------------------------------------------------------------------------------- 1 | # This snippet has been automatically generated and should be regarded as a 2 | # code template only. 3 | # It will require modifications to work: 4 | # - It may require correct/in-range values for request initialization. 5 | # - It may require specifying regional endpoints when creating the service 6 | # client as shown in: 7 | # https://googleapis.dev/python/google-api-core/latest/client_options.html 8 | -------------------------------------------------------------------------------- /gapic/templates/mypy.ini.j2: -------------------------------------------------------------------------------- 1 | [mypy] 2 | python_version = 3.7 3 | namespace_packages = True 4 | -------------------------------------------------------------------------------- /gapic/templates/testing/_default_constraints.j2: -------------------------------------------------------------------------------- 1 | {% from '_pypi_packages.j2' import pypi_packages %} 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | {% for package_tuple, package_info in pypi_packages.items() %} 8 | {# Quick check to make sure `package_info.package_name` is not the package being generated so we don't circularly include this package in its own constraints file. #} 9 | {% if api.naming.warehouse_package_name != package_info.package_name %} 10 | {% if api.requires_package(package_tuple) %} 11 | {{ package_info.package_name }} 12 | {% endif %} 13 | {% endif %} 14 | {% endfor %} 15 | -------------------------------------------------------------------------------- /gapic/templates/testing/constraints-3.10.txt.j2: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | {% block constraints %} 3 | {% include "testing/_default_constraints.j2" %} 4 | {% endblock %} -------------------------------------------------------------------------------- /gapic/templates/testing/constraints-3.11.txt.j2: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | {% block constraints %} 3 | {% include "testing/_default_constraints.j2" %} 4 | {% endblock %} -------------------------------------------------------------------------------- /gapic/templates/testing/constraints-3.12.txt.j2: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | {% block constraints %} 3 | {% include "testing/_default_constraints.j2" %} 4 | {% endblock %} 5 | -------------------------------------------------------------------------------- /gapic/templates/testing/constraints-3.13.txt.j2: -------------------------------------------------------------------------------- 1 | {% from '_pypi_packages.j2' import pypi_packages %} 2 | # We use the constraints file for the latest Python version 3 | # (currently this file) to check that the latest 4 | # major versions of dependencies are supported in setup.py. 5 | # List all library dependencies and extras in this file. 6 | # Require the latest major version be installed for each dependency. 7 | # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", 8 | # Then this file should have google-cloud-foo>=1 9 | google-api-core>=2 10 | google-auth>=2 11 | proto-plus>=1 12 | protobuf>=6 13 | {% for package_tuple, package_info in pypi_packages.items() %} 14 | {# Quick check to make sure `package_info.package_name` is not the package being generated so we don't circularly include this package in its own constraints file. #} 15 | {% if api.naming.warehouse_package_name != package_info.package_name %} 16 | {% if api.requires_package(package_tuple) %} 17 | {{ package_info.package_name }}>={{ (package_info.upper_bound.split(".")[0] | int) - 1 }} 18 | {% endif %} 19 | {% endif %} 20 | {% endfor %} 21 | -------------------------------------------------------------------------------- /gapic/templates/testing/constraints-3.7.txt.j2: -------------------------------------------------------------------------------- 1 | {% from '_pypi_packages.j2' import pypi_packages %} 2 | # This constraints file is used to check that lower bounds 3 | # are correct in setup.py 4 | # List all library dependencies and extras in this file. 5 | # Pin the version to the lower bound. 6 | # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", 7 | # Then this file should have google-cloud-foo==1.14.0 8 | google-api-core==1.34.1 9 | google-auth==2.14.1 10 | proto-plus==1.22.3 11 | protobuf==3.20.2 12 | {% for package_tuple, package_info in pypi_packages.items() %} 13 | {# Quick check to make sure `package_info.package_name` is not the package being generated so we don't circularly include this package in its own constraints file. #} 14 | {% if api.naming.warehouse_package_name != package_info.package_name %} 15 | {% if api.requires_package(package_tuple) %} 16 | {{ package_info.package_name }}=={{ package_info.lower_bound }} 17 | {% endif %} 18 | {% endif %} 19 | {% endfor %} 20 | -------------------------------------------------------------------------------- /gapic/templates/testing/constraints-3.8.txt.j2: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | {% block constraints %} 3 | {% include "testing/_default_constraints.j2" %} 4 | {% endblock %} -------------------------------------------------------------------------------- /gapic/templates/testing/constraints-3.9.txt.j2: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | {% block constraints %} 3 | {% include "testing/_default_constraints.j2" %} 4 | {% endblock %} -------------------------------------------------------------------------------- /gapic/templates/tests/__init__.py.j2: -------------------------------------------------------------------------------- 1 | 2 | {% extends '_base.py.j2' %} -------------------------------------------------------------------------------- /gapic/templates/tests/unit/__init__.py.j2: -------------------------------------------------------------------------------- 1 | 2 | {% extends '_base.py.j2' %} -------------------------------------------------------------------------------- /gapic/templates/tests/unit/gapic/%name_%version/%sub/__init__.py.j2: -------------------------------------------------------------------------------- 1 | 2 | {% extends '_base.py.j2' %} -------------------------------------------------------------------------------- /gapic/templates/tests/unit/gapic/__init__.py.j2: -------------------------------------------------------------------------------- 1 | 2 | {% extends '_base.py.j2' %} -------------------------------------------------------------------------------- /gapic/utils/checks.py: -------------------------------------------------------------------------------- 1 | # Copyright 2020 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from google.protobuf.descriptor_pb2 import FieldDescriptorProto 16 | 17 | 18 | def is_str_field_pb(field_pb: FieldDescriptorProto) -> bool: 19 | """Determine if field_pb is of type string. 20 | 21 | Args: 22 | field (Field): The input field as a FieldDescriptorProto 23 | """ 24 | return field_pb.type == FieldDescriptorProto.TYPE_STRING 25 | 26 | 27 | def is_msg_field_pb(field_pb: FieldDescriptorProto) -> bool: 28 | """Determine if field_pb is of type Message. 29 | 30 | Args: 31 | field (Field): The input field as a FieldDescriptorProto. 32 | """ 33 | return field_pb.type == FieldDescriptorProto.TYPE_MESSAGE 34 | -------------------------------------------------------------------------------- /gapic/utils/doc.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from google.protobuf import descriptor_pb2 16 | 17 | 18 | def doc(text: str) -> descriptor_pb2.SourceCodeInfo.Location: 19 | """Return a Location object with the given documentation. 20 | 21 | This convenience method instantates a protobuf location object, 22 | which is expected by the Metadata class, and allows for classes 23 | not based on protobuf locations to easily conform to the interface. 24 | """ 25 | return descriptor_pb2.SourceCodeInfo.Location(leading_comments=text) 26 | -------------------------------------------------------------------------------- /mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | python_version = 3.8 3 | -------------------------------------------------------------------------------- /owlbot.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import synthtool as s 16 | from synthtool.gcp import CommonTemplates 17 | 18 | templated_files = CommonTemplates().py_library() 19 | s.move( 20 | templated_files / ".kokoro", 21 | excludes=["samples/**/*", "test-samples*", "*/prerelease-deps.cfg"], 22 | ) 23 | 24 | # needed for docs build 25 | s.move(templated_files / ".trampolinerc") 26 | 27 | s.move(templated_files / "LICENSE") 28 | s.move(templated_files / ".github", excludes=["workflows", "CODEOWNERS", "auto-approve.yml"]) 29 | 30 | s.shell.run(["nox", "-s", "blacken"], hide_output=False) 31 | -------------------------------------------------------------------------------- /pyenv3wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | HOME_DIR=$(getent passwd "$(whoami)" | cut -d: -f6) 4 | exec "$HOME_DIR/.pyenv/shims/python3" "$@" 5 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base", 4 | "group:all", 5 | ":disableDependencyDashboard", 6 | "schedule:weekly" 7 | ], 8 | "ignorePaths": [ 9 | ".kokoro/requirements.txt" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /requirements.in: -------------------------------------------------------------------------------- 1 | click 2 | google-api-core 3 | googleapis-common-protos 4 | jinja2 5 | MarkupSafe 6 | protobuf 7 | pypandoc 8 | PyYAML 9 | grpc-google-iam-v1 10 | proto-plus 11 | pytest-asyncio 12 | libcst 13 | inflection 14 | aiohttp 15 | -------------------------------------------------------------------------------- /rules_python_gapic/BUILD.bazel: -------------------------------------------------------------------------------- 1 | exports_files([ 2 | "test.py", 3 | "pytest.py", 4 | ]) 5 | -------------------------------------------------------------------------------- /rules_python_gapic/pytest.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import pytest 3 | import os 4 | 5 | 6 | if __name__ == "__main__": 7 | # The generated file name will be of the form `_pytest.py`. 8 | # The generated gapic will be in a directory `_srcjar.py``. 9 | # Extract the ``` from this file, and use it to determine the 10 | # directory of the generated gapic. 11 | # Only run `pytest` on the `tests` directory. 12 | module_name = os.path.abspath(__file__).replace("_pytest.py", "") 13 | src_directory = f"{module_name}_srcjar.py" 14 | sys.exit( 15 | pytest.main(["--disable-pytest-warnings", "--quiet", f"{src_directory}/tests"]) 16 | ) 17 | -------------------------------------------------------------------------------- /rules_python_gapic/test.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | 5 | if __name__ == '__main__': 6 | os.environ['PYTHONNOUSERSITE'] = 'True' 7 | entry_point_script = os.path.join( 8 | os.path.dirname(os.path.abspath(__file__)), 9 | os.path.basename(__file__).replace("_test.py", "_pytest.py")) 10 | args = [sys.executable, entry_point_script] + sys.argv[1:] 11 | os.execv(args[0], args) 12 | -------------------------------------------------------------------------------- /rules_python_gapic/test/BUILD.bazel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/gapic-generator-python/890731963ce033745b6804fa27b86b32ccc2564c/rules_python_gapic/test/BUILD.bazel -------------------------------------------------------------------------------- /test_utils/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2023 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | -------------------------------------------------------------------------------- /tests/fragments/google/README.rst: -------------------------------------------------------------------------------- 1 | The protos in this folder were copied directly from `googleapis/googleapis`_ and are needed for the purposes of running fragment tests. 2 | 3 | .. _googleapis/googleapis: https://github.com/googleapis/googleapis/tree/master/google -------------------------------------------------------------------------------- /tests/fragments/google/api/annotations.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package google.api; 18 | 19 | import "google/api/http.proto"; 20 | import "google/protobuf/descriptor.proto"; 21 | 22 | option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; 23 | option java_multiple_files = true; 24 | option java_outer_classname = "AnnotationsProto"; 25 | option java_package = "com.google.api"; 26 | option objc_class_prefix = "GAPI"; 27 | 28 | extend google.protobuf.MethodOptions { 29 | // See `HttpRule`. 30 | HttpRule http = 72295728; 31 | } 32 | -------------------------------------------------------------------------------- /tests/fragments/import.proto: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package google.fragment; 18 | 19 | message Import { 20 | string path = 1; 21 | } 22 | -------------------------------------------------------------------------------- /tests/fragments/test_api_version.proto: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2024 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package google.fragment; 18 | 19 | import "google/protobuf/struct.proto"; 20 | import "google/api/client.proto"; 21 | 22 | service MyServiceWithVersion { 23 | option (google.api.api_version) = "v1_20230601"; 24 | option (google.api.default_host) = "my.example.com"; 25 | 26 | rpc MyMethod(MethodRequest) returns (MethodResponse) { 27 | option (google.api.method_signature) = "parameter"; 28 | } 29 | } 30 | 31 | message MethodRequest { 32 | google.protobuf.Value parameter = 1; 33 | } 34 | 35 | message MethodResponse { 36 | google.protobuf.Value result = 1; 37 | } 38 | -------------------------------------------------------------------------------- /tests/fragments/test_flattened_value.proto: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package google.fragment; 18 | 19 | import "google/protobuf/struct.proto"; 20 | import "google/api/client.proto"; 21 | 22 | service MyService { 23 | option (google.api.default_host) = "my.example.com"; 24 | 25 | rpc MyMethod(MethodRequest) returns (MethodResponse) { 26 | option (google.api.method_signature) = "parameter,items"; 27 | } 28 | } 29 | 30 | message MethodRequest { 31 | google.protobuf.Value parameter = 1; 32 | repeated google.protobuf.Value items = 2; 33 | } 34 | 35 | message MethodResponse { 36 | string result = 1; 37 | } 38 | -------------------------------------------------------------------------------- /tests/fragments/test_keyword_import.proto: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package google.fragment; 18 | 19 | import "google/api/client.proto"; 20 | import "import.proto"; 21 | 22 | service MyService { 23 | option (google.api.default_host) = "my.example.com"; 24 | rpc MyMethod(MethodRequest) returns (MethodResponse) {} 25 | } 26 | 27 | message MethodRequest { 28 | Import import = 1; 29 | } 30 | 31 | message MethodResponse { 32 | string result = 1; 33 | } 34 | -------------------------------------------------------------------------------- /tests/fragments/test_oneof_imported_response.proto: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package google.fragment; 18 | 19 | import "google/api/client.proto"; 20 | import "import.proto"; 21 | 22 | service MyService { 23 | option (google.api.default_host) = "my.example.com"; 24 | rpc MyMethod(MethodRequest) returns (MethodResponse) {} 25 | } 26 | 27 | message MethodRequest { 28 | string input = 1; 29 | } 30 | 31 | message Container { 32 | Import import = 1; 33 | } 34 | 35 | message MethodResponse { 36 | string parent = 1; 37 | oneof format { 38 | Container container = 2; 39 | string name = 3; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/fragments/test_optional_signature.proto: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package google.fragment; 18 | 19 | import "google/api/client.proto"; 20 | 21 | service MyService { 22 | option (google.api.default_host) = "my.example.com"; 23 | rpc MyMethod(MethodRequest) returns (MethodResponse) { 24 | option (google.api.method_signature) = "parameter"; 25 | } 26 | 27 | } 28 | 29 | message MethodRequest { 30 | optional string parameter = 1; 31 | } 32 | 33 | message MethodResponse { 34 | string result = 1; 35 | } 36 | -------------------------------------------------------------------------------- /tests/fragments/test_recursive_messages.proto: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Google LLC 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package google.fragment; 18 | 19 | import "google/api/client.proto"; 20 | 21 | service MyService { 22 | option (google.api.default_host) = "my.example.com"; 23 | 24 | rpc MyMethod(MethodRequest) returns (MethodResponse) {} 25 | } 26 | 27 | message MethodRequest { 28 | int32 depth = 1; 29 | MethodRequest child = 2; 30 | } 31 | 32 | message MethodResponse { 33 | string result = 1; 34 | } 35 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | 4 | [report] 5 | show_missing = True 6 | omit = 7 | google/cloud/asset/__init__.py 8 | google/cloud/asset/gapic_version.py 9 | exclude_lines = 10 | # Re-enable the standard pragma 11 | pragma: NO COVER 12 | # Ignore debug-only repr 13 | def __repr__ 14 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/.flake8: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | [flake8] 17 | # TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): 18 | # Resolve flake8 lint issues 19 | ignore = E203, E231, E266, E501, W503 20 | exclude = 21 | # TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): 22 | # Ensure that generated code passes flake8 lint 23 | **/gapic/** 24 | **/services/** 25 | **/types/** 26 | # Exclude Protobuf gencode 27 | *_pb2.py 28 | 29 | # Standard linting exemptions. 30 | **/.nox/** 31 | __pycache__, 32 | .git, 33 | *.pyc, 34 | conf.py 35 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/BUILD.bazel: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "goldens_files", 5 | srcs = glob( 6 | ["**/*"], 7 | exclude = [ 8 | "BUILD.bazel", 9 | ".*.sw*", 10 | ], 11 | ), 12 | ) 13 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/MANIFEST.in: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | include README.rst LICENSE 17 | recursive-include google *.py *.pyi *.json *.proto py.typed 18 | recursive-include tests * 19 | global-exclude *.py[co] 20 | global-exclude __pycache__ 21 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/docs/_static/custom.css: -------------------------------------------------------------------------------- 1 | div#python2-eol { 2 | border-color: red; 3 | border-width: medium; 4 | } 5 | 6 | /* Ensure minimum width for 'Parameters' / 'Returns' column */ 7 | dl.field-list > dt { 8 | min-width: 100px 9 | } 10 | 11 | /* Insert space between methods for readability */ 12 | dl.method { 13 | padding-top: 10px; 14 | padding-bottom: 10px 15 | } 16 | 17 | /* Insert empty space between classes */ 18 | dl.class { 19 | padding-bottom: 50px 20 | } 21 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/docs/asset_v1/asset_service.rst: -------------------------------------------------------------------------------- 1 | AssetService 2 | ------------------------------ 3 | 4 | .. automodule:: google.cloud.asset_v1.services.asset_service 5 | :members: 6 | :inherited-members: 7 | 8 | .. automodule:: google.cloud.asset_v1.services.asset_service.pagers 9 | :members: 10 | :inherited-members: 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/docs/asset_v1/services_.rst: -------------------------------------------------------------------------------- 1 | Services for Google Cloud Asset v1 API 2 | ====================================== 3 | .. toctree:: 4 | :maxdepth: 2 5 | 6 | asset_service 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/docs/asset_v1/types_.rst: -------------------------------------------------------------------------------- 1 | Types for Google Cloud Asset v1 API 2 | =================================== 3 | 4 | .. automodule:: google.cloud.asset_v1.types 5 | :members: 6 | :show-inheritance: 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/docs/index.rst: -------------------------------------------------------------------------------- 1 | .. include:: multiprocessing.rst 2 | 3 | 4 | API Reference 5 | ------------- 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | asset_v1/services_ 10 | asset_v1/types_ 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/docs/multiprocessing.rst: -------------------------------------------------------------------------------- 1 | .. note:: 2 | 3 | Because this client uses :mod:`grpc` library, it is safe to 4 | share instances across threads. In multiprocessing scenarios, the best 5 | practice is to create client instances *after* the invocation of 6 | :func:`os.fork` by :class:`multiprocessing.pool.Pool` or 7 | :class:`multiprocessing.Process`. 8 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/google/cloud/asset/gapic_version.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | __version__ = "0.0.0" # {x-release-please-version} 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/google/cloud/asset/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. 2 | # The google-cloud-asset package uses inline types. 3 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/google/cloud/asset_v1/gapic_version.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | __version__ = "0.0.0" # {x-release-please-version} 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/google/cloud/asset_v1/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. 2 | # The google-cloud-asset package uses inline types. 3 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/google/cloud/asset_v1/services/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | from .client import AssetServiceClient 17 | from .async_client import AssetServiceAsyncClient 18 | 19 | __all__ = ( 20 | 'AssetServiceClient', 21 | 'AssetServiceAsyncClient', 22 | ) 23 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/transports/README.rst: -------------------------------------------------------------------------------- 1 | 2 | transport inheritance structure 3 | _______________________________ 4 | 5 | `AssetServiceTransport` is the ABC for all transports. 6 | - public child `AssetServiceGrpcTransport` for sync gRPC transport (defined in `grpc.py`). 7 | - public child `AssetServiceGrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`). 8 | - private child `_BaseAssetServiceRestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`). 9 | - public child `AssetServiceRestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`). 10 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | python_version = 3.7 3 | namespace_packages = True 4 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/testing/constraints-3.10.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | google-cloud-access-context-manager 8 | google-cloud-os-config 9 | grpc-google-iam-v1 10 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/testing/constraints-3.11.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | google-cloud-access-context-manager 8 | google-cloud-os-config 9 | grpc-google-iam-v1 10 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/testing/constraints-3.12.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | google-cloud-access-context-manager 8 | google-cloud-os-config 9 | grpc-google-iam-v1 10 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/testing/constraints-3.13.txt: -------------------------------------------------------------------------------- 1 | # We use the constraints file for the latest Python version 2 | # (currently this file) to check that the latest 3 | # major versions of dependencies are supported in setup.py. 4 | # List all library dependencies and extras in this file. 5 | # Require the latest major version be installed for each dependency. 6 | # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", 7 | # Then this file should have google-cloud-foo>=1 8 | google-api-core>=2 9 | google-auth>=2 10 | proto-plus>=1 11 | protobuf>=6 12 | google-cloud-access-context-manager>=0 13 | google-cloud-os-config>=1 14 | grpc-google-iam-v1>=0 15 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/testing/constraints-3.7.txt: -------------------------------------------------------------------------------- 1 | # This constraints file is used to check that lower bounds 2 | # are correct in setup.py 3 | # List all library dependencies and extras in this file. 4 | # Pin the version to the lower bound. 5 | # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", 6 | # Then this file should have google-cloud-foo==1.14.0 7 | google-api-core==1.34.1 8 | google-auth==2.14.1 9 | proto-plus==1.22.3 10 | protobuf==3.20.2 11 | google-cloud-access-context-manager==0.1.2 12 | google-cloud-os-config==1.0.0 13 | grpc-google-iam-v1==0.14.0 14 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/testing/constraints-3.8.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | google-cloud-access-context-manager 8 | google-cloud-os-config 9 | grpc-google-iam-v1 10 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/testing/constraints-3.9.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | google-cloud-access-context-manager 8 | google-cloud-os-config 9 | grpc-google-iam-v1 10 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/tests/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/tests/unit/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/tests/unit/gapic/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/asset/tests/unit/gapic/asset_v1/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | 4 | [report] 5 | show_missing = True 6 | omit = 7 | google/iam/credentials/__init__.py 8 | google/iam/credentials/gapic_version.py 9 | exclude_lines = 10 | # Re-enable the standard pragma 11 | pragma: NO COVER 12 | # Ignore debug-only repr 13 | def __repr__ 14 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/.flake8: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | [flake8] 17 | # TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): 18 | # Resolve flake8 lint issues 19 | ignore = E203, E231, E266, E501, W503 20 | exclude = 21 | # TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): 22 | # Ensure that generated code passes flake8 lint 23 | **/gapic/** 24 | **/services/** 25 | **/types/** 26 | # Exclude Protobuf gencode 27 | *_pb2.py 28 | 29 | # Standard linting exemptions. 30 | **/.nox/** 31 | __pycache__, 32 | .git, 33 | *.pyc, 34 | conf.py 35 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/BUILD.bazel: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "goldens_files", 5 | srcs = glob( 6 | ["**/*"], 7 | exclude = [ 8 | "BUILD.bazel", 9 | ".*.sw*", 10 | ], 11 | ), 12 | ) 13 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/MANIFEST.in: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | include README.rst LICENSE 17 | recursive-include google *.py *.pyi *.json *.proto py.typed 18 | recursive-include tests * 19 | global-exclude *.py[co] 20 | global-exclude __pycache__ 21 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/docs/_static/custom.css: -------------------------------------------------------------------------------- 1 | div#python2-eol { 2 | border-color: red; 3 | border-width: medium; 4 | } 5 | 6 | /* Ensure minimum width for 'Parameters' / 'Returns' column */ 7 | dl.field-list > dt { 8 | min-width: 100px 9 | } 10 | 11 | /* Insert space between methods for readability */ 12 | dl.method { 13 | padding-top: 10px; 14 | padding-bottom: 10px 15 | } 16 | 17 | /* Insert empty space between classes */ 18 | dl.class { 19 | padding-bottom: 50px 20 | } 21 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/docs/credentials_v1/iam_credentials.rst: -------------------------------------------------------------------------------- 1 | IAMCredentials 2 | -------------------------------- 3 | 4 | .. automodule:: google.iam.credentials_v1.services.iam_credentials 5 | :members: 6 | :inherited-members: 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/docs/credentials_v1/services_.rst: -------------------------------------------------------------------------------- 1 | Services for Google Iam Credentials v1 API 2 | ========================================== 3 | .. toctree:: 4 | :maxdepth: 2 5 | 6 | iam_credentials 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/docs/credentials_v1/types_.rst: -------------------------------------------------------------------------------- 1 | Types for Google Iam Credentials v1 API 2 | ======================================= 3 | 4 | .. automodule:: google.iam.credentials_v1.types 5 | :members: 6 | :show-inheritance: 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/docs/index.rst: -------------------------------------------------------------------------------- 1 | .. include:: multiprocessing.rst 2 | 3 | 4 | API Reference 5 | ------------- 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | credentials_v1/services_ 10 | credentials_v1/types_ 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/docs/multiprocessing.rst: -------------------------------------------------------------------------------- 1 | .. note:: 2 | 3 | Because this client uses :mod:`grpc` library, it is safe to 4 | share instances across threads. In multiprocessing scenarios, the best 5 | practice is to create client instances *after* the invocation of 6 | :func:`os.fork` by :class:`multiprocessing.pool.Pool` or 7 | :class:`multiprocessing.Process`. 8 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/google/iam/credentials/gapic_version.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | __version__ = "0.0.0" # {x-release-please-version} 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/google/iam/credentials/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. 2 | # The google-iam-credentials package uses inline types. 3 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/google/iam/credentials_v1/gapic_version.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | __version__ = "0.0.0" # {x-release-please-version} 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/google/iam/credentials_v1/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. 2 | # The google-iam-credentials package uses inline types. 3 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/google/iam/credentials_v1/services/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | from .client import IAMCredentialsClient 17 | from .async_client import IAMCredentialsAsyncClient 18 | 19 | __all__ = ( 20 | 'IAMCredentialsClient', 21 | 'IAMCredentialsAsyncClient', 22 | ) 23 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/transports/README.rst: -------------------------------------------------------------------------------- 1 | 2 | transport inheritance structure 3 | _______________________________ 4 | 5 | `IAMCredentialsTransport` is the ABC for all transports. 6 | - public child `IAMCredentialsGrpcTransport` for sync gRPC transport (defined in `grpc.py`). 7 | - public child `IAMCredentialsGrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`). 8 | - private child `_BaseIAMCredentialsRestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`). 9 | - public child `IAMCredentialsRestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`). 10 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/google/iam/credentials_v1/types/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | from .common import ( 17 | GenerateAccessTokenRequest, 18 | GenerateAccessTokenResponse, 19 | GenerateIdTokenRequest, 20 | GenerateIdTokenResponse, 21 | SignBlobRequest, 22 | SignBlobResponse, 23 | SignJwtRequest, 24 | SignJwtResponse, 25 | ) 26 | 27 | __all__ = ( 28 | 'GenerateAccessTokenRequest', 29 | 'GenerateAccessTokenResponse', 30 | 'GenerateIdTokenRequest', 31 | 'GenerateIdTokenResponse', 32 | 'SignBlobRequest', 33 | 'SignBlobResponse', 34 | 'SignJwtRequest', 35 | 'SignJwtResponse', 36 | ) 37 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/google/iam/credentials_v1/types/iamcredentials.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | import proto # type: ignore 17 | 18 | 19 | __protobuf__ = proto.module( 20 | package='google.iam.credentials.v1', 21 | manifest={ 22 | }, 23 | ) 24 | 25 | 26 | __all__ = tuple(sorted(__protobuf__.manifest)) 27 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | python_version = 3.7 3 | namespace_packages = True 4 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/testing/constraints-3.10.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/testing/constraints-3.11.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/testing/constraints-3.12.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/testing/constraints-3.13.txt: -------------------------------------------------------------------------------- 1 | # We use the constraints file for the latest Python version 2 | # (currently this file) to check that the latest 3 | # major versions of dependencies are supported in setup.py. 4 | # List all library dependencies and extras in this file. 5 | # Require the latest major version be installed for each dependency. 6 | # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", 7 | # Then this file should have google-cloud-foo>=1 8 | google-api-core>=2 9 | google-auth>=2 10 | proto-plus>=1 11 | protobuf>=6 12 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/testing/constraints-3.7.txt: -------------------------------------------------------------------------------- 1 | # This constraints file is used to check that lower bounds 2 | # are correct in setup.py 3 | # List all library dependencies and extras in this file. 4 | # Pin the version to the lower bound. 5 | # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", 6 | # Then this file should have google-cloud-foo==1.14.0 7 | google-api-core==1.34.1 8 | google-auth==2.14.1 9 | proto-plus==1.22.3 10 | protobuf==3.20.2 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/testing/constraints-3.8.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/testing/constraints-3.9.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/tests/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/tests/unit/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/tests/unit/gapic/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/credentials/tests/unit/gapic/credentials_v1/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | 4 | [report] 5 | show_missing = True 6 | omit = 7 | google/cloud/eventarc/__init__.py 8 | google/cloud/eventarc/gapic_version.py 9 | exclude_lines = 10 | # Re-enable the standard pragma 11 | pragma: NO COVER 12 | # Ignore debug-only repr 13 | def __repr__ 14 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/.flake8: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | [flake8] 17 | # TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): 18 | # Resolve flake8 lint issues 19 | ignore = E203, E231, E266, E501, W503 20 | exclude = 21 | # TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): 22 | # Ensure that generated code passes flake8 lint 23 | **/gapic/** 24 | **/services/** 25 | **/types/** 26 | # Exclude Protobuf gencode 27 | *_pb2.py 28 | 29 | # Standard linting exemptions. 30 | **/.nox/** 31 | __pycache__, 32 | .git, 33 | *.pyc, 34 | conf.py 35 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/BUILD.bazel: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "goldens_files", 5 | srcs = glob( 6 | ["**/*"], 7 | exclude = [ 8 | "BUILD.bazel", 9 | ".*.sw*", 10 | ], 11 | ), 12 | ) 13 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/MANIFEST.in: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | include README.rst LICENSE 17 | recursive-include google *.py *.pyi *.json *.proto py.typed 18 | recursive-include tests * 19 | global-exclude *.py[co] 20 | global-exclude __pycache__ 21 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/docs/_static/custom.css: -------------------------------------------------------------------------------- 1 | div#python2-eol { 2 | border-color: red; 3 | border-width: medium; 4 | } 5 | 6 | /* Ensure minimum width for 'Parameters' / 'Returns' column */ 7 | dl.field-list > dt { 8 | min-width: 100px 9 | } 10 | 11 | /* Insert space between methods for readability */ 12 | dl.method { 13 | padding-top: 10px; 14 | padding-bottom: 10px 15 | } 16 | 17 | /* Insert empty space between classes */ 18 | dl.class { 19 | padding-bottom: 50px 20 | } 21 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/docs/eventarc_v1/eventarc.rst: -------------------------------------------------------------------------------- 1 | Eventarc 2 | -------------------------- 3 | 4 | .. automodule:: google.cloud.eventarc_v1.services.eventarc 5 | :members: 6 | :inherited-members: 7 | 8 | .. automodule:: google.cloud.eventarc_v1.services.eventarc.pagers 9 | :members: 10 | :inherited-members: 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/docs/eventarc_v1/services_.rst: -------------------------------------------------------------------------------- 1 | Services for Google Cloud Eventarc v1 API 2 | ========================================= 3 | .. toctree:: 4 | :maxdepth: 2 5 | 6 | eventarc 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/docs/eventarc_v1/types_.rst: -------------------------------------------------------------------------------- 1 | Types for Google Cloud Eventarc v1 API 2 | ====================================== 3 | 4 | .. automodule:: google.cloud.eventarc_v1.types 5 | :members: 6 | :show-inheritance: 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/docs/index.rst: -------------------------------------------------------------------------------- 1 | .. include:: multiprocessing.rst 2 | 3 | 4 | API Reference 5 | ------------- 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | eventarc_v1/services_ 10 | eventarc_v1/types_ 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/docs/multiprocessing.rst: -------------------------------------------------------------------------------- 1 | .. note:: 2 | 3 | Because this client uses :mod:`grpc` library, it is safe to 4 | share instances across threads. In multiprocessing scenarios, the best 5 | practice is to create client instances *after* the invocation of 6 | :func:`os.fork` by :class:`multiprocessing.pool.Pool` or 7 | :class:`multiprocessing.Process`. 8 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/google/cloud/eventarc_v1/gapic_version.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | __version__ = "0.0.0" # {x-release-please-version} 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/google/cloud/eventarc_v1/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. 2 | # The google-cloud-eventarc package uses inline types. 3 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | from .client import EventarcClient 17 | from .async_client import EventarcAsyncClient 18 | 19 | __all__ = ( 20 | 'EventarcClient', 21 | 'EventarcAsyncClient', 22 | ) 23 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/transports/README.rst: -------------------------------------------------------------------------------- 1 | 2 | transport inheritance structure 3 | _______________________________ 4 | 5 | `EventarcTransport` is the ABC for all transports. 6 | - public child `EventarcGrpcTransport` for sync gRPC transport (defined in `grpc.py`). 7 | - public child `EventarcGrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`). 8 | - private child `_BaseEventarcRestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`). 9 | - public child `EventarcRestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`). 10 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | python_version = 3.7 3 | namespace_packages = True 4 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/testing/constraints-3.10.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | grpc-google-iam-v1 8 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/testing/constraints-3.11.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | grpc-google-iam-v1 8 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/testing/constraints-3.12.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | grpc-google-iam-v1 8 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/testing/constraints-3.13.txt: -------------------------------------------------------------------------------- 1 | # We use the constraints file for the latest Python version 2 | # (currently this file) to check that the latest 3 | # major versions of dependencies are supported in setup.py. 4 | # List all library dependencies and extras in this file. 5 | # Require the latest major version be installed for each dependency. 6 | # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", 7 | # Then this file should have google-cloud-foo>=1 8 | google-api-core>=2 9 | google-auth>=2 10 | proto-plus>=1 11 | protobuf>=6 12 | grpc-google-iam-v1>=0 13 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/testing/constraints-3.7.txt: -------------------------------------------------------------------------------- 1 | # This constraints file is used to check that lower bounds 2 | # are correct in setup.py 3 | # List all library dependencies and extras in this file. 4 | # Pin the version to the lower bound. 5 | # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", 6 | # Then this file should have google-cloud-foo==1.14.0 7 | google-api-core==1.34.1 8 | google-auth==2.14.1 9 | proto-plus==1.22.3 10 | protobuf==3.20.2 11 | grpc-google-iam-v1==0.14.0 12 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/testing/constraints-3.8.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | grpc-google-iam-v1 8 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/testing/constraints-3.9.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | grpc-google-iam-v1 8 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/tests/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/tests/unit/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/tests/unit/gapic/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/eventarc/tests/unit/gapic/eventarc_v1/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | 4 | [report] 5 | show_missing = True 6 | omit = 7 | google/cloud/logging/__init__.py 8 | google/cloud/logging/gapic_version.py 9 | exclude_lines = 10 | # Re-enable the standard pragma 11 | pragma: NO COVER 12 | # Ignore debug-only repr 13 | def __repr__ 14 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/.flake8: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | [flake8] 17 | # TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): 18 | # Resolve flake8 lint issues 19 | ignore = E203, E231, E266, E501, W503 20 | exclude = 21 | # TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): 22 | # Ensure that generated code passes flake8 lint 23 | **/gapic/** 24 | **/services/** 25 | **/types/** 26 | # Exclude Protobuf gencode 27 | *_pb2.py 28 | 29 | # Standard linting exemptions. 30 | **/.nox/** 31 | __pycache__, 32 | .git, 33 | *.pyc, 34 | conf.py 35 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/BUILD.bazel: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "goldens_files", 5 | srcs = glob( 6 | ["**/*"], 7 | exclude = [ 8 | "BUILD.bazel", 9 | ".*.sw*", 10 | ], 11 | ), 12 | ) 13 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/MANIFEST.in: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | include README.rst LICENSE 17 | recursive-include google *.py *.pyi *.json *.proto py.typed 18 | recursive-include tests * 19 | global-exclude *.py[co] 20 | global-exclude __pycache__ 21 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/docs/_static/custom.css: -------------------------------------------------------------------------------- 1 | div#python2-eol { 2 | border-color: red; 3 | border-width: medium; 4 | } 5 | 6 | /* Ensure minimum width for 'Parameters' / 'Returns' column */ 7 | dl.field-list > dt { 8 | min-width: 100px 9 | } 10 | 11 | /* Insert space between methods for readability */ 12 | dl.method { 13 | padding-top: 10px; 14 | padding-bottom: 10px 15 | } 16 | 17 | /* Insert empty space between classes */ 18 | dl.class { 19 | padding-bottom: 50px 20 | } 21 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/docs/index.rst: -------------------------------------------------------------------------------- 1 | .. include:: multiprocessing.rst 2 | 3 | 4 | API Reference 5 | ------------- 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | logging_v2/services_ 10 | logging_v2/types_ 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/docs/logging_v2/config_service_v2.rst: -------------------------------------------------------------------------------- 1 | ConfigServiceV2 2 | --------------------------------- 3 | 4 | .. automodule:: google.cloud.logging_v2.services.config_service_v2 5 | :members: 6 | :inherited-members: 7 | 8 | .. automodule:: google.cloud.logging_v2.services.config_service_v2.pagers 9 | :members: 10 | :inherited-members: 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/docs/logging_v2/logging_service_v2.rst: -------------------------------------------------------------------------------- 1 | LoggingServiceV2 2 | ---------------------------------- 3 | 4 | .. automodule:: google.cloud.logging_v2.services.logging_service_v2 5 | :members: 6 | :inherited-members: 7 | 8 | .. automodule:: google.cloud.logging_v2.services.logging_service_v2.pagers 9 | :members: 10 | :inherited-members: 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/docs/logging_v2/metrics_service_v2.rst: -------------------------------------------------------------------------------- 1 | MetricsServiceV2 2 | ---------------------------------- 3 | 4 | .. automodule:: google.cloud.logging_v2.services.metrics_service_v2 5 | :members: 6 | :inherited-members: 7 | 8 | .. automodule:: google.cloud.logging_v2.services.metrics_service_v2.pagers 9 | :members: 10 | :inherited-members: 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/docs/logging_v2/services_.rst: -------------------------------------------------------------------------------- 1 | Services for Google Cloud Logging v2 API 2 | ======================================== 3 | .. toctree:: 4 | :maxdepth: 2 5 | 6 | config_service_v2 7 | logging_service_v2 8 | metrics_service_v2 9 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/docs/logging_v2/types_.rst: -------------------------------------------------------------------------------- 1 | Types for Google Cloud Logging v2 API 2 | ===================================== 3 | 4 | .. automodule:: google.cloud.logging_v2.types 5 | :members: 6 | :show-inheritance: 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/docs/multiprocessing.rst: -------------------------------------------------------------------------------- 1 | .. note:: 2 | 3 | Because this client uses :mod:`grpc` library, it is safe to 4 | share instances across threads. In multiprocessing scenarios, the best 5 | practice is to create client instances *after* the invocation of 6 | :func:`os.fork` by :class:`multiprocessing.pool.Pool` or 7 | :class:`multiprocessing.Process`. 8 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/google/cloud/logging/gapic_version.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | __version__ = "0.0.0" # {x-release-please-version} 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/google/cloud/logging/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. 2 | # The google-cloud-logging package uses inline types. 3 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/google/cloud/logging_v2/gapic_version.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | __version__ = "0.0.0" # {x-release-please-version} 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/google/cloud/logging_v2/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. 2 | # The google-cloud-logging package uses inline types. 3 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/google/cloud/logging_v2/services/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | from .client import ConfigServiceV2Client 17 | from .async_client import ConfigServiceV2AsyncClient 18 | 19 | __all__ = ( 20 | 'ConfigServiceV2Client', 21 | 'ConfigServiceV2AsyncClient', 22 | ) 23 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/transports/README.rst: -------------------------------------------------------------------------------- 1 | 2 | transport inheritance structure 3 | _______________________________ 4 | 5 | `ConfigServiceV2Transport` is the ABC for all transports. 6 | - public child `ConfigServiceV2GrpcTransport` for sync gRPC transport (defined in `grpc.py`). 7 | - public child `ConfigServiceV2GrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`). 8 | - private child `_BaseConfigServiceV2RestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`). 9 | - public child `ConfigServiceV2RestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`). 10 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | from .client import LoggingServiceV2Client 17 | from .async_client import LoggingServiceV2AsyncClient 18 | 19 | __all__ = ( 20 | 'LoggingServiceV2Client', 21 | 'LoggingServiceV2AsyncClient', 22 | ) 23 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/transports/README.rst: -------------------------------------------------------------------------------- 1 | 2 | transport inheritance structure 3 | _______________________________ 4 | 5 | `LoggingServiceV2Transport` is the ABC for all transports. 6 | - public child `LoggingServiceV2GrpcTransport` for sync gRPC transport (defined in `grpc.py`). 7 | - public child `LoggingServiceV2GrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`). 8 | - private child `_BaseLoggingServiceV2RestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`). 9 | - public child `LoggingServiceV2RestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`). 10 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | from .client import MetricsServiceV2Client 17 | from .async_client import MetricsServiceV2AsyncClient 18 | 19 | __all__ = ( 20 | 'MetricsServiceV2Client', 21 | 'MetricsServiceV2AsyncClient', 22 | ) 23 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/transports/README.rst: -------------------------------------------------------------------------------- 1 | 2 | transport inheritance structure 3 | _______________________________ 4 | 5 | `MetricsServiceV2Transport` is the ABC for all transports. 6 | - public child `MetricsServiceV2GrpcTransport` for sync gRPC transport (defined in `grpc.py`). 7 | - public child `MetricsServiceV2GrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`). 8 | - private child `_BaseMetricsServiceV2RestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`). 9 | - public child `MetricsServiceV2RestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`). 10 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | python_version = 3.7 3 | namespace_packages = True 4 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/testing/constraints-3.10.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/testing/constraints-3.11.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/testing/constraints-3.12.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/testing/constraints-3.13.txt: -------------------------------------------------------------------------------- 1 | # We use the constraints file for the latest Python version 2 | # (currently this file) to check that the latest 3 | # major versions of dependencies are supported in setup.py. 4 | # List all library dependencies and extras in this file. 5 | # Require the latest major version be installed for each dependency. 6 | # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", 7 | # Then this file should have google-cloud-foo>=1 8 | google-api-core>=2 9 | google-auth>=2 10 | proto-plus>=1 11 | protobuf>=6 12 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/testing/constraints-3.7.txt: -------------------------------------------------------------------------------- 1 | # This constraints file is used to check that lower bounds 2 | # are correct in setup.py 3 | # List all library dependencies and extras in this file. 4 | # Pin the version to the lower bound. 5 | # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", 6 | # Then this file should have google-cloud-foo==1.14.0 7 | google-api-core==1.34.1 8 | google-auth==2.14.1 9 | proto-plus==1.22.3 10 | protobuf==3.20.2 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/testing/constraints-3.8.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/testing/constraints-3.9.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/tests/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/tests/unit/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/tests/unit/gapic/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging/tests/unit/gapic/logging_v2/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | 4 | [report] 5 | show_missing = True 6 | omit = 7 | google/cloud/logging/__init__.py 8 | google/cloud/logging/gapic_version.py 9 | exclude_lines = 10 | # Re-enable the standard pragma 11 | pragma: NO COVER 12 | # Ignore debug-only repr 13 | def __repr__ 14 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/.flake8: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | [flake8] 17 | # TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): 18 | # Resolve flake8 lint issues 19 | ignore = E203, E231, E266, E501, W503 20 | exclude = 21 | # TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): 22 | # Ensure that generated code passes flake8 lint 23 | **/gapic/** 24 | **/services/** 25 | **/types/** 26 | # Exclude Protobuf gencode 27 | *_pb2.py 28 | 29 | # Standard linting exemptions. 30 | **/.nox/** 31 | __pycache__, 32 | .git, 33 | *.pyc, 34 | conf.py 35 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/BUILD.bazel: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "goldens_files", 5 | srcs = glob( 6 | ["**/*"], 7 | exclude = [ 8 | "BUILD.bazel", 9 | ".*.sw*", 10 | ], 11 | ), 12 | ) 13 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/MANIFEST.in: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | include README.rst LICENSE 17 | recursive-include google *.py *.pyi *.json *.proto py.typed 18 | recursive-include tests * 19 | global-exclude *.py[co] 20 | global-exclude __pycache__ 21 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/docs/_static/custom.css: -------------------------------------------------------------------------------- 1 | div#python2-eol { 2 | border-color: red; 3 | border-width: medium; 4 | } 5 | 6 | /* Ensure minimum width for 'Parameters' / 'Returns' column */ 7 | dl.field-list > dt { 8 | min-width: 100px 9 | } 10 | 11 | /* Insert space between methods for readability */ 12 | dl.method { 13 | padding-top: 10px; 14 | padding-bottom: 10px 15 | } 16 | 17 | /* Insert empty space between classes */ 18 | dl.class { 19 | padding-bottom: 50px 20 | } 21 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/docs/index.rst: -------------------------------------------------------------------------------- 1 | .. include:: multiprocessing.rst 2 | 3 | 4 | API Reference 5 | ------------- 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | logging_v2/services_ 10 | logging_v2/types_ 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/docs/logging_v2/config_service_v2.rst: -------------------------------------------------------------------------------- 1 | ConfigServiceV2 2 | --------------------------------- 3 | 4 | .. automodule:: google.cloud.logging_v2.services.config_service_v2 5 | :members: 6 | :inherited-members: 7 | 8 | .. automodule:: google.cloud.logging_v2.services.config_service_v2.pagers 9 | :members: 10 | :inherited-members: 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/docs/logging_v2/logging_service_v2.rst: -------------------------------------------------------------------------------- 1 | LoggingServiceV2 2 | ---------------------------------- 3 | 4 | .. automodule:: google.cloud.logging_v2.services.logging_service_v2 5 | :members: 6 | :inherited-members: 7 | 8 | .. automodule:: google.cloud.logging_v2.services.logging_service_v2.pagers 9 | :members: 10 | :inherited-members: 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/docs/logging_v2/metrics_service_v2.rst: -------------------------------------------------------------------------------- 1 | MetricsServiceV2 2 | ---------------------------------- 3 | 4 | .. automodule:: google.cloud.logging_v2.services.metrics_service_v2 5 | :members: 6 | :inherited-members: 7 | 8 | .. automodule:: google.cloud.logging_v2.services.metrics_service_v2.pagers 9 | :members: 10 | :inherited-members: 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/docs/logging_v2/services_.rst: -------------------------------------------------------------------------------- 1 | Services for Google Cloud Logging v2 API 2 | ======================================== 3 | .. toctree:: 4 | :maxdepth: 2 5 | 6 | config_service_v2 7 | logging_service_v2 8 | metrics_service_v2 9 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/docs/logging_v2/types_.rst: -------------------------------------------------------------------------------- 1 | Types for Google Cloud Logging v2 API 2 | ===================================== 3 | 4 | .. automodule:: google.cloud.logging_v2.types 5 | :members: 6 | :show-inheritance: 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/docs/multiprocessing.rst: -------------------------------------------------------------------------------- 1 | .. note:: 2 | 3 | Because this client uses :mod:`grpc` library, it is safe to 4 | share instances across threads. In multiprocessing scenarios, the best 5 | practice is to create client instances *after* the invocation of 6 | :func:`os.fork` by :class:`multiprocessing.pool.Pool` or 7 | :class:`multiprocessing.Process`. 8 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/google/cloud/logging/gapic_version.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | __version__ = "0.0.0" # {x-release-please-version} 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/google/cloud/logging/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. 2 | # The google-cloud-logging package uses inline types. 3 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/google/cloud/logging_v2/gapic_version.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | __version__ = "0.0.0" # {x-release-please-version} 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/google/cloud/logging_v2/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. 2 | # The google-cloud-logging package uses inline types. 3 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/config_service_v2/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | from .client import BaseConfigServiceV2Client 17 | from .async_client import BaseConfigServiceV2AsyncClient 18 | 19 | __all__ = ( 20 | 'BaseConfigServiceV2Client', 21 | 'BaseConfigServiceV2AsyncClient', 22 | ) 23 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/config_service_v2/transports/README.rst: -------------------------------------------------------------------------------- 1 | 2 | transport inheritance structure 3 | _______________________________ 4 | 5 | `ConfigServiceV2Transport` is the ABC for all transports. 6 | - public child `ConfigServiceV2GrpcTransport` for sync gRPC transport (defined in `grpc.py`). 7 | - public child `ConfigServiceV2GrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`). 8 | - private child `_BaseConfigServiceV2RestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`). 9 | - public child `ConfigServiceV2RestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`). 10 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/logging_service_v2/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | from .client import LoggingServiceV2Client 17 | from .async_client import LoggingServiceV2AsyncClient 18 | 19 | __all__ = ( 20 | 'LoggingServiceV2Client', 21 | 'LoggingServiceV2AsyncClient', 22 | ) 23 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/logging_service_v2/transports/README.rst: -------------------------------------------------------------------------------- 1 | 2 | transport inheritance structure 3 | _______________________________ 4 | 5 | `LoggingServiceV2Transport` is the ABC for all transports. 6 | - public child `LoggingServiceV2GrpcTransport` for sync gRPC transport (defined in `grpc.py`). 7 | - public child `LoggingServiceV2GrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`). 8 | - private child `_BaseLoggingServiceV2RestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`). 9 | - public child `LoggingServiceV2RestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`). 10 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/metrics_service_v2/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | from .client import BaseMetricsServiceV2Client 17 | from .async_client import BaseMetricsServiceV2AsyncClient 18 | 19 | __all__ = ( 20 | 'BaseMetricsServiceV2Client', 21 | 'BaseMetricsServiceV2AsyncClient', 22 | ) 23 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/metrics_service_v2/transports/README.rst: -------------------------------------------------------------------------------- 1 | 2 | transport inheritance structure 3 | _______________________________ 4 | 5 | `MetricsServiceV2Transport` is the ABC for all transports. 6 | - public child `MetricsServiceV2GrpcTransport` for sync gRPC transport (defined in `grpc.py`). 7 | - public child `MetricsServiceV2GrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`). 8 | - private child `_BaseMetricsServiceV2RestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`). 9 | - public child `MetricsServiceV2RestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`). 10 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | python_version = 3.7 3 | namespace_packages = True 4 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/testing/constraints-3.10.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/testing/constraints-3.11.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/testing/constraints-3.12.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/testing/constraints-3.13.txt: -------------------------------------------------------------------------------- 1 | # We use the constraints file for the latest Python version 2 | # (currently this file) to check that the latest 3 | # major versions of dependencies are supported in setup.py. 4 | # List all library dependencies and extras in this file. 5 | # Require the latest major version be installed for each dependency. 6 | # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", 7 | # Then this file should have google-cloud-foo>=1 8 | google-api-core>=2 9 | google-auth>=2 10 | proto-plus>=1 11 | protobuf>=6 12 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/testing/constraints-3.7.txt: -------------------------------------------------------------------------------- 1 | # This constraints file is used to check that lower bounds 2 | # are correct in setup.py 3 | # List all library dependencies and extras in this file. 4 | # Pin the version to the lower bound. 5 | # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", 6 | # Then this file should have google-cloud-foo==1.14.0 7 | google-api-core==1.34.1 8 | google-auth==2.14.1 9 | proto-plus==1.22.3 10 | protobuf==3.20.2 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/testing/constraints-3.8.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/testing/constraints-3.9.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/tests/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/tests/unit/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/tests/unit/gapic/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/logging_internal/tests/unit/gapic/logging_v2/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | 4 | [report] 5 | show_missing = True 6 | omit = 7 | google/cloud/redis/__init__.py 8 | google/cloud/redis/gapic_version.py 9 | exclude_lines = 10 | # Re-enable the standard pragma 11 | pragma: NO COVER 12 | # Ignore debug-only repr 13 | def __repr__ 14 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/.flake8: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | [flake8] 17 | # TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): 18 | # Resolve flake8 lint issues 19 | ignore = E203, E231, E266, E501, W503 20 | exclude = 21 | # TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): 22 | # Ensure that generated code passes flake8 lint 23 | **/gapic/** 24 | **/services/** 25 | **/types/** 26 | # Exclude Protobuf gencode 27 | *_pb2.py 28 | 29 | # Standard linting exemptions. 30 | **/.nox/** 31 | __pycache__, 32 | .git, 33 | *.pyc, 34 | conf.py 35 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/BUILD.bazel: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "goldens_files", 5 | srcs = glob( 6 | ["**/*"], 7 | exclude = [ 8 | "BUILD.bazel", 9 | ".*.sw*", 10 | ], 11 | ), 12 | ) 13 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/MANIFEST.in: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | include README.rst LICENSE 17 | recursive-include google *.py *.pyi *.json *.proto py.typed 18 | recursive-include tests * 19 | global-exclude *.py[co] 20 | global-exclude __pycache__ 21 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/docs/_static/custom.css: -------------------------------------------------------------------------------- 1 | div#python2-eol { 2 | border-color: red; 3 | border-width: medium; 4 | } 5 | 6 | /* Ensure minimum width for 'Parameters' / 'Returns' column */ 7 | dl.field-list > dt { 8 | min-width: 100px 9 | } 10 | 11 | /* Insert space between methods for readability */ 12 | dl.method { 13 | padding-top: 10px; 14 | padding-bottom: 10px 15 | } 16 | 17 | /* Insert empty space between classes */ 18 | dl.class { 19 | padding-bottom: 50px 20 | } 21 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/docs/index.rst: -------------------------------------------------------------------------------- 1 | .. include:: multiprocessing.rst 2 | 3 | 4 | API Reference 5 | ------------- 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | redis_v1/services_ 10 | redis_v1/types_ 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/docs/multiprocessing.rst: -------------------------------------------------------------------------------- 1 | .. note:: 2 | 3 | Because this client uses :mod:`grpc` library, it is safe to 4 | share instances across threads. In multiprocessing scenarios, the best 5 | practice is to create client instances *after* the invocation of 6 | :func:`os.fork` by :class:`multiprocessing.pool.Pool` or 7 | :class:`multiprocessing.Process`. 8 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/docs/redis_v1/cloud_redis.rst: -------------------------------------------------------------------------------- 1 | CloudRedis 2 | ---------------------------- 3 | 4 | .. automodule:: google.cloud.redis_v1.services.cloud_redis 5 | :members: 6 | :inherited-members: 7 | 8 | .. automodule:: google.cloud.redis_v1.services.cloud_redis.pagers 9 | :members: 10 | :inherited-members: 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/docs/redis_v1/services_.rst: -------------------------------------------------------------------------------- 1 | Services for Google Cloud Redis v1 API 2 | ====================================== 3 | .. toctree:: 4 | :maxdepth: 2 5 | 6 | cloud_redis 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/docs/redis_v1/types_.rst: -------------------------------------------------------------------------------- 1 | Types for Google Cloud Redis v1 API 2 | =================================== 3 | 4 | .. automodule:: google.cloud.redis_v1.types 5 | :members: 6 | :show-inheritance: 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/google/cloud/redis/gapic_version.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | __version__ = "0.0.0" # {x-release-please-version} 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/google/cloud/redis/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. 2 | # The google-cloud-redis package uses inline types. 3 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/google/cloud/redis_v1/gapic_version.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | __version__ = "0.0.0" # {x-release-please-version} 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/google/cloud/redis_v1/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. 2 | # The google-cloud-redis package uses inline types. 3 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/google/cloud/redis_v1/services/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | from .client import CloudRedisClient 17 | from .async_client import CloudRedisAsyncClient 18 | 19 | __all__ = ( 20 | 'CloudRedisClient', 21 | 'CloudRedisAsyncClient', 22 | ) 23 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/google/cloud/redis_v1/services/cloud_redis/transports/README.rst: -------------------------------------------------------------------------------- 1 | 2 | transport inheritance structure 3 | _______________________________ 4 | 5 | `CloudRedisTransport` is the ABC for all transports. 6 | - public child `CloudRedisGrpcTransport` for sync gRPC transport (defined in `grpc.py`). 7 | - public child `CloudRedisGrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`). 8 | - private child `_BaseCloudRedisRestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`). 9 | - public child `CloudRedisRestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`). 10 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | python_version = 3.7 3 | namespace_packages = True 4 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/testing/constraints-3.10.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/testing/constraints-3.11.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/testing/constraints-3.12.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/testing/constraints-3.13.txt: -------------------------------------------------------------------------------- 1 | # We use the constraints file for the latest Python version 2 | # (currently this file) to check that the latest 3 | # major versions of dependencies are supported in setup.py. 4 | # List all library dependencies and extras in this file. 5 | # Require the latest major version be installed for each dependency. 6 | # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", 7 | # Then this file should have google-cloud-foo>=1 8 | google-api-core>=2 9 | google-auth>=2 10 | proto-plus>=1 11 | protobuf>=6 12 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/testing/constraints-3.7.txt: -------------------------------------------------------------------------------- 1 | # This constraints file is used to check that lower bounds 2 | # are correct in setup.py 3 | # List all library dependencies and extras in this file. 4 | # Pin the version to the lower bound. 5 | # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", 6 | # Then this file should have google-cloud-foo==1.14.0 7 | google-api-core==1.34.1 8 | google-auth==2.14.1 9 | proto-plus==1.22.3 10 | protobuf==3.20.2 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/testing/constraints-3.8.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/testing/constraints-3.9.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/tests/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/tests/unit/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/tests/unit/gapic/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis/tests/unit/gapic/redis_v1/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | branch = True 3 | 4 | [report] 5 | show_missing = True 6 | omit = 7 | google/cloud/redis/__init__.py 8 | google/cloud/redis/gapic_version.py 9 | exclude_lines = 10 | # Re-enable the standard pragma 11 | pragma: NO COVER 12 | # Ignore debug-only repr 13 | def __repr__ 14 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/.flake8: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | [flake8] 17 | # TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): 18 | # Resolve flake8 lint issues 19 | ignore = E203, E231, E266, E501, W503 20 | exclude = 21 | # TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): 22 | # Ensure that generated code passes flake8 lint 23 | **/gapic/** 24 | **/services/** 25 | **/types/** 26 | # Exclude Protobuf gencode 27 | *_pb2.py 28 | 29 | # Standard linting exemptions. 30 | **/.nox/** 31 | __pycache__, 32 | .git, 33 | *.pyc, 34 | conf.py 35 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/BUILD.bazel: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | filegroup( 4 | name = "goldens_files", 5 | srcs = glob( 6 | ["**/*"], 7 | exclude = [ 8 | "BUILD.bazel", 9 | ".*.sw*", 10 | ], 11 | ), 12 | ) 13 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/MANIFEST.in: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | include README.rst LICENSE 17 | recursive-include google *.py *.pyi *.json *.proto py.typed 18 | recursive-include tests * 19 | global-exclude *.py[co] 20 | global-exclude __pycache__ 21 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/docs/_static/custom.css: -------------------------------------------------------------------------------- 1 | div#python2-eol { 2 | border-color: red; 3 | border-width: medium; 4 | } 5 | 6 | /* Ensure minimum width for 'Parameters' / 'Returns' column */ 7 | dl.field-list > dt { 8 | min-width: 100px 9 | } 10 | 11 | /* Insert space between methods for readability */ 12 | dl.method { 13 | padding-top: 10px; 14 | padding-bottom: 10px 15 | } 16 | 17 | /* Insert empty space between classes */ 18 | dl.class { 19 | padding-bottom: 50px 20 | } 21 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/docs/index.rst: -------------------------------------------------------------------------------- 1 | .. include:: multiprocessing.rst 2 | 3 | 4 | API Reference 5 | ------------- 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | redis_v1/services_ 10 | redis_v1/types_ 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/docs/multiprocessing.rst: -------------------------------------------------------------------------------- 1 | .. note:: 2 | 3 | Because this client uses :mod:`grpc` library, it is safe to 4 | share instances across threads. In multiprocessing scenarios, the best 5 | practice is to create client instances *after* the invocation of 6 | :func:`os.fork` by :class:`multiprocessing.pool.Pool` or 7 | :class:`multiprocessing.Process`. 8 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/docs/redis_v1/cloud_redis.rst: -------------------------------------------------------------------------------- 1 | CloudRedis 2 | ---------------------------- 3 | 4 | .. automodule:: google.cloud.redis_v1.services.cloud_redis 5 | :members: 6 | :inherited-members: 7 | 8 | .. automodule:: google.cloud.redis_v1.services.cloud_redis.pagers 9 | :members: 10 | :inherited-members: 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/docs/redis_v1/services_.rst: -------------------------------------------------------------------------------- 1 | Services for Google Cloud Redis v1 API 2 | ====================================== 3 | .. toctree:: 4 | :maxdepth: 2 5 | 6 | cloud_redis 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/docs/redis_v1/types_.rst: -------------------------------------------------------------------------------- 1 | Types for Google Cloud Redis v1 API 2 | =================================== 3 | 4 | .. automodule:: google.cloud.redis_v1.types 5 | :members: 6 | :show-inheritance: 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/google/cloud/redis/gapic_version.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | __version__ = "0.0.0" # {x-release-please-version} 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/google/cloud/redis/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. 2 | # The google-cloud-redis package uses inline types. 3 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/google/cloud/redis_v1/gapic_version.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | __version__ = "0.0.0" # {x-release-please-version} 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/google/cloud/redis_v1/py.typed: -------------------------------------------------------------------------------- 1 | # Marker file for PEP 561. 2 | # The google-cloud-redis package uses inline types. 3 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/google/cloud/redis_v1/services/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/google/cloud/redis_v1/services/cloud_redis/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright 2025 Google LLC 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | from .client import CloudRedisClient 17 | from .async_client import CloudRedisAsyncClient 18 | 19 | __all__ = ( 20 | 'CloudRedisClient', 21 | 'CloudRedisAsyncClient', 22 | ) 23 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/google/cloud/redis_v1/services/cloud_redis/transports/README.rst: -------------------------------------------------------------------------------- 1 | 2 | transport inheritance structure 3 | _______________________________ 4 | 5 | `CloudRedisTransport` is the ABC for all transports. 6 | - public child `CloudRedisGrpcTransport` for sync gRPC transport (defined in `grpc.py`). 7 | - public child `CloudRedisGrpcAsyncIOTransport` for async gRPC transport (defined in `grpc_asyncio.py`). 8 | - private child `_BaseCloudRedisRestTransport` for base REST transport with inner classes `_BaseMETHOD` (defined in `rest_base.py`). 9 | - public child `CloudRedisRestTransport` for sync REST transport with inner classes `METHOD` derived from the parent's corresponding `_BaseMETHOD` classes (defined in `rest.py`). 10 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | python_version = 3.7 3 | namespace_packages = True 4 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/testing/constraints-3.10.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/testing/constraints-3.11.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/testing/constraints-3.12.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/testing/constraints-3.13.txt: -------------------------------------------------------------------------------- 1 | # We use the constraints file for the latest Python version 2 | # (currently this file) to check that the latest 3 | # major versions of dependencies are supported in setup.py. 4 | # List all library dependencies and extras in this file. 5 | # Require the latest major version be installed for each dependency. 6 | # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", 7 | # Then this file should have google-cloud-foo>=1 8 | google-api-core>=2 9 | google-auth>=2 10 | proto-plus>=1 11 | protobuf>=6 12 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/testing/constraints-3.7.txt: -------------------------------------------------------------------------------- 1 | # This constraints file is used to check that lower bounds 2 | # are correct in setup.py 3 | # List all library dependencies and extras in this file. 4 | # Pin the version to the lower bound. 5 | # e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0", 6 | # Then this file should have google-cloud-foo==1.14.0 7 | google-api-core==1.34.1 8 | google-auth==2.14.1 9 | proto-plus==1.22.3 10 | protobuf==3.20.2 11 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/testing/constraints-3.8.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/testing/constraints-3.9.txt: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # This constraints file is required for unit tests. 3 | # List all library dependencies and extras in this file. 4 | google-api-core 5 | proto-plus 6 | protobuf 7 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/tests/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/tests/unit/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/tests/unit/gapic/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/goldens/redis_selective/tests/unit/gapic/redis_v1/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | # -*- coding: utf-8 -*- 3 | # Copyright 2025 Google LLC 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | -------------------------------------------------------------------------------- /tests/integration/iamcredentials_grpc_service_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "methodConfig": [ 3 | { 4 | "name": [ 5 | { 6 | "service": "google.iam.credentials.v1.IAMCredentials", 7 | "method": "GenerateAccessToken" 8 | }, 9 | { 10 | "service": "google.iam.credentials.v1.IAMCredentials", 11 | "method": "GenerateIdToken" 12 | }, 13 | { 14 | "service": "google.iam.credentials.v1.IAMCredentials", 15 | "method": "SignBlob" 16 | }, 17 | { 18 | "service": "google.iam.credentials.v1.IAMCredentials", 19 | "method": "SignJwt" 20 | } 21 | ], 22 | "timeout": "60s", 23 | "retryPolicy": { 24 | "maxAttempts": 5, 25 | "initialBackoff": "0.100s", 26 | "maxBackoff": "60s", 27 | "backoffMultiplier": 1.3, 28 | "retryableStatusCodes": [ 29 | "UNAVAILABLE", 30 | "DEADLINE_EXCEEDED" 31 | ] 32 | } 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /tests/integration/iamcredentials_v1.yaml: -------------------------------------------------------------------------------- 1 | type: google.api.Service 2 | config_version: 3 3 | name: iamcredentials.googleapis.com 4 | title: IAM Service Account Credentials API 5 | 6 | apis: 7 | - name: google.iam.credentials.v1.IAMCredentials 8 | 9 | documentation: 10 | summary: 'Creates short-lived, limited-privilege credentials for IAM service accounts.' 11 | 12 | authentication: 13 | rules: 14 | - selector: 'google.iam.credentials.v1.IAMCredentials.*' 15 | oauth: 16 | canonical_scopes: |- 17 | https://www.googleapis.com/auth/cloud-platform -------------------------------------------------------------------------------- /tests/unit/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/gapic-generator-python/890731963ce033745b6804fa27b86b32ccc2564c/tests/unit/__init__.py -------------------------------------------------------------------------------- /tests/unit/configurable_snippetgen/resources/speech/request.desc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/gapic-generator-python/890731963ce033745b6804fa27b86b32ccc2564c/tests/unit/configurable_snippetgen/resources/speech/request.desc -------------------------------------------------------------------------------- /tests/unit/generator/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/gapic-generator-python/890731963ce033745b6804fa27b86b32ccc2564c/tests/unit/generator/__init__.py -------------------------------------------------------------------------------- /tests/unit/samplegen/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googleapis/gapic-generator-python/890731963ce033745b6804fa27b86b32ccc2564c/tests/unit/samplegen/__init__.py -------------------------------------------------------------------------------- /tests/unit/schema/wrappers/test_oneof.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | import collections 16 | 17 | import pytest 18 | 19 | from google.api import field_behavior_pb2 20 | from google.protobuf import descriptor_pb2 21 | 22 | from gapic.schema import metadata 23 | from gapic.schema import wrappers 24 | 25 | from test_utils.test_utils import ( 26 | make_oneof_pb2, 27 | ) 28 | 29 | 30 | def test_wrapped_oneof(): 31 | oneof_pb = make_oneof_pb2("oneof_name") 32 | wrapped = wrappers.Oneof(oneof_pb=oneof_pb) 33 | 34 | assert wrapped.oneof_pb == oneof_pb 35 | assert wrapped.name == oneof_pb.name 36 | -------------------------------------------------------------------------------- /tests/unit/utils/test_cache.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | from gapic.utils import cache 16 | 17 | 18 | def test_cached_property(): 19 | class Foo: 20 | def __init__(self): 21 | self.call_count = 0 22 | 23 | @cache.cached_property 24 | def bar(self): 25 | self.call_count += 1 26 | return 42 27 | 28 | foo = Foo() 29 | assert foo.call_count == 0 30 | assert foo.bar == 42 31 | assert foo.call_count == 1 32 | assert foo.bar == 42 33 | assert foo.call_count == 1 34 | -------------------------------------------------------------------------------- /tests/unit/utils/test_uri_conv.py: -------------------------------------------------------------------------------- 1 | # Copyright 2021 Google LLC 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | import pypandoc 17 | 18 | from gapic import utils 19 | 20 | 21 | def test_convert_uri_fieldname(): 22 | uri = "abc/*/license/{license}/{xyz.class=class/*}" 23 | expected_uri = "abc/*/license/{license_}/{xyz.class_=class/*}" 24 | assert utils.convert_uri_fieldnames(uri) == expected_uri 25 | 26 | 27 | def test_convert_uri_fieldname_no_fields(): 28 | uri = "abc/license" 29 | assert utils.convert_uri_fieldnames(uri) == uri 30 | 31 | 32 | def test_convert_uri_fieldname_no_reserved_names(): 33 | uri = "abc/*/books/{book}/{xyz.chapter=page/*}" 34 | assert utils.convert_uri_fieldnames(uri) == uri 35 | --------------------------------------------------------------------------------