Module: Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Paths

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

Overview

Path helper methods for the ConversationalSearchService API.

Instance Method Summary collapse

Instance Method Details

#conversation_path(project: , location: , data_store: , conversation: ) ⇒ ::String #conversation_path(project: , location: , collection: , data_store: , conversation: ) ⇒ ::String #conversation_path(project: , location: , collection: , engine: , conversation: ) ⇒ ::String

Create a fully-qualified Conversation resource string.

Overloads:

  • #conversation_path(project: , location: , data_store: , conversation: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • data_store (String) (defaults to: )
    • conversation (String) (defaults to: )
  • #conversation_path(project: , location: , collection: , data_store: , conversation: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • collection (String) (defaults to: )
    • data_store (String) (defaults to: )
    • conversation (String) (defaults to: )
  • #conversation_path(project: , location: , collection: , engine: , conversation: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/conversations/{conversation}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • collection (String) (defaults to: )
    • engine (String) (defaults to: )
    • conversation (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb', line 63

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

      "projects/#{project}/locations/#{location}/dataStores/#{data_store}/conversations/#{conversation}"
    end),
    "collection:conversation:data_store:location:project" => (proc do |project:, location:, collection:, data_store:, conversation:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
      raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/"

      "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/conversations/#{conversation}"
    end),
    "collection:conversation:engine:location:project" => (proc do |project:, location:, collection:, engine:, conversation:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
      raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/"

      "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/conversations/#{conversation}"
    end)
  }

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

#data_store_path(project: , location: , data_store: ) ⇒ ::String #data_store_path(project: , location: , collection: , data_store: ) ⇒ ::String

Create a fully-qualified DataStore resource string.

Overloads:

  • #data_store_path(project: , location: , data_store: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/dataStores/{data_store}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • data_store (String) (defaults to: )
  • #data_store_path(project: , location: , collection: , data_store: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • collection (String) (defaults to: )
    • data_store (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb', line 118

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

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

      "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}"
    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: , location: , data_store: , branch: , document: ) ⇒ ::String #document_path(project: , location: , collection: , data_store: , branch: , document: ) ⇒ ::String

Create a fully-qualified Document resource string.

Overloads:

  • #document_path(project: , location: , data_store: , branch: , document: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • data_store (String) (defaults to: )
    • branch (String) (defaults to: )
    • document (String) (defaults to: )
  • #document_path(project: , location: , collection: , data_store: , branch: , document: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • collection (String) (defaults to: )
    • data_store (String) (defaults to: )
    • branch (String) (defaults to: )
    • document (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb', line 167

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

      "projects/#{project}/locations/#{location}/dataStores/#{data_store}/branches/#{branch}/documents/#{document}"
    end),
    "branch:collection:data_store:document:location:project" => (proc do |project:, location:, collection:, data_store:, branch:, document:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
      raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/"
      raise ::ArgumentError, "branch cannot contain /" if branch.to_s.include? "/"

      "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/branches/#{branch}/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

#serving_config_path(project: , location: , data_store: , serving_config: ) ⇒ ::String #serving_config_path(project: , location: , collection: , data_store: , serving_config: ) ⇒ ::String #serving_config_path(project: , location: , collection: , engine: , serving_config: ) ⇒ ::String

Create a fully-qualified ServingConfig resource string.

Overloads:

  • #serving_config_path(project: , location: , data_store: , serving_config: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • data_store (String) (defaults to: )
    • serving_config (String) (defaults to: )
  • #serving_config_path(project: , location: , collection: , data_store: , serving_config: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • collection (String) (defaults to: )
    • data_store (String) (defaults to: )
    • serving_config (String) (defaults to: )
  • #serving_config_path(project: , location: , collection: , engine: , serving_config: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • collection (String) (defaults to: )
    • engine (String) (defaults to: )
    • serving_config (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
# File 'lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb', line 229

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

      "projects/#{project}/locations/#{location}/dataStores/#{data_store}/servingConfigs/#{serving_config}"
    end),
    "collection:data_store:location:project:serving_config" => (proc do |project:, location:, collection:, data_store:, serving_config:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
      raise ::ArgumentError, "data_store cannot contain /" if data_store.to_s.include? "/"

      "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}/servingConfigs/#{serving_config}"
    end),
    "collection:engine:location:project:serving_config" => (proc do |project:, location:, collection:, engine:, serving_config:|
      raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
      raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
      raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
      raise ::ArgumentError, "engine cannot contain /" if engine.to_s.include? "/"

      "projects/#{project}/locations/#{location}/collections/#{collection}/engines/#{engine}/servingConfigs/#{serving_config}"
    end)
  }

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