Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(websecurityscanner): deprecate resource name helper methods (via synth) #9847

Merged
merged 1 commit into from
Nov 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def finding_path(cls, project, scan_config, scan_run, finding):
"""Return a fully-qualified finding string."""
"""DEPRECATED. Return a fully-qualified finding string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}",
project=project,
Expand All @@ -99,14 +104,24 @@ def finding_path(cls, project, scan_config, scan_run, finding):

@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 scan_config_path(cls, project, scan_config):
"""Return a fully-qualified scan_config string."""
"""DEPRECATED. Return a fully-qualified scan_config string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/scanConfigs/{scan_config}",
project=project,
Expand All @@ -115,7 +130,12 @@ def scan_config_path(cls, project, scan_config):

@classmethod
def scan_run_path(cls, project, scan_config, scan_run):
"""Return a fully-qualified scan_run string."""
"""DEPRECATED. Return a fully-qualified scan_run string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}",
project=project,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def finding_path(cls, project, scan_config, scan_run, finding):
"""Return a fully-qualified finding string."""
"""DEPRECATED. Return a fully-qualified finding string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}",
project=project,
Expand All @@ -99,14 +104,24 @@ def finding_path(cls, project, scan_config, scan_run, finding):

@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 scan_config_path(cls, project, scan_config):
"""Return a fully-qualified scan_config string."""
"""DEPRECATED. Return a fully-qualified scan_config string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/scanConfigs/{scan_config}",
project=project,
Expand All @@ -115,7 +130,12 @@ def scan_config_path(cls, project, scan_config):

@classmethod
def scan_run_path(cls, project, scan_config, scan_run):
"""Return a fully-qualified scan_run string."""
"""DEPRECATED. Return a fully-qualified scan_run string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}",
project=project,
Expand Down
10 changes: 5 additions & 5 deletions websecurityscanner/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-11-12T13:50:44.560572Z",
"updateTime": "2019-11-19T13:40:31.270113Z",
"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": "https://github.com/googleapis/googleapis.git",
"sha": "f69562be0608904932bdcfbc5ad8b9a22d9dceb8",
"internalRef": "279774957"
"sha": "d8dd7fe8d5304f7bd1c52207703d7f27d5328c5a",
"internalRef": "281088257"
}
},
{
Expand Down