Module: Google::Cloud::AIPlatform::V1::ModelService::Paths

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

Overview

Path helper methods for the ModelService API.

Instance Method Summary collapse

Instance Method Details

#endpoint_path(project: , location: , endpoint: ) ⇒ ::String #endpoint_path(project: , location: , publisher: , model: ) ⇒ ::String

Create a fully-qualified Endpoint resource string.

Overloads:

  • #endpoint_path(project: , location: , endpoint: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/endpoints/{endpoint}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • endpoint (String) (defaults to: )
  • #endpoint_path(project: , location: , publisher: , model: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/publishers/{publisher}/models/{model}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • publisher (String) (defaults to: )
    • model (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

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

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

      "projects/#{project}/locations/#{location}/publishers/#{publisher}/models/#{model}"
    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)


83
84
85
86
87
# File 'lib/google/cloud/ai_platform/v1/model_service/paths.rb', line 83

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

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

#model_evaluation_path(project:, location:, model:, evaluation:) ⇒ ::String

Create a fully-qualified ModelEvaluation resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}

Parameters:

  • project (String)
  • location (String)
  • model (String)
  • evaluation (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


121
122
123
124
125
126
127
# File 'lib/google/cloud/ai_platform/v1/model_service/paths.rb', line 121

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

  "projects/#{project}/locations/#{location}/models/#{model}/evaluations/#{evaluation}"
end

#model_evaluation_slice_path(project:, location:, model:, evaluation:, slice:) ⇒ ::String

Create a fully-qualified ModelEvaluationSlice resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}

Parameters:

  • project (String)
  • location (String)
  • model (String)
  • evaluation (String)
  • slice (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


143
144
145
146
147
148
149
150
# File 'lib/google/cloud/ai_platform/v1/model_service/paths.rb', line 143

def model_evaluation_slice_path project:, location:, model:, evaluation:, slice:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "model cannot contain /" if model.to_s.include? "/"
  raise ::ArgumentError, "evaluation cannot contain /" if evaluation.to_s.include? "/"

  "projects/#{project}/locations/#{location}/models/#{model}/evaluations/#{evaluation}/slices/#{slice}"
end

#model_path(project:, location:, model:) ⇒ ::String

Create a fully-qualified Model resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/models/{model}

Parameters:

  • project (String)
  • location (String)
  • model (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


101
102
103
104
105
106
# File 'lib/google/cloud/ai_platform/v1/model_service/paths.rb', line 101

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

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

#pipeline_job_path(project:, location:, pipeline_job:) ⇒ ::String

Create a fully-qualified PipelineJob resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}

Parameters:

  • project (String)
  • location (String)
  • pipeline_job (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


164
165
166
167
168
169
# File 'lib/google/cloud/ai_platform/v1/model_service/paths.rb', line 164

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

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

#training_pipeline_path(project:, location:, training_pipeline:) ⇒ ::String

Create a fully-qualified TrainingPipeline resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}

Parameters:

  • project (String)
  • location (String)
  • training_pipeline (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


183
184
185
186
187
188
# File 'lib/google/cloud/ai_platform/v1/model_service/paths.rb', line 183

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

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