Module: Google::Cloud::CloudSecurityCompliance::V1::Audit::Paths

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

Overview

Path helper methods for the Audit API.

Instance Method Summary collapse

Instance Method Details

#framework_audit_path(project:, location:, framework_audit:) ⇒ ::String #framework_audit_path(organization:, location:, framework_audit:) ⇒ ::String

Create a fully-qualified FrameworkAudit resource string.

Overloads:

  • #framework_audit_path(project:, location:, framework_audit:) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/frameworkAudits/{framework_audit}

    Parameters:

    • project (String)
    • location (String)
    • framework_audit (String)
  • #framework_audit_path(organization:, location:, framework_audit:) ⇒ ::String

    The resource will be in the following format:

    organizations/{organization}/locations/{location}/frameworkAudits/{framework_audit}

    Parameters:

    • organization (String)
    • location (String)
    • framework_audit (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/google/cloud/cloud_security_compliance/v1/audit/paths.rb', line 49

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

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

      "organizations/#{organization}/locations/#{location}/frameworkAudits/#{framework_audit}"
    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)


81
82
83
84
85
# File 'lib/google/cloud/cloud_security_compliance/v1/audit/paths.rb', line 81

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)


98
99
100
101
102
# File 'lib/google/cloud/cloud_security_compliance/v1/audit/paths.rb', line 98

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

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