Module: Google::Cloud::DiscoveryEngine::V1beta::EngineService::Paths

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

Overview

Path helper methods for the EngineService API.

Instance Method Summary collapse

Instance Method Details

#agent_gateway_path(project:, location:, agent_gateway:) ⇒ ::String

Create a fully-qualified AgentGateway resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/agentGateways/{agent_gateway}

Parameters:

  • project (String)
  • location (String)
  • agent_gateway (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


39
40
41
42
43
44
# File 'lib/google/cloud/discovery_engine/v1beta/engine_service/paths.rb', line 39

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

  "projects/#{project}/locations/#{location}/agentGateways/#{agent_gateway}"
end

#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)
    • location (String)
  • #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)
    • location (String)
    • cmek_config (String)

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/discovery_engine/v1beta/engine_service/paths.rb', line 67

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)


99
100
101
102
103
104
# File 'lib/google/cloud/discovery_engine/v1beta/engine_service/paths.rb', line 99

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)


120
121
122
123
124
125
126
127
# File 'lib/google/cloud/discovery_engine/v1beta/engine_service/paths.rb', line 120

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)


142
143
144
145
146
147
148
# File 'lib/google/cloud/discovery_engine/v1beta/engine_service/paths.rb', line 142

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

#engine_path(project:, location:, collection:, engine:) ⇒ ::String

Create a fully-qualified Engine resource string.

The resource will be in the following format:

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

Parameters:

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

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


163
164
165
166
167
168
169
# File 'lib/google/cloud/discovery_engine/v1beta/engine_service/paths.rb', line 163

def engine_path project:, location:, collection:, engine:
  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}/engines/#{engine}"
end