Module: Google::Cloud::AIPlatform::V1::ModelGardenService::Paths

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

Overview

Path helper methods for the ModelGardenService API.

Instance Method Summary collapse

Instance Method Details

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


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

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

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

#publisher_model_path(publisher:, model:) ⇒ ::String

Create a fully-qualified PublisherModel resource string.

The resource will be in the following format:

publishers/{publisher}/models/{model}

Parameters:

  • publisher (String)
  • model (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


55
56
57
58
59
# File 'lib/google/cloud/ai_platform/v1/model_garden_service/paths.rb', line 55

def publisher_model_path publisher:, model:
  raise ::ArgumentError, "publisher cannot contain /" if publisher.to_s.include? "/"

  "publishers/#{publisher}/models/#{model}"
end

#reservation_path(project_id_or_number:, zone:, reservation_name:) ⇒ ::String

Create a fully-qualified Reservation resource string.

The resource will be in the following format:

projects/{project_id_or_number}/zones/{zone}/reservations/{reservation_name}

Parameters:

  • project_id_or_number (String)
  • zone (String)
  • reservation_name (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


73
74
75
76
77
78
# File 'lib/google/cloud/ai_platform/v1/model_garden_service/paths.rb', line 73

def reservation_path project_id_or_number:, zone:, reservation_name:
  raise ::ArgumentError, "project_id_or_number cannot contain /" if project_id_or_number.to_s.include? "/"
  raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/"

  "projects/#{project_id_or_number}/zones/#{zone}/reservations/#{reservation_name}"
end