Module: Google::Cloud::Dialogflow::V2::ConversationModels::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/dialogflow/v2/conversation_models/paths.rb

Overview

Path helper methods for the ConversationModels API.

Instance Method Summary collapse

Instance Method Details

#conversation_dataset_path(project:, location:, conversation_dataset:) ⇒ ::String

Create a fully-qualified ConversationDataset resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/conversationDatasets/{conversation_dataset}

Parameters:

  • project (String)
  • location (String)
  • conversation_dataset (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


39
40
41
42
43
44
# File 'lib/google/cloud/dialogflow/v2/conversation_models/paths.rb', line 39

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

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

#conversation_model_evaluation_path(project: , conversation_model: , evaluation: ) ⇒ ::String #conversation_model_evaluation_path(project: , location: , conversation_model: , evaluation: ) ⇒ ::String

Create a fully-qualified ConversationModelEvaluation resource string.

Overloads:

  • #conversation_model_evaluation_path(project: , conversation_model: , evaluation: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/conversationModels/{conversation_model}/evaluations/{evaluation}

    Parameters:

    • project (String) (defaults to: )
    • conversation_model (String) (defaults to: )
    • evaluation (String) (defaults to: )
  • #conversation_model_evaluation_path(project: , location: , conversation_model: , evaluation: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/conversationModels/{conversation_model}/evaluations/{evaluation}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • conversation_model (String) (defaults to: )
    • evaluation (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/google/cloud/dialogflow/v2/conversation_models/paths.rb', line 110

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

      "projects/#{project}/conversationModels/#{conversation_model}/evaluations/#{evaluation}"
    end),
    "conversation_model:evaluation:location:project" => (proc do |project:, location:, conversation_model:, evaluation:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "conversation_model cannot contain /" if conversation_model.to_s.include? "/"

      "projects/#{project}/locations/#{location}/conversationModels/#{conversation_model}/evaluations/#{evaluation}"
    end)
  }

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

#conversation_model_path(project: , location: , conversation_model: ) ⇒ ::String #conversation_model_path(project: , conversation_model: ) ⇒ ::String

Create a fully-qualified ConversationModel resource string.

Overloads:

  • #conversation_model_path(project: , location: , conversation_model: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/conversationModels/{conversation_model}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • conversation_model (String) (defaults to: )
  • #conversation_model_path(project: , conversation_model: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/conversationModels/{conversation_model}

    Parameters:

    • project (String) (defaults to: )
    • conversation_model (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/google/cloud/dialogflow/v2/conversation_models/paths.rb', line 67

def conversation_model_path **args
  resources = {
    "conversation_model:location:project" => (proc do |project:, location:, conversation_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}/conversationModels/#{conversation_model}"
    end),
    "conversation_model:project" => (proc do |project:, conversation_model:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

      "projects/#{project}/conversationModels/#{conversation_model}"
    end)
  }

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

#document_path(project: , knowledge_base: , document: ) ⇒ ::String #document_path(project: , location: , knowledge_base: , document: ) ⇒ ::String

Create a fully-qualified Document resource string.

Overloads:

  • #document_path(project: , knowledge_base: , document: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}

    Parameters:

    • project (String) (defaults to: )
    • knowledge_base (String) (defaults to: )
    • document (String) (defaults to: )
  • #document_path(project: , location: , knowledge_base: , document: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • knowledge_base (String) (defaults to: )
    • document (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/google/cloud/dialogflow/v2/conversation_models/paths.rb', line 155

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

      "projects/#{project}/knowledgeBases/#{knowledge_base}/documents/#{document}"
    end),
    "document:knowledge_base:location:project" => (proc do |project:, location:, knowledge_base:, document:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "knowledge_base cannot contain /" if knowledge_base.to_s.include? "/"

      "projects/#{project}/locations/#{location}/knowledgeBases/#{knowledge_base}/documents/#{document}"
    end)
  }

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