Module: Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/assured_workloads/v1beta1/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/v1beta1/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

#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)


56
57
58
59
60
61
# File 'lib/google/cloud/assured_workloads/v1beta1/assured_workloads_service/paths.rb', line 56

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