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

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


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

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)


57
58
59
60
61
# File 'lib/google/cloud/speech/v1p1beta1/adaptation/paths.rb', line 57

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)


75
76
77
78
79
80
# File 'lib/google/cloud/speech/v1p1beta1/adaptation/paths.rb', line 75

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