Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit ccf2cab

Browse files
yoshi-automationbusunkim96
authored andcommitted
fix(tasks): deprecate resource name helper methods (via synth) (#9864)
1 parent c1dd3ce commit ccf2cab

File tree

6 files changed

+79
-18
lines changed

6 files changed

+79
-18
lines changed

docs/_static/custom.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
div#python2-eol {
22
border-color: red;
33
border-width: medium;
4-
}
4+
}

docs/_templates/layout.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
{% extends "!layout.html" %}
23
{%- block content %}
34
{%- if theme_fixed_sidebar|lower == 'true' %}

google/cloud/tasks_v2/gapic/cloud_tasks_client.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8383

8484
@classmethod
8585
def location_path(cls, project, location):
86-
"""Return a fully-qualified location string."""
86+
"""DEPRECATED. Return a fully-qualified location string."""
87+
warnings.warn(
88+
"Resource name helper functions are deprecated.",
89+
PendingDeprecationWarning,
90+
stacklevel=1,
91+
)
8792
return google.api_core.path_template.expand(
8893
"projects/{project}/locations/{location}",
8994
project=project,
@@ -92,14 +97,24 @@ def location_path(cls, project, location):
9297

9398
@classmethod
9499
def project_path(cls, project):
95-
"""Return a fully-qualified project string."""
100+
"""DEPRECATED. Return a fully-qualified project string."""
101+
warnings.warn(
102+
"Resource name helper functions are deprecated.",
103+
PendingDeprecationWarning,
104+
stacklevel=1,
105+
)
96106
return google.api_core.path_template.expand(
97107
"projects/{project}", project=project
98108
)
99109

100110
@classmethod
101111
def queue_path(cls, project, location, queue):
102-
"""Return a fully-qualified queue string."""
112+
"""DEPRECATED. Return a fully-qualified queue string."""
113+
warnings.warn(
114+
"Resource name helper functions are deprecated.",
115+
PendingDeprecationWarning,
116+
stacklevel=1,
117+
)
103118
return google.api_core.path_template.expand(
104119
"projects/{project}/locations/{location}/queues/{queue}",
105120
project=project,
@@ -109,7 +124,12 @@ def queue_path(cls, project, location, queue):
109124

110125
@classmethod
111126
def task_path(cls, project, location, queue, task):
112-
"""Return a fully-qualified task string."""
127+
"""DEPRECATED. Return a fully-qualified task string."""
128+
warnings.warn(
129+
"Resource name helper functions are deprecated.",
130+
PendingDeprecationWarning,
131+
stacklevel=1,
132+
)
113133
return google.api_core.path_template.expand(
114134
"projects/{project}/locations/{location}/queues/{queue}/tasks/{task}",
115135
project=project,

google/cloud/tasks_v2beta2/gapic/cloud_tasks_client.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8585

8686
@classmethod
8787
def location_path(cls, project, location):
88-
"""Return a fully-qualified location string."""
88+
"""DEPRECATED. Return a fully-qualified location string."""
89+
warnings.warn(
90+
"Resource name helper functions are deprecated.",
91+
PendingDeprecationWarning,
92+
stacklevel=1,
93+
)
8994
return google.api_core.path_template.expand(
9095
"projects/{project}/locations/{location}",
9196
project=project,
@@ -94,14 +99,24 @@ def location_path(cls, project, location):
9499

95100
@classmethod
96101
def project_path(cls, project):
97-
"""Return a fully-qualified project string."""
102+
"""DEPRECATED. Return a fully-qualified project string."""
103+
warnings.warn(
104+
"Resource name helper functions are deprecated.",
105+
PendingDeprecationWarning,
106+
stacklevel=1,
107+
)
98108
return google.api_core.path_template.expand(
99109
"projects/{project}", project=project
100110
)
101111

102112
@classmethod
103113
def queue_path(cls, project, location, queue):
104-
"""Return a fully-qualified queue string."""
114+
"""DEPRECATED. Return a fully-qualified queue string."""
115+
warnings.warn(
116+
"Resource name helper functions are deprecated.",
117+
PendingDeprecationWarning,
118+
stacklevel=1,
119+
)
105120
return google.api_core.path_template.expand(
106121
"projects/{project}/locations/{location}/queues/{queue}",
107122
project=project,
@@ -111,7 +126,12 @@ def queue_path(cls, project, location, queue):
111126

112127
@classmethod
113128
def task_path(cls, project, location, queue, task):
114-
"""Return a fully-qualified task string."""
129+
"""DEPRECATED. Return a fully-qualified task string."""
130+
warnings.warn(
131+
"Resource name helper functions are deprecated.",
132+
PendingDeprecationWarning,
133+
stacklevel=1,
134+
)
115135
return google.api_core.path_template.expand(
116136
"projects/{project}/locations/{location}/queues/{queue}/tasks/{task}",
117137
project=project,

google/cloud/tasks_v2beta3/gapic/cloud_tasks_client.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8383

8484
@classmethod
8585
def location_path(cls, project, location):
86-
"""Return a fully-qualified location string."""
86+
"""DEPRECATED. Return a fully-qualified location string."""
87+
warnings.warn(
88+
"Resource name helper functions are deprecated.",
89+
PendingDeprecationWarning,
90+
stacklevel=1,
91+
)
8792
return google.api_core.path_template.expand(
8893
"projects/{project}/locations/{location}",
8994
project=project,
@@ -92,14 +97,24 @@ def location_path(cls, project, location):
9297

9398
@classmethod
9499
def project_path(cls, project):
95-
"""Return a fully-qualified project string."""
100+
"""DEPRECATED. Return a fully-qualified project string."""
101+
warnings.warn(
102+
"Resource name helper functions are deprecated.",
103+
PendingDeprecationWarning,
104+
stacklevel=1,
105+
)
96106
return google.api_core.path_template.expand(
97107
"projects/{project}", project=project
98108
)
99109

100110
@classmethod
101111
def queue_path(cls, project, location, queue):
102-
"""Return a fully-qualified queue string."""
112+
"""DEPRECATED. Return a fully-qualified queue string."""
113+
warnings.warn(
114+
"Resource name helper functions are deprecated.",
115+
PendingDeprecationWarning,
116+
stacklevel=1,
117+
)
103118
return google.api_core.path_template.expand(
104119
"projects/{project}/locations/{location}/queues/{queue}",
105120
project=project,
@@ -109,7 +124,12 @@ def queue_path(cls, project, location, queue):
109124

110125
@classmethod
111126
def task_path(cls, project, location, queue, task):
112-
"""Return a fully-qualified task string."""
127+
"""DEPRECATED. Return a fully-qualified task string."""
128+
warnings.warn(
129+
"Resource name helper functions are deprecated.",
130+
PendingDeprecationWarning,
131+
stacklevel=1,
132+
)
113133
return google.api_core.path_template.expand(
114134
"projects/{project}/locations/{location}/queues/{queue}/tasks/{task}",
115135
project=project,

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-02T12:36:27.240345Z",
2+
"updateTime": "2019-11-20T13:32:31.947238Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.41.0",
8-
"dockerImage": "googleapis/artman@sha256:75b38a3b073a7b243545f2332463096624c802bb1e56b8cb6f22ba1ecd325fa9"
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": "aac770126e2def40dcc387f50e8007b21c869e58",
16-
"internalRef": "278016738"
15+
"sha": "16543773103e2619d2b5f52456264de5bb9be104",
16+
"internalRef": "281423227"
1717
}
1818
},
1919
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy