Module: Google::Cloud::Speech::V1p1beta1::Adaptation::Paths

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

Overview

Path helper methods for the Adaptation API.

Instance Method Summary collapse

Instance Method Details

#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)


40
41
42
43
44
45
46
# File 'lib/google/cloud/speech/v1p1beta1/adaptation/paths.rb', line 40

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)


62
63
64
65
66
67
68
69
# File 'lib/google/cloud/speech/v1p1beta1/adaptation/paths.rb', line 62

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)


83
84
85
86
87
88
# File 'lib/google/cloud/speech/v1p1beta1/adaptation/paths.rb', line 83

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)


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

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)


119
120
121
122
123
124
# File 'lib/google/cloud/speech/v1p1beta1/adaptation/paths.rb', line 119

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