Skip to content

Commit 285ff0d

Browse files
yoshi-automationbusunkim96
authored andcommitted
fix(translate): deprecate resource name helper methods (via synth) (#9845)
1 parent 40340c9 commit 285ff0d

File tree

3 files changed

+29
-9
lines changed

3 files changed

+29
-9
lines changed

translate/google/cloud/translate_v3/gapic/translation_service_client.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8080

8181
@classmethod
8282
def glossary_path(cls, project, location, glossary):
83-
"""Return a fully-qualified glossary string."""
83+
"""DEPRECATED. Return a fully-qualified glossary string."""
84+
warnings.warn(
85+
"Resource name helper functions are deprecated.",
86+
PendingDeprecationWarning,
87+
stacklevel=1,
88+
)
8489
return google.api_core.path_template.expand(
8590
"projects/{project}/locations/{location}/glossaries/{glossary}",
8691
project=project,
@@ -90,7 +95,12 @@ def glossary_path(cls, project, location, glossary):
9095

9196
@classmethod
9297
def location_path(cls, project, location):
93-
"""Return a fully-qualified location string."""
98+
"""DEPRECATED. Return a fully-qualified location string."""
99+
warnings.warn(
100+
"Resource name helper functions are deprecated.",
101+
PendingDeprecationWarning,
102+
stacklevel=1,
103+
)
94104
return google.api_core.path_template.expand(
95105
"projects/{project}/locations/{location}",
96106
project=project,

translate/google/cloud/translate_v3beta1/gapic/translation_service_client.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8080

8181
@classmethod
8282
def glossary_path(cls, project, location, glossary):
83-
"""Return a fully-qualified glossary string."""
83+
"""DEPRECATED. Return a fully-qualified glossary string."""
84+
warnings.warn(
85+
"Resource name helper functions are deprecated.",
86+
PendingDeprecationWarning,
87+
stacklevel=1,
88+
)
8489
return google.api_core.path_template.expand(
8590
"projects/{project}/locations/{location}/glossaries/{glossary}",
8691
project=project,
@@ -90,7 +95,12 @@ def glossary_path(cls, project, location, glossary):
9095

9196
@classmethod
9297
def location_path(cls, project, location):
93-
"""Return a fully-qualified location string."""
98+
"""DEPRECATED. Return a fully-qualified location string."""
99+
warnings.warn(
100+
"Resource name helper functions are deprecated.",
101+
PendingDeprecationWarning,
102+
stacklevel=1,
103+
)
94104
return google.api_core.path_template.expand(
95105
"projects/{project}/locations/{location}",
96106
project=project,

translate/synth.metadata

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2019-11-12T13:44:55.682074Z",
2+
"updateTime": "2019-11-19T13:38:48.307240Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.41.1",
8-
"dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e"
7+
"version": "0.42.1",
8+
"dockerImage": "googleapis/artman@sha256:c773192618c608a7a0415dd95282f841f8e6bcdef7dd760a988c93b77a64bd57"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "f69562be0608904932bdcfbc5ad8b9a22d9dceb8",
16-
"internalRef": "279774957"
15+
"sha": "d8dd7fe8d5304f7bd1c52207703d7f27d5328c5a",
16+
"internalRef": "281088257"
1717
}
1818
},
1919
{

0 commit comments

Comments
 (0)