module Google::Cloud::Dialogflow::V2::Fulfillments::Paths

Path helper methods for the Fulfillments API.

Public Instance Methods

fulfillment_path(**args) click to toggle source

Create a fully-qualified Fulfillment resource string.

@overload fulfillment_path(project:)

The resource will be in the following format:

`projects/{project}/agent/fulfillment`

@param project [String]

@overload fulfillment_path(project:, location:)

The resource will be in the following format:

`projects/{project}/locations/{location}/agent/fulfillment`

@param project [String]
@param location [String]

@return [::String]

# File lib/google/cloud/dialogflow/v2/fulfillments/paths.rb, line 46
def fulfillment_path **args
  resources = {
    "project" => (proc do |project:|
      "projects/#{project}/agent/fulfillment"
    end),
    "location:project" => (proc do |project:, location:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

      "projects/#{project}/locations/#{location}/agent/fulfillment"
    end)
  }

  resource = resources[args.keys.sort.join(":")]
  raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
  resource.call(**args)
end