Module: Google::Cloud::Dialogflow::CX::V3::Deployments::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/dialogflow/cx/v3/deployments/paths.rb

Overview

Path helper methods for the Deployments API.

Instance Method Summary collapse

Instance Method Details

#deployment_path(project:, location:, agent:, environment:, deployment:) ⇒ ::String

Create a fully-qualified Deployment resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/agents/{agent}/environments/{environment}/deployments/{deployment}

Parameters:

  • project (String)
  • location (String)
  • agent (String)
  • environment (String)
  • deployment (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


42
43
44
45
46
47
48
49
# File 'lib/google/cloud/dialogflow/cx/v3/deployments/paths.rb', line 42

def deployment_path project:, location:, agent:, environment:, deployment:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "agent cannot contain /" if agent.to_s.include? "/"
  raise ::ArgumentError, "environment cannot contain /" if environment.to_s.include? "/"

  "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}/deployments/#{deployment}"
end

#environment_path(project:, location:, agent:, environment:) ⇒ ::String

Create a fully-qualified Environment resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/agents/{agent}/environments/{environment}

Parameters:

  • project (String)
  • location (String)
  • agent (String)
  • environment (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


64
65
66
67
68
69
70
# File 'lib/google/cloud/dialogflow/cx/v3/deployments/paths.rb', line 64

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

  "projects/#{project}/locations/#{location}/agents/#{agent}/environments/#{environment}"
end