Module: Google::Cloud::Speech::V2::Speech::Paths

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

Overview

Path helper methods for the Speech API.

Instance Method Summary collapse

Instance Method Details

#config_path(project:, location:) ⇒ ::String

Create a fully-qualified Config resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/config

Parameters:

  • project (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


38
39
40
41
42
# File 'lib/google/cloud/speech/v2/speech/paths.rb', line 38

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

  "projects/#{project}/locations/#{location}/config"
end

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

Create a fully-qualified CryptoKey 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)


57
58
59
60
61
62
63
# File 'lib/google/cloud/speech/v2/speech/paths.rb', line 57

def crypto_key_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

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

Create a fully-qualified CryptoKeyVersion 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)


79
80
81
82
83
84
85
86
# File 'lib/google/cloud/speech/v2/speech/paths.rb', line 79

def crypto_key_version_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

#custom_class_path(project:, location:, custom_class:) ⇒ ::String

Create a fully-qualified CustomClass resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/customClasses/{custom_class}

Parameters:

  • project (String)
  • location (String)
  • custom_class (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


100
101
102
103
104
105
# File 'lib/google/cloud/speech/v2/speech/paths.rb', line 100

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

  "projects/#{project}/locations/#{location}/customClasses/#{custom_class}"
end

#location_path(project:, location:) ⇒ ::String

Create a fully-qualified Location resource string.

The resource will be in the following format:

projects/{project}/locations/{location}

Parameters:

  • project (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


118
119
120
121
122
# File 'lib/google/cloud/speech/v2/speech/paths.rb', line 118

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

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

#phrase_set_path(project:, location:, phrase_set:) ⇒ ::String

Create a fully-qualified PhraseSet resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/phraseSets/{phrase_set}

Parameters:

  • project (String)
  • location (String)
  • phrase_set (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


136
137
138
139
140
141
# File 'lib/google/cloud/speech/v2/speech/paths.rb', line 136

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

  "projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}"
end

#recognizer_path(project:, location:, recognizer:) ⇒ ::String

Create a fully-qualified Recognizer resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/recognizers/{recognizer}

Parameters:

  • project (String)
  • location (String)
  • recognizer (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


155
156
157
158
159
160
# File 'lib/google/cloud/speech/v2/speech/paths.rb', line 155

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

  "projects/#{project}/locations/#{location}/recognizers/#{recognizer}"
end