Module: Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Paths

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

Overview

Path helper methods for the AssuredWorkloadsService API.

Instance Method Summary collapse

Instance Method Details

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

Create a fully-qualified Location resource string.

The resource will be in the following format:

organizations/{organization}/locations/{location}

Parameters:

  • organization (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

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

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

#violation_path(organization:, location:, workload:, violation:) ⇒ ::String

Create a fully-qualified Violation resource string.

The resource will be in the following format:

organizations/{organization}/locations/{location}/workloads/{workload}/violations/{violation}

Parameters:

  • organization (String)
  • location (String)
  • workload (String)
  • violation (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


57
58
59
60
61
62
63
# File 'lib/google/cloud/assured_workloads/v1/assured_workloads_service/paths.rb', line 57

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

  "organizations/#{organization}/locations/#{location}/workloads/#{workload}/violations/#{violation}"
end

#workload_path(organization:, location:, workload:) ⇒ ::String

Create a fully-qualified Workload resource string.

The resource will be in the following format:

organizations/{organization}/locations/{location}/workloads/{workload}

Parameters:

  • organization (String)
  • location (String)
  • workload (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


77
78
79
80
81
82
# File 'lib/google/cloud/assured_workloads/v1/assured_workloads_service/paths.rb', line 77

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

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