Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit fc06995

Browse files
yoshi-automationtswast
authored andcommitted
fix(bigquery_datatransfer): deprecate resource name helper methods (via synth) (#9829)
1 parent acae17b commit fc06995

File tree

2 files changed

+53
-13
lines changed

2 files changed

+53
-13
lines changed

google/cloud/bigquery_datatransfer_v1/gapic/data_transfer_service_client.py

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9090

9191
@classmethod
9292
def location_path(cls, project, location):
93-
"""Return a fully-qualified location string."""
93+
"""DEPRECATED. Return a fully-qualified location string."""
94+
warnings.warn(
95+
"Resource name helper functions are deprecated.",
96+
PendingDeprecationWarning,
97+
stacklevel=1,
98+
)
9499
return google.api_core.path_template.expand(
95100
"projects/{project}/locations/{location}",
96101
project=project,
@@ -99,7 +104,12 @@ def location_path(cls, project, location):
99104

100105
@classmethod
101106
def location_data_source_path(cls, project, location, data_source):
102-
"""Return a fully-qualified location_data_source string."""
107+
"""DEPRECATED. Return a fully-qualified location_data_source string."""
108+
warnings.warn(
109+
"Resource name helper functions are deprecated.",
110+
PendingDeprecationWarning,
111+
stacklevel=1,
112+
)
103113
return google.api_core.path_template.expand(
104114
"projects/{project}/locations/{location}/dataSources/{data_source}",
105115
project=project,
@@ -109,7 +119,12 @@ def location_data_source_path(cls, project, location, data_source):
109119

110120
@classmethod
111121
def location_run_path(cls, project, location, transfer_config, run):
112-
"""Return a fully-qualified location_run string."""
122+
"""DEPRECATED. Return a fully-qualified location_run string."""
123+
warnings.warn(
124+
"Resource name helper functions are deprecated.",
125+
PendingDeprecationWarning,
126+
stacklevel=1,
127+
)
113128
return google.api_core.path_template.expand(
114129
"projects/{project}/locations/{location}/transferConfigs/{transfer_config}/runs/{run}",
115130
project=project,
@@ -120,7 +135,12 @@ def location_run_path(cls, project, location, transfer_config, run):
120135

121136
@classmethod
122137
def location_transfer_config_path(cls, project, location, transfer_config):
123-
"""Return a fully-qualified location_transfer_config string."""
138+
"""DEPRECATED. Return a fully-qualified location_transfer_config string."""
139+
warnings.warn(
140+
"Resource name helper functions are deprecated.",
141+
PendingDeprecationWarning,
142+
stacklevel=1,
143+
)
124144
return google.api_core.path_template.expand(
125145
"projects/{project}/locations/{location}/transferConfigs/{transfer_config}",
126146
project=project,
@@ -130,14 +150,24 @@ def location_transfer_config_path(cls, project, location, transfer_config):
130150

131151
@classmethod
132152
def project_path(cls, project):
133-
"""Return a fully-qualified project string."""
153+
"""DEPRECATED. Return a fully-qualified project string."""
154+
warnings.warn(
155+
"Resource name helper functions are deprecated.",
156+
PendingDeprecationWarning,
157+
stacklevel=1,
158+
)
134159
return google.api_core.path_template.expand(
135160
"projects/{project}", project=project
136161
)
137162

138163
@classmethod
139164
def project_data_source_path(cls, project, data_source):
140-
"""Return a fully-qualified project_data_source string."""
165+
"""DEPRECATED. Return a fully-qualified project_data_source string."""
166+
warnings.warn(
167+
"Resource name helper functions are deprecated.",
168+
PendingDeprecationWarning,
169+
stacklevel=1,
170+
)
141171
return google.api_core.path_template.expand(
142172
"projects/{project}/dataSources/{data_source}",
143173
project=project,
@@ -146,7 +176,12 @@ def project_data_source_path(cls, project, data_source):
146176

147177
@classmethod
148178
def project_run_path(cls, project, transfer_config, run):
149-
"""Return a fully-qualified project_run string."""
179+
"""DEPRECATED. Return a fully-qualified project_run string."""
180+
warnings.warn(
181+
"Resource name helper functions are deprecated.",
182+
PendingDeprecationWarning,
183+
stacklevel=1,
184+
)
150185
return google.api_core.path_template.expand(
151186
"projects/{project}/transferConfigs/{transfer_config}/runs/{run}",
152187
project=project,
@@ -156,7 +191,12 @@ def project_run_path(cls, project, transfer_config, run):
156191

157192
@classmethod
158193
def project_transfer_config_path(cls, project, transfer_config):
159-
"""Return a fully-qualified project_transfer_config string."""
194+
"""DEPRECATED. Return a fully-qualified project_transfer_config string."""
195+
warnings.warn(
196+
"Resource name helper functions are deprecated.",
197+
PendingDeprecationWarning,
198+
stacklevel=1,
199+
)
160200
return google.api_core.path_template.expand(
161201
"projects/{project}/transferConfigs/{transfer_config}",
162202
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-12T13:16:39.771005Z",
2+
"updateTime": "2019-11-19T13:15:31.582050Z",
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)