From 8f4cad209cc80000507d30e3adfd075d70f209a3 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 20 Nov 2019 09:42:44 -0800 Subject: [PATCH] fix(irm): deprecate resource name helper methods (via synth) (#9860) --- irm/docs/_static/custom.css | 2 +- irm/docs/_templates/layout.html | 1 + .../gapic/incident_service_client.py | 56 ++++++++++++++++--- irm/synth.metadata | 12 ++-- 4 files changed, 56 insertions(+), 15 deletions(-) diff --git a/irm/docs/_static/custom.css b/irm/docs/_static/custom.css index 9a6f9f8ddc3a..0abaf229fce3 100644 --- a/irm/docs/_static/custom.css +++ b/irm/docs/_static/custom.css @@ -1,4 +1,4 @@ div#python2-eol { border-color: red; border-width: medium; -} \ No newline at end of file +} \ No newline at end of file diff --git a/irm/docs/_templates/layout.html b/irm/docs/_templates/layout.html index de457b2c2767..228529efe2d2 100644 --- a/irm/docs/_templates/layout.html +++ b/irm/docs/_templates/layout.html @@ -1,3 +1,4 @@ + {% extends "!layout.html" %} {%- block content %} {%- if theme_fixed_sidebar|lower == 'true' %} diff --git a/irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py b/irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py index 6906700cbe92..003b14dd3bae 100644 --- a/irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py +++ b/irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py @@ -77,7 +77,12 @@ def from_service_account_file(cls, filename, *args, **kwargs): @classmethod def annotation_path(cls, project, incident, annotation): - """Return a fully-qualified annotation string.""" + """DEPRECATED. Return a fully-qualified annotation string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}/annotations/{annotation}", project=project, @@ -87,7 +92,12 @@ def annotation_path(cls, project, incident, annotation): @classmethod def artifact_path(cls, project, incident, artifact): - """Return a fully-qualified artifact string.""" + """DEPRECATED. Return a fully-qualified artifact string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}/artifacts/{artifact}", project=project, @@ -97,7 +107,12 @@ def artifact_path(cls, project, incident, artifact): @classmethod def incident_path(cls, project, incident): - """Return a fully-qualified incident string.""" + """DEPRECATED. Return a fully-qualified incident string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}", project=project, @@ -106,14 +121,24 @@ def incident_path(cls, project, incident): @classmethod def project_path(cls, project): - """Return a fully-qualified project string.""" + """DEPRECATED. Return a fully-qualified project string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}", project=project ) @classmethod def role_assignment_path(cls, project, incident, role_assignment): - """Return a fully-qualified role_assignment string.""" + """DEPRECATED. Return a fully-qualified role_assignment string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}/roleAssignments/{role_assignment}", project=project, @@ -123,14 +148,24 @@ def role_assignment_path(cls, project, incident, role_assignment): @classmethod def signal_path(cls, project, signal): - """Return a fully-qualified signal string.""" + """DEPRECATED. Return a fully-qualified signal string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/signals/{signal}", project=project, signal=signal ) @classmethod def subscription_path(cls, project, incident, subscription): - """Return a fully-qualified subscription string.""" + """DEPRECATED. Return a fully-qualified subscription string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}/subscriptions/{subscription}", project=project, @@ -140,7 +175,12 @@ def subscription_path(cls, project, incident, subscription): @classmethod def tag_path(cls, project, incident, tag): - """Return a fully-qualified tag string.""" + """DEPRECATED. Return a fully-qualified tag string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/incidents/{incident}/tags/{tag}", project=project, diff --git a/irm/synth.metadata b/irm/synth.metadata index d6539a1bb446..4513eb980873 100644 --- a/irm/synth.metadata +++ b/irm/synth.metadata @@ -1,26 +1,26 @@ { - "updateTime": "2019-10-05T12:26:52.725480Z", + "updateTime": "2019-11-20T13:23:46.362060Z", "sources": [ { "generator": { "name": "artman", - "version": "0.38.0", - "dockerImage": "googleapis/artman@sha256:0d2f8d429110aeb8d82df6550ef4ede59d40df9062d260a1580fce688b0512bf" + "version": "0.42.1", + "dockerImage": "googleapis/artman@sha256:c773192618c608a7a0415dd95282f841f8e6bcdef7dd760a988c93b77a64bd57" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ceb8e2fb12f048cc94caae532ef0b4cf026a78f3", - "internalRef": "272971705" + "sha": "16543773103e2619d2b5f52456264de5bb9be104", + "internalRef": "281423227" } }, { "template": { "name": "python_library", "origin": "synthtool.gcp", - "version": "2019.5.2" + "version": "2019.10.17" } } ],