This repository was archived by the owner on Mar 26, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
feat: add support for reading google.api.api_version #1999
Merged
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
4e3138c
feat: add support for reading google.api.api_version
parthea 009fc71
add showcase tests; clean up code
parthea b574ed1
remove noise in diff
parthea dd96aa4
remove noise in diff
parthea de4ba22
remove noise in diff
parthea 28e6991
use gapic-showcase 0.35.0
parthea fca5b55
update comment
parthea 8cd648a
add constraints to ads templates
parthea 35755b7
add new line
parthea ea5666f
update google-api-core and googleapis-common-protos setup.py to match…
parthea 79f1767
update grpc in setup.py to match the one in googleads/google-ads-python
parthea 7eb5c92
style
parthea c0b7810
coverage
parthea d52e78e
fix test
parthea 5129f61
mypy
parthea ab18eea
coverage
parthea 6946304
revert
parthea 6dfa53c
remove test code
parthea 2e666ea
update copyright year
parthea 1e6e96e
address review feedback
parthea 6416902
fix comment
parthea 68b4010
revert constraints files for ads
parthea 178c964
remove test code
parthea a5d6109
address review feedback
parthea 109edd4
address review feedback
parthea 12ff101
revert WORKSPACE
parthea ca95a6b
clean up
parthea 0e669ab
Update gapic/templates/%namespace/%name_%version/%sub/services/%servi…
parthea 7957ded
convert to symlink
parthea 542e4e1
Revert "convert to symlink"
parthea 0f68169
Update gapic/templates/%namespace/%name_%version/%sub/services/%servi…
parthea 921f20b
address review feedback
parthea 16402e1
Revert "Update gapic/templates/%namespace/%name_%version/%sub/service…
parthea 555cff7
fix build
parthea f150e67
Address review feedback
parthea 220f873
Address review feedback
parthea a62b313
address review feedback
parthea File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,7 +54,10 @@ from .client import {{ service.client_name }} | |
|
|
||
| {# TODO(yon-mg): handle rest transport async client interaction #} | ||
| class {{ service.async_client_name }}: | ||
| """{{ service.meta.doc|rst(width=72, indent=4) }}""" | ||
| """{{ service.meta.doc|rst(width=72, indent=4) }}{% if service.version|length %} | ||
| This class implements API version {{ service.version }}.""" | ||
| {% else %}""" | ||
|
vchudnov-g marked this conversation as resolved.
Outdated
|
||
| {% endif %} | ||
|
|
||
| _client: {{ service.client_name }} | ||
|
|
||
|
|
@@ -388,6 +391,12 @@ class {{ service.async_client_name }}: | |
| ) | ||
| {% endif %} | ||
|
|
||
| {% if service.version %} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be good if we could call this code in the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 009fc71 |
||
| metadata = tuple(metadata) + ( | ||
| gapic_v1.version_header.to_grpc_metadata("{{ service.version }}") | ||
| ) | ||
| {% endif %} | ||
|
|
||
| {{ macros.auto_populate_uuid4_fields(api, method) }} | ||
|
|
||
| # Validate the universe domain. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| // Copyright (C) 2023 Google LLC | ||
|
parthea marked this conversation as resolved.
Outdated
|
||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| syntax = "proto3"; | ||
|
|
||
| package google.fragment; | ||
|
|
||
| import "google/protobuf/struct.proto"; | ||
| import "google/api/client.proto"; | ||
|
|
||
| service MyServiceWithVersion { | ||
| option (google.api.api_version) = "v1_20230601"; | ||
| option (google.api.default_host) = "my.example.com"; | ||
|
|
||
| rpc MyMethod(MethodRequest) returns (MethodResponse) { | ||
| option (google.api.method_signature) = "parameter"; | ||
| } | ||
| } | ||
|
|
||
| message MethodRequest { | ||
| google.protobuf.Value parameter = 1; | ||
| } | ||
|
|
||
| message MethodResponse { | ||
| google.protobuf.Value result = 1; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
tests/integration/goldens/credentials/testing/constraints-3.10.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # This constraints file is required for unit tests. | ||
| # List all library dependencies and extras in this file. | ||
| google-api-core | ||
| proto-plus | ||
| protobuf |
1 change: 0 additions & 1 deletion
1
tests/integration/goldens/credentials/testing/constraints-3.11.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # This constraints file is required for unit tests. | ||
| # List all library dependencies and extras in this file. | ||
| google-api-core | ||
| proto-plus | ||
| protobuf |
1 change: 0 additions & 1 deletion
1
tests/integration/goldens/credentials/testing/constraints-3.12.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # This constraints file is required for unit tests. | ||
| # List all library dependencies and extras in this file. | ||
| google-api-core | ||
| proto-plus | ||
| protobuf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
tests/integration/goldens/credentials/testing/constraints-3.8.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # This constraints file is required for unit tests. | ||
| # List all library dependencies and extras in this file. | ||
| google-api-core | ||
| proto-plus | ||
| protobuf |
1 change: 0 additions & 1 deletion
1
tests/integration/goldens/credentials/testing/constraints-3.9.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # This constraints file is required for unit tests. | ||
| # List all library dependencies and extras in this file. | ||
| google-api-core | ||
| proto-plus | ||
| protobuf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
tests/integration/goldens/eventarc/testing/constraints-3.10.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # This constraints file is required for unit tests. | ||
| # List all library dependencies and extras in this file. | ||
| google-api-core | ||
| proto-plus | ||
| protobuf | ||
| grpc-google-iam-v1 |
1 change: 0 additions & 1 deletion
1
tests/integration/goldens/eventarc/testing/constraints-3.11.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # This constraints file is required for unit tests. | ||
| # List all library dependencies and extras in this file. | ||
| google-api-core | ||
| proto-plus | ||
| protobuf | ||
| grpc-google-iam-v1 |
1 change: 0 additions & 1 deletion
1
tests/integration/goldens/eventarc/testing/constraints-3.12.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # This constraints file is required for unit tests. | ||
| # List all library dependencies and extras in this file. | ||
| google-api-core | ||
| proto-plus | ||
| protobuf | ||
| grpc-google-iam-v1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.