From a3eca000de2518080e4a960be731fb2be08c90da Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 19 Nov 2019 10:08:03 -0800 Subject: [PATCH] fix(kms): deprecate resource name helper methods (via synth) (#9836) --- .../gapic/key_management_service_client.py | 42 ++++++++++++++++--- synth.metadata | 10 ++--- 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/google/cloud/kms_v1/gapic/key_management_service_client.py b/google/cloud/kms_v1/gapic/key_management_service_client.py index 05a284b0..1491e5bb 100644 --- a/google/cloud/kms_v1/gapic/key_management_service_client.py +++ b/google/cloud/kms_v1/gapic/key_management_service_client.py @@ -92,7 +92,12 @@ def from_service_account_file(cls, filename, *args, **kwargs): @classmethod def crypto_key_path(cls, project, location, key_ring, crypto_key): - """Return a fully-qualified crypto_key string.""" + """DEPRECATED. Return a fully-qualified crypto_key string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}", project=project, @@ -103,7 +108,12 @@ def crypto_key_path(cls, project, location, key_ring, crypto_key): @classmethod def crypto_key_path_path(cls, project, location, key_ring, crypto_key_path): - """Return a fully-qualified crypto_key_path string.""" + """DEPRECATED. Return a fully-qualified crypto_key_path string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key_path=**}", project=project, @@ -116,7 +126,12 @@ def crypto_key_path_path(cls, project, location, key_ring, crypto_key_path): def crypto_key_version_path( cls, project, location, key_ring, crypto_key, crypto_key_version ): - """Return a fully-qualified crypto_key_version string.""" + """DEPRECATED. Return a fully-qualified crypto_key_version string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}", project=project, @@ -128,7 +143,12 @@ def crypto_key_version_path( @classmethod def import_job_path(cls, project, location, key_ring, import_job): - """Return a fully-qualified import_job string.""" + """DEPRECATED. Return a fully-qualified import_job string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/locations/{location}/keyRings/{key_ring}/importJobs/{import_job}", project=project, @@ -139,7 +159,12 @@ def import_job_path(cls, project, location, key_ring, import_job): @classmethod def key_ring_path(cls, project, location, key_ring): - """Return a fully-qualified key_ring string.""" + """DEPRECATED. Return a fully-qualified key_ring string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/locations/{location}/keyRings/{key_ring}", project=project, @@ -149,7 +174,12 @@ def key_ring_path(cls, project, location, key_ring): @classmethod def location_path(cls, project, location): - """Return a fully-qualified location string.""" + """DEPRECATED. Return a fully-qualified location string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/locations/{location}", project=project, diff --git a/synth.metadata b/synth.metadata index 8b910912..7bcc19c9 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-11-12T13:31:26.937119Z", + "updateTime": "2019-11-19T13:25:29.291044Z", "sources": [ { "generator": { "name": "artman", - "version": "0.41.1", - "dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e" + "version": "0.42.1", + "dockerImage": "googleapis/artman@sha256:c773192618c608a7a0415dd95282f841f8e6bcdef7dd760a988c93b77a64bd57" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "f69562be0608904932bdcfbc5ad8b9a22d9dceb8", - "internalRef": "279774957" + "sha": "d8dd7fe8d5304f7bd1c52207703d7f27d5328c5a", + "internalRef": "281088257" } }, {