Module: Google::Cloud::Iot::V1::DeviceManager::Paths

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

Overview

Path helper methods for the DeviceManager API.

Instance Method Summary collapse

Instance Method Details

#device_path(project:, location:, registry:, device:) ⇒ ::String

Create a fully-qualified Device resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/registries/{registry}/devices/{device}

Parameters:

  • project (String)
  • location (String)
  • registry (String)
  • device (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


40
41
42
43
44
45
46
# File 'lib/google/cloud/iot/v1/device_manager/paths.rb', line 40

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

  "projects/#{project}/locations/#{location}/registries/#{registry}/devices/#{device}"
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)


59
60
61
62
63
# File 'lib/google/cloud/iot/v1/device_manager/paths.rb', line 59

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

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

#registry_path(project:, location:, registry:) ⇒ ::String

Create a fully-qualified Registry resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/registries/{registry}

Parameters:

  • project (String)
  • location (String)
  • registry (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

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

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