From 3e1178898dda2f2700945c6af31548d7919e837b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 20 Nov 2019 09:34:15 -0800 Subject: [PATCH] fix(tasks): deprecate resource name helper methods (via synth) (#9864) --- tasks/docs/_static/custom.css | 2 +- tasks/docs/_templates/layout.html | 1 + .../tasks_v2/gapic/cloud_tasks_client.py | 28 ++++++++++++++++--- .../tasks_v2beta2/gapic/cloud_tasks_client.py | 28 ++++++++++++++++--- .../tasks_v2beta3/gapic/cloud_tasks_client.py | 28 ++++++++++++++++--- tasks/synth.metadata | 10 +++---- 6 files changed, 79 insertions(+), 18 deletions(-) diff --git a/tasks/docs/_static/custom.css b/tasks/docs/_static/custom.css index 9a6f9f8ddc3a..0abaf229fce3 100644 --- a/tasks/docs/_static/custom.css +++ b/tasks/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/tasks/docs/_templates/layout.html b/tasks/docs/_templates/layout.html index de457b2c2767..228529efe2d2 100644 --- a/tasks/docs/_templates/layout.html +++ b/tasks/docs/_templates/layout.html @@ -1,3 +1,4 @@ + {% extends "!layout.html" %} {%- block content %} {%- if theme_fixed_sidebar|lower == 'true' %} diff --git a/tasks/google/cloud/tasks_v2/gapic/cloud_tasks_client.py b/tasks/google/cloud/tasks_v2/gapic/cloud_tasks_client.py index 7c530a809640..259f5839defd 100644 --- a/tasks/google/cloud/tasks_v2/gapic/cloud_tasks_client.py +++ b/tasks/google/cloud/tasks_v2/gapic/cloud_tasks_client.py @@ -83,7 +83,12 @@ def from_service_account_file(cls, filename, *args, **kwargs): @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, @@ -92,14 +97,24 @@ def location_path(cls, project, location): @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 queue_path(cls, project, location, queue): - """Return a fully-qualified queue string.""" + """DEPRECATED. Return a fully-qualified queue string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/locations/{location}/queues/{queue}", project=project, @@ -109,7 +124,12 @@ def queue_path(cls, project, location, queue): @classmethod def task_path(cls, project, location, queue, task): - """Return a fully-qualified task string.""" + """DEPRECATED. Return a fully-qualified task string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}", project=project, diff --git a/tasks/google/cloud/tasks_v2beta2/gapic/cloud_tasks_client.py b/tasks/google/cloud/tasks_v2beta2/gapic/cloud_tasks_client.py index 651a67a0c228..ca9fb4971da1 100644 --- a/tasks/google/cloud/tasks_v2beta2/gapic/cloud_tasks_client.py +++ b/tasks/google/cloud/tasks_v2beta2/gapic/cloud_tasks_client.py @@ -85,7 +85,12 @@ def from_service_account_file(cls, filename, *args, **kwargs): @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, @@ -94,14 +99,24 @@ def location_path(cls, project, location): @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 queue_path(cls, project, location, queue): - """Return a fully-qualified queue string.""" + """DEPRECATED. Return a fully-qualified queue string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/locations/{location}/queues/{queue}", project=project, @@ -111,7 +126,12 @@ def queue_path(cls, project, location, queue): @classmethod def task_path(cls, project, location, queue, task): - """Return a fully-qualified task string.""" + """DEPRECATED. Return a fully-qualified task string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}", project=project, diff --git a/tasks/google/cloud/tasks_v2beta3/gapic/cloud_tasks_client.py b/tasks/google/cloud/tasks_v2beta3/gapic/cloud_tasks_client.py index b018df9b510e..eb7d82ac5af5 100644 --- a/tasks/google/cloud/tasks_v2beta3/gapic/cloud_tasks_client.py +++ b/tasks/google/cloud/tasks_v2beta3/gapic/cloud_tasks_client.py @@ -83,7 +83,12 @@ def from_service_account_file(cls, filename, *args, **kwargs): @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, @@ -92,14 +97,24 @@ def location_path(cls, project, location): @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 queue_path(cls, project, location, queue): - """Return a fully-qualified queue string.""" + """DEPRECATED. Return a fully-qualified queue string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/locations/{location}/queues/{queue}", project=project, @@ -109,7 +124,12 @@ def queue_path(cls, project, location, queue): @classmethod def task_path(cls, project, location, queue, task): - """Return a fully-qualified task string.""" + """DEPRECATED. Return a fully-qualified task string.""" + warnings.warn( + "Resource name helper functions are deprecated.", + PendingDeprecationWarning, + stacklevel=1, + ) return google.api_core.path_template.expand( "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}", project=project, diff --git a/tasks/synth.metadata b/tasks/synth.metadata index ef9b977ad277..3c5a36c157ea 100644 --- a/tasks/synth.metadata +++ b/tasks/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-11-02T12:36:27.240345Z", + "updateTime": "2019-11-20T13:32:31.947238Z", "sources": [ { "generator": { "name": "artman", - "version": "0.41.0", - "dockerImage": "googleapis/artman@sha256:75b38a3b073a7b243545f2332463096624c802bb1e56b8cb6f22ba1ecd325fa9" + "version": "0.42.1", + "dockerImage": "googleapis/artman@sha256:c773192618c608a7a0415dd95282f841f8e6bcdef7dd760a988c93b77a64bd57" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "aac770126e2def40dcc387f50e8007b21c869e58", - "internalRef": "278016738" + "sha": "16543773103e2619d2b5f52456264de5bb9be104", + "internalRef": "281423227" } }, {