Skip to content

Commit

Permalink
fix(datacatalog): deprecate resource name helper methods (via synth) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and tswast committed Dec 23, 2019
1 parent 37f0677 commit fe9deb1
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def entry_path(cls, project, location, entry_group, entry):
"""Return a fully-qualified entry string."""
"""DEPRECATED. Return a fully-qualified entry string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/entryGroups/{entry_group}/entries/{entry}",
project=project,
Expand All @@ -98,7 +103,12 @@ def entry_path(cls, project, location, entry_group, entry):

@classmethod
def entry_group_path(cls, project, location, entry_group):
"""Return a fully-qualified entry_group string."""
"""DEPRECATED. Return a fully-qualified entry_group string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/entryGroups/{entry_group}",
project=project,
Expand All @@ -108,7 +118,12 @@ def entry_group_path(cls, project, location, entry_group):

@classmethod
def field_path(cls, project, location, tag_template, field):
"""Return a fully-qualified field string."""
"""DEPRECATED. Return a fully-qualified field string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/tagTemplates/{tag_template}/fields/{field}",
project=project,
Expand All @@ -119,7 +134,12 @@ def field_path(cls, project, location, tag_template, field):

@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,
Expand All @@ -128,7 +148,12 @@ def location_path(cls, project, location):

@classmethod
def tag_path(cls, project, location, entry_group, entry, 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}/locations/{location}/entryGroups/{entry_group}/entries/{entry}/tags/{tag}",
project=project,
Expand All @@ -140,7 +165,12 @@ def tag_path(cls, project, location, entry_group, entry, tag):

@classmethod
def tag_template_path(cls, project, location, tag_template):
"""Return a fully-qualified tag_template string."""
"""DEPRECATED. Return a fully-qualified tag_template string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/tagTemplates/{tag_template}",
project=project,
Expand Down
14 changes: 7 additions & 7 deletions datacatalog/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"updateTime": "2019-11-14T18:45:51.389155Z",
"updateTime": "2019-11-19T13:19:24.305834Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.41.1",
"dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e"
"version": "0.42.1",
"dockerImage": "googleapis/artman@sha256:c773192618c608a7a0415dd95282f841f8e6bcdef7dd760a988c93b77a64bd57"
}
},
{
"git": {
"name": "googleapis",
"remote": "git@github.com:googleapis/googleapis.git",
"sha": "1935fb8889686f5c9d107f11b3c6870fc3aa7cdc",
"internalRef": "280451656"
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "d8dd7fe8d5304f7bd1c52207703d7f27d5328c5a",
"internalRef": "281088257"
}
},
{
"template": {
"name": "python_library",
"origin": "synthtool.gcp",
"version": "2019.5.2"
"version": "2019.10.17"
}
}
],
Expand Down

0 comments on commit fe9deb1

Please sign in to comment.