Module: Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/paths.rb

Overview

Path helper methods for the WebSecurityScanner API.

Instance Method Summary collapse

Instance Method Details

#finding_path(project:, scan_config:, scan_run:, finding:) ⇒ ::String

Create a fully-qualified Finding resource string.

The resource will be in the following format:

projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}

Parameters:

  • project (String)
  • scan_config (String)
  • scan_run (String)
  • finding (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


40
41
42
43
44
45
46
# File 'lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/paths.rb', line 40

def finding_path project:, scan_config:, scan_run:, finding:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "scan_config cannot contain /" if scan_config.to_s.include? "/"
  raise ::ArgumentError, "scan_run cannot contain /" if scan_run.to_s.include? "/"

  "projects/#{project}/scanConfigs/#{scan_config}/scanRuns/#{scan_run}/findings/#{finding}"
end

#project_path(project:) ⇒ ::String

Create a fully-qualified Project resource string.

The resource will be in the following format:

projects/{project}

Parameters:

  • project (String)

Returns:

  • (::String)


58
59
60
# File 'lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/paths.rb', line 58

def project_path project:
  "projects/#{project}"
end

#scan_config_path(project:, scan_config:) ⇒ ::String

Create a fully-qualified ScanConfig resource string.

The resource will be in the following format:

projects/{project}/scanConfigs/{scan_config}

Parameters:

  • project (String)
  • scan_config (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


73
74
75
76
77
# File 'lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/paths.rb', line 73

def scan_config_path project:, scan_config:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/scanConfigs/#{scan_config}"
end

#scan_run_path(project:, scan_config:, scan_run:) ⇒ ::String

Create a fully-qualified ScanRun resource string.

The resource will be in the following format:

projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}

Parameters:

  • project (String)
  • scan_config (String)
  • scan_run (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


91
92
93
94
95
96
# File 'lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/paths.rb', line 91

def scan_run_path project:, scan_config:, scan_run:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "scan_config cannot contain /" if scan_config.to_s.include? "/"

  "projects/#{project}/scanConfigs/#{scan_config}/scanRuns/#{scan_run}"
end