Skip to content

Commit 2ea4723

Browse files
yoshi-automationbusunkim96
authored andcommitted
fix(kms): deprecate resource name helper methods (via synth) (#9836)
1 parent c958720 commit 2ea4723

File tree

2 files changed

+41
-11
lines changed

2 files changed

+41
-11
lines changed

kms/google/cloud/kms_v1/gapic/key_management_service_client.py

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9292

9393
@classmethod
9494
def crypto_key_path(cls, project, location, key_ring, crypto_key):
95-
"""Return a fully-qualified crypto_key string."""
95+
"""DEPRECATED. Return a fully-qualified crypto_key string."""
96+
warnings.warn(
97+
"Resource name helper functions are deprecated.",
98+
PendingDeprecationWarning,
99+
stacklevel=1,
100+
)
96101
return google.api_core.path_template.expand(
97102
"projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}",
98103
project=project,
@@ -103,7 +108,12 @@ def crypto_key_path(cls, project, location, key_ring, crypto_key):
103108

104109
@classmethod
105110
def crypto_key_path_path(cls, project, location, key_ring, crypto_key_path):
106-
"""Return a fully-qualified crypto_key_path string."""
111+
"""DEPRECATED. Return a fully-qualified crypto_key_path string."""
112+
warnings.warn(
113+
"Resource name helper functions are deprecated.",
114+
PendingDeprecationWarning,
115+
stacklevel=1,
116+
)
107117
return google.api_core.path_template.expand(
108118
"projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key_path=**}",
109119
project=project,
@@ -116,7 +126,12 @@ def crypto_key_path_path(cls, project, location, key_ring, crypto_key_path):
116126
def crypto_key_version_path(
117127
cls, project, location, key_ring, crypto_key, crypto_key_version
118128
):
119-
"""Return a fully-qualified crypto_key_version string."""
129+
"""DEPRECATED. Return a fully-qualified crypto_key_version string."""
130+
warnings.warn(
131+
"Resource name helper functions are deprecated.",
132+
PendingDeprecationWarning,
133+
stacklevel=1,
134+
)
120135
return google.api_core.path_template.expand(
121136
"projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}",
122137
project=project,
@@ -128,7 +143,12 @@ def crypto_key_version_path(
128143

129144
@classmethod
130145
def import_job_path(cls, project, location, key_ring, import_job):
131-
"""Return a fully-qualified import_job string."""
146+
"""DEPRECATED. Return a fully-qualified import_job string."""
147+
warnings.warn(
148+
"Resource name helper functions are deprecated.",
149+
PendingDeprecationWarning,
150+
stacklevel=1,
151+
)
132152
return google.api_core.path_template.expand(
133153
"projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}",
134154
project=project,
@@ -139,7 +159,12 @@ def import_job_path(cls, project, location, key_ring, import_job):
139159

140160
@classmethod
141161
def key_ring_path(cls, project, location, key_ring):
142-
"""Return a fully-qualified key_ring string."""
162+
"""DEPRECATED. Return a fully-qualified key_ring string."""
163+
warnings.warn(
164+
"Resource name helper functions are deprecated.",
165+
PendingDeprecationWarning,
166+
stacklevel=1,
167+
)
143168
return google.api_core.path_template.expand(
144169
"projects/{project}/locations/{location}/keyRings/{key_ring}",
145170
project=project,
@@ -149,7 +174,12 @@ def key_ring_path(cls, project, location, key_ring):
149174

150175
@classmethod
151176
def location_path(cls, project, location):
152-
"""Return a fully-qualified location string."""
177+
"""DEPRECATED. Return a fully-qualified location string."""
178+
warnings.warn(
179+
"Resource name helper functions are deprecated.",
180+
PendingDeprecationWarning,
181+
stacklevel=1,
182+
)
153183
return google.api_core.path_template.expand(
154184
"projects/{project}/locations/{location}",
155185
project=project,

kms/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:31:26.937119Z",
2+
"updateTime": "2019-11-19T13:25:29.291044Z",
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)