Skip to content

Commit fe9deb1

Browse files
yoshi-automationtswast
authored andcommitted
fix(datacatalog): deprecate resource name helper methods (via synth) (#9831)
1 parent 37f0677 commit fe9deb1

File tree

2 files changed

+43
-13
lines changed

2 files changed

+43
-13
lines changed

datacatalog/google/cloud/datacatalog_v1beta1/gapic/data_catalog_client.py

+36-6
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8787

8888
@classmethod
8989
def entry_path(cls, project, location, entry_group, entry):
90-
"""Return a fully-qualified entry string."""
90+
"""DEPRECATED. Return a fully-qualified entry string."""
91+
warnings.warn(
92+
"Resource name helper functions are deprecated.",
93+
PendingDeprecationWarning,
94+
stacklevel=1,
95+
)
9196
return google.api_core.path_template.expand(
9297
"projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}",
9398
project=project,
@@ -98,7 +103,12 @@ def entry_path(cls, project, location, entry_group, entry):
98103

99104
@classmethod
100105
def entry_group_path(cls, project, location, entry_group):
101-
"""Return a fully-qualified entry_group string."""
106+
"""DEPRECATED. Return a fully-qualified entry_group string."""
107+
warnings.warn(
108+
"Resource name helper functions are deprecated.",
109+
PendingDeprecationWarning,
110+
stacklevel=1,
111+
)
102112
return google.api_core.path_template.expand(
103113
"projects/{project}/locations/{location}/entryGroups/{entry_group}",
104114
project=project,
@@ -108,7 +118,12 @@ def entry_group_path(cls, project, location, entry_group):
108118

109119
@classmethod
110120
def field_path(cls, project, location, tag_template, field):
111-
"""Return a fully-qualified field string."""
121+
"""DEPRECATED. Return a fully-qualified field string."""
122+
warnings.warn(
123+
"Resource name helper functions are deprecated.",
124+
PendingDeprecationWarning,
125+
stacklevel=1,
126+
)
112127
return google.api_core.path_template.expand(
113128
"projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}",
114129
project=project,
@@ -119,7 +134,12 @@ def field_path(cls, project, location, tag_template, field):
119134

120135
@classmethod
121136
def location_path(cls, project, location):
122-
"""Return a fully-qualified location string."""
137+
"""DEPRECATED. Return a fully-qualified location string."""
138+
warnings.warn(
139+
"Resource name helper functions are deprecated.",
140+
PendingDeprecationWarning,
141+
stacklevel=1,
142+
)
123143
return google.api_core.path_template.expand(
124144
"projects/{project}/locations/{location}",
125145
project=project,
@@ -128,7 +148,12 @@ def location_path(cls, project, location):
128148

129149
@classmethod
130150
def tag_path(cls, project, location, entry_group, entry, tag):
131-
"""Return a fully-qualified tag string."""
151+
"""DEPRECATED. Return a fully-qualified tag string."""
152+
warnings.warn(
153+
"Resource name helper functions are deprecated.",
154+
PendingDeprecationWarning,
155+
stacklevel=1,
156+
)
132157
return google.api_core.path_template.expand(
133158
"projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}",
134159
project=project,
@@ -140,7 +165,12 @@ def tag_path(cls, project, location, entry_group, entry, tag):
140165

141166
@classmethod
142167
def tag_template_path(cls, project, location, tag_template):
143-
"""Return a fully-qualified tag_template string."""
168+
"""DEPRECATED. Return a fully-qualified tag_template string."""
169+
warnings.warn(
170+
"Resource name helper functions are deprecated.",
171+
PendingDeprecationWarning,
172+
stacklevel=1,
173+
)
144174
return google.api_core.path_template.expand(
145175
"projects/{project}/locations/{location}/tagTemplates/{tag_template}",
146176
project=project,

datacatalog/synth.metadata

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"updateTime": "2019-11-14T18:45:51.389155Z",
2+
"updateTime": "2019-11-19T13:19:24.305834Z",
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",
14-
"remote": "git@github.com:googleapis/googleapis.git",
15-
"sha": "1935fb8889686f5c9d107f11b3c6870fc3aa7cdc",
16-
"internalRef": "280451656"
14+
"remote": "https://github.com/googleapis/googleapis.git",
15+
"sha": "d8dd7fe8d5304f7bd1c52207703d7f27d5328c5a",
16+
"internalRef": "281088257"
1717
}
1818
},
1919
{
2020
"template": {
2121
"name": "python_library",
2222
"origin": "synthtool.gcp",
23-
"version": "2019.5.2"
23+
"version": "2019.10.17"
2424
}
2525
}
2626
],

0 commit comments

Comments
 (0)