Module: Google::Cloud::DiscoveryEngine::V1::DataStoreService::Paths

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

Overview

Path helper methods for the DataStoreService API.

Instance Method Summary collapse

Instance Method Details

#cmek_config_path(project: , location: ) ⇒ ::String #cmek_config_path(project: , location: , cmek_config: ) ⇒ ::String

Create a fully-qualified CmekConfig resource string.

Overloads:

  • #cmek_config_path(project: , location: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/cmekConfig

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
  • #cmek_config_path(project: , location: , cmek_config: ) ⇒ ::String

    The resource will be in the following format:

    projects/{project}/locations/{location}/cmekConfigs/{cmek_config}

    Parameters:

    • project (String) (defaults to: )
    • location (String) (defaults to: )
    • cmek_config (String) (defaults to: )

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb', line 48

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

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

      "projects/#{project}/locations/#{location}/cmekConfigs/#{cmek_config}"
    end)
  }

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

#collection_path(project:, location:, collection:) ⇒ ::String

Create a fully-qualified Collection resource string.

The resource will be in the following format:

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

Parameters:

  • project (String)
  • location (String)
  • collection (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


80
81
82
83
84
85
# File 'lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb', line 80

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

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

#crypto_key_versions_path(project:, location:, key_ring:, crypto_key:, crypto_key_version:) ⇒ ::String

Create a fully-qualified CryptoKeyVersions resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}

Parameters:

  • project (String)
  • location (String)
  • key_ring (String)
  • crypto_key (String)
  • crypto_key_version (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


101
102
103
104
105
106
107
108
# File 'lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb', line 101

def crypto_key_versions_path project:, location:, key_ring:, crypto_key:, crypto_key_version:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/"
  raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/"

  "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}"
end

#crypto_keys_path(project:, location:, key_ring:, crypto_key:) ⇒ ::String

Create a fully-qualified CryptoKeys resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}

Parameters:

  • project (String)
  • location (String)
  • key_ring (String)
  • crypto_key (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


123
124
125
126
127
128
129
# File 'lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb', line 123

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

  "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}"
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)


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

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_processing_config_path(project: , location: , data_store: ) ⇒ ::String #document_processing_config_path(project: , location: , collection: , data_store: ) ⇒ ::String

Create a fully-qualified DocumentProcessingConfig resource string.

Overloads:

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

    The resource will be in the following format:

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

    Parameters:

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

    The resource will be in the following format:

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

    Parameters:

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

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb', line 199

def document_processing_config_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}/documentProcessingConfig"
    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}/documentProcessingConfig"
    end)
  }

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

#identity_mapping_store_path(project:, location:, identity_mapping_store:) ⇒ ::String

Create a fully-qualified IdentityMappingStore resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/identityMappingStores/{identity_mapping_store}

Parameters:

  • project (String)
  • location (String)
  • identity_mapping_store (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


233
234
235
236
237
238
# File 'lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb', line 233

def identity_mapping_store_path project:, location:, identity_mapping_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}/identityMappingStores/#{identity_mapping_store}"
end

#schema_path(project: , location: , data_store: , schema: ) ⇒ ::String #schema_path(project: , location: , collection: , data_store: , schema: ) ⇒ ::String

Create a fully-qualified Schema resource string.

Overloads:

  • #schema_path(project: , location: , data_store: , schema: ) ⇒ ::String

    The resource will be in the following format:

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

    Parameters:

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

    The resource will be in the following format:

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

    Parameters:

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

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb', line 265

def schema_path **args
  resources = {
    "data_store:location:project:schema" => (proc do |project:, location:, data_store:, schema:|
      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}/schemas/#{schema}"
    end),
    "collection:data_store:location:project:schema" => (proc do |project:, location:, collection:, data_store:, schema:|
      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}/schemas/#{schema}"
    end)
  }

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