Module: Google::Cloud::CloudSecurityCompliance::V1::Monitoring::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/cloud_security_compliance/v1/monitoring/paths.rb

Overview

Path helper methods for the Monitoring API.

Instance Method Summary collapse

Instance Method Details

#folder_location_path(folder:, location:) ⇒ ::String

Create a fully-qualified FolderLocation resource string.

The resource will be in the following format:

folders/{folder}/locations/{location}

Parameters:

  • folder (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


38
39
40
41
42
# File 'lib/google/cloud/cloud_security_compliance/v1/monitoring/paths.rb', line 38

def folder_location_path folder:, location:
  raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"

  "folders/#{folder}/locations/#{location}"
end

#framework_compliance_report_path(project:, location:, framework_compliance_report:) ⇒ ::String #framework_compliance_report_path(folder:, location:, framework_compliance_report:) ⇒ ::String #framework_compliance_report_path(organization:, location:, framework_compliance_report:) ⇒ ::String

Create a fully-qualified FrameworkComplianceReport resource string.

Overloads:

  • #framework_compliance_report_path(project:, location:, framework_compliance_report:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/frameworkComplianceReports/{framework_compliance_report}

    Parameters:

    • project (String)
    • location (String)
    • framework_compliance_report (String)
  • #framework_compliance_report_path(folder:, location:, framework_compliance_report:) ⇒ ::String

    The resource will be in the following format:

    folders/{folder}/locations/{location}/frameworkComplianceReports/{framework_compliance_report}

    Parameters:

    • folder (String)
    • location (String)
    • framework_compliance_report (String)
  • #framework_compliance_report_path(organization:, location:, framework_compliance_report:) ⇒ ::String

    The resource will be in the following format:

    organizations/{organization}/locations/{location}/frameworkComplianceReports/{framework_compliance_report}

    Parameters:

    • organization (String)
    • location (String)
    • framework_compliance_report (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/google/cloud/cloud_security_compliance/v1/monitoring/paths.rb', line 75

def framework_compliance_report_path **args
  resources = {
    "framework_compliance_report:location:project" => (proc do |project:, location:, framework_compliance_report:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

      "projects/#{project}/locations/#{location}/frameworkComplianceReports/#{framework_compliance_report}"
    end),
    "folder:framework_compliance_report:location" => (proc do |folder:, location:, framework_compliance_report:|
      raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

      "folders/#{folder}/locations/#{location}/frameworkComplianceReports/#{framework_compliance_report}"
    end),
    "framework_compliance_report:location:organization" => (proc do |organization:, location:, framework_compliance_report:|
      raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"

      "organizations/#{organization}/locations/#{location}/frameworkComplianceReports/#{framework_compliance_report}"
    end)
  }

  resource = resources[args.keys.sort.join(":")]
  raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
  resource.call(**args)
end

#location_path(project:, location:) ⇒ ::String

Create a fully-qualified Location resource string.

The resource will be in the following format:

projects/{project}/locations/{location}

Parameters:

  • project (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


113
114
115
116
117
# File 'lib/google/cloud/cloud_security_compliance/v1/monitoring/paths.rb', line 113

def location_path project:, location:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/locations/#{location}"
end

#organization_location_path(organization:, location:) ⇒ ::String

Create a fully-qualified OrganizationLocation resource string.

The resource will be in the following format:

organizations/{organization}/locations/{location}

Parameters:

  • organization (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


130
131
132
133
134
# File 'lib/google/cloud/cloud_security_compliance/v1/monitoring/paths.rb', line 130

def organization_location_path organization:, location:
  raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"

  "organizations/#{organization}/locations/#{location}"
end