Module: Google::Cloud::Translate::V3::TranslationService::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/translate/v3/translation_service/paths.rb

Overview

Path helper methods for the TranslationService API.

Instance Method Summary collapse

Instance Method Details

#adaptive_mt_dataset_path(project:, location:, dataset:) ⇒ ::String

Create a fully-qualified AdaptiveMtDataset resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}

Parameters:

  • project (String)
  • location (String)
  • dataset (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


39
40
41
42
43
44
# File 'lib/google/cloud/translate/v3/translation_service/paths.rb', line 39

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

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

#adaptive_mt_file_path(project:, location:, dataset:, file:) ⇒ ::String

Create a fully-qualified AdaptiveMtFile resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}

Parameters:

  • project (String)
  • location (String)
  • dataset (String)
  • file (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


59
60
61
62
63
64
65
# File 'lib/google/cloud/translate/v3/translation_service/paths.rb', line 59

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

  "projects/#{project}/locations/#{location}/adaptiveMtDatasets/#{dataset}/adaptiveMtFiles/#{file}"
end

#dataset_path(project:, location:, dataset:) ⇒ ::String

Create a fully-qualified Dataset resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/datasets/{dataset}

Parameters:

  • project (String)
  • location (String)
  • dataset (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


79
80
81
82
83
84
# File 'lib/google/cloud/translate/v3/translation_service/paths.rb', line 79

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

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

#glossary_entry_path(project:, location:, glossary:, glossary_entry:) ⇒ ::String

Create a fully-qualified GlossaryEntry resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/glossaries/{glossary}/glossaryEntries/{glossary_entry}

Parameters:

  • project (String)
  • location (String)
  • glossary (String)
  • glossary_entry (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


118
119
120
121
122
123
124
# File 'lib/google/cloud/translate/v3/translation_service/paths.rb', line 118

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

  "projects/#{project}/locations/#{location}/glossaries/#{glossary}/glossaryEntries/#{glossary_entry}"
end

#glossary_path(project:, location:, glossary:) ⇒ ::String

Create a fully-qualified Glossary resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/glossaries/{glossary}

Parameters:

  • project (String)
  • location (String)
  • glossary (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


98
99
100
101
102
103
# File 'lib/google/cloud/translate/v3/translation_service/paths.rb', line 98

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

  "projects/#{project}/locations/#{location}/glossaries/#{glossary}"
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)


137
138
139
140
141
# File 'lib/google/cloud/translate/v3/translation_service/paths.rb', line 137

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

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

#model_path(project:, location:, model:) ⇒ ::String

Create a fully-qualified Model resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/models/{model}

Parameters:

  • project (String)
  • location (String)
  • model (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


155
156
157
158
159
160
# File 'lib/google/cloud/translate/v3/translation_service/paths.rb', line 155

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

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