Skip to content

Commit

Permalink
feat: Automated regeneration of Translate client (#10864)
Browse files Browse the repository at this point in the history
Auto-created at 2024-03-12 01:28:26 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Mar 12, 2024
1 parent 480932d commit 3f65ecb
Show file tree
Hide file tree
Showing 47 changed files with 3,352 additions and 124 deletions.
1,919 changes: 1,824 additions & 95 deletions clients/translate/lib/google_api/translate/v3/api/projects.ex

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion clients/translate/lib/google_api/translate/v3/metadata.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.Translate.V3 do
API client metadata for GoogleApi.Translate.V3.
"""

@discovery_revision "20221021"
@discovery_revision "20240301"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Translate.V3.Model.AdaptiveMtDataset do
@moduledoc """
An Adaptive MT Dataset.
## Attributes
* `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when this dataset was created.
* `displayName` (*type:* `String.t`, *default:* `nil`) - The name of the dataset to show in the interface. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores (_), and ASCII digits 0-9.
* `exampleCount` (*type:* `integer()`, *default:* `nil`) - The number of examples in the dataset.
* `name` (*type:* `String.t`, *default:* `nil`) - Required. The resource name of the dataset, in form of `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset_id}`
* `sourceLanguageCode` (*type:* `String.t`, *default:* `nil`) - The BCP-47 language code of the source language.
* `targetLanguageCode` (*type:* `String.t`, *default:* `nil`) - The BCP-47 language code of the target language.
* `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when this dataset was last updated.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:createTime => DateTime.t() | nil,
:displayName => String.t() | nil,
:exampleCount => integer() | nil,
:name => String.t() | nil,
:sourceLanguageCode => String.t() | nil,
:targetLanguageCode => String.t() | nil,
:updateTime => DateTime.t() | nil
}

field(:createTime, as: DateTime)
field(:displayName)
field(:exampleCount)
field(:name)
field(:sourceLanguageCode)
field(:targetLanguageCode)
field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.Translate.V3.Model.AdaptiveMtDataset do
def decode(value, options) do
GoogleApi.Translate.V3.Model.AdaptiveMtDataset.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.Translate.V3.Model.AdaptiveMtDataset do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Translate.V3.Model.AdaptiveMtFile do
@moduledoc """
An AdaptiveMtFile.
## Attributes
* `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when this file was created.
* `displayName` (*type:* `String.t`, *default:* `nil`) - The file's display name.
* `entryCount` (*type:* `integer()`, *default:* `nil`) - The number of entries that the file contains.
* `name` (*type:* `String.t`, *default:* `nil`) - Required. The resource name of the file, in form of `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}`
* `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when this file was last updated.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:createTime => DateTime.t() | nil,
:displayName => String.t() | nil,
:entryCount => integer() | nil,
:name => String.t() | nil,
:updateTime => DateTime.t() | nil
}

field(:createTime, as: DateTime)
field(:displayName)
field(:entryCount)
field(:name)
field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.Translate.V3.Model.AdaptiveMtFile do
def decode(value, options) do
GoogleApi.Translate.V3.Model.AdaptiveMtFile.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.Translate.V3.Model.AdaptiveMtFile do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Translate.V3.Model.AdaptiveMtSentence do
@moduledoc """
An AdaptiveMt sentence entry.
## Attributes
* `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when this sentence was created.
* `name` (*type:* `String.t`, *default:* `nil`) - Required. The resource name of the file, in form of `projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}/adaptiveMtSentences/{sentence}`
* `sourceSentence` (*type:* `String.t`, *default:* `nil`) - Required. The source sentence.
* `targetSentence` (*type:* `String.t`, *default:* `nil`) - Required. The target sentence.
* `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when this sentence was last updated.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:createTime => DateTime.t() | nil,
:name => String.t() | nil,
:sourceSentence => String.t() | nil,
:targetSentence => String.t() | nil,
:updateTime => DateTime.t() | nil
}

field(:createTime, as: DateTime)
field(:name)
field(:sourceSentence)
field(:targetSentence)
field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.Translate.V3.Model.AdaptiveMtSentence do
def decode(value, options) do
GoogleApi.Translate.V3.Model.AdaptiveMtSentence.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.Translate.V3.Model.AdaptiveMtSentence do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Translate.V3.Model.AdaptiveMtTranslateRequest do
@moduledoc """
The request for sending an AdaptiveMt translation query.
## Attributes
* `content` (*type:* `list(String.t)`, *default:* `nil`) - Required. The content of the input in string format. For now only one sentence per request is supported.
* `dataset` (*type:* `String.t`, *default:* `nil`) - Required. The resource name for the dataset to use for adaptive MT. `projects/{project}/locations/{location-id}/adaptiveMtDatasets/{dataset}`
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:content => list(String.t()) | nil,
:dataset => String.t() | nil
}

field(:content, type: :list)
field(:dataset)
end

defimpl Poison.Decoder, for: GoogleApi.Translate.V3.Model.AdaptiveMtTranslateRequest do
def decode(value, options) do
GoogleApi.Translate.V3.Model.AdaptiveMtTranslateRequest.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.Translate.V3.Model.AdaptiveMtTranslateRequest do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Translate.V3.Model.AdaptiveMtTranslateResponse do
@moduledoc """
An AdaptiveMtTranslate response.
## Attributes
* `languageCode` (*type:* `String.t`, *default:* `nil`) - Output only. The translation's language code.
* `translations` (*type:* `list(GoogleApi.Translate.V3.Model.AdaptiveMtTranslation.t)`, *default:* `nil`) - Output only. The translation.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:languageCode => String.t() | nil,
:translations => list(GoogleApi.Translate.V3.Model.AdaptiveMtTranslation.t()) | nil
}

field(:languageCode)
field(:translations, as: GoogleApi.Translate.V3.Model.AdaptiveMtTranslation, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.Translate.V3.Model.AdaptiveMtTranslateResponse do
def decode(value, options) do
GoogleApi.Translate.V3.Model.AdaptiveMtTranslateResponse.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.Translate.V3.Model.AdaptiveMtTranslateResponse do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Translate.V3.Model.AdaptiveMtTranslation do
@moduledoc """
An AdaptiveMt translation.
## Attributes
* `translatedText` (*type:* `String.t`, *default:* `nil`) - Output only. The translated text.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:translatedText => String.t() | nil
}

field(:translatedText)
end

defimpl Poison.Decoder, for: GoogleApi.Translate.V3.Model.AdaptiveMtTranslation do
def decode(value, options) do
GoogleApi.Translate.V3.Model.AdaptiveMtTranslation.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.Translate.V3.Model.AdaptiveMtTranslation do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defmodule GoogleApi.Translate.V3.Model.BatchDocumentOutputConfig do
## Attributes
* `gcsDestination` (*type:* `GoogleApi.Translate.V3.Model.GcsDestination.t`, *default:* `nil`) - Google Cloud Storage destination for output content. For every single input document (for example, gs://a/b/c.[extension]), we generate at most 2 * n output files. (n is the # of target_language_codes in the BatchTranslateDocumentRequest). While the input documents are being processed, we write/update an index file `index.csv` under `gcs_destination.output_uri_prefix` (for example, gs://translation_output/index.csv) The index file is generated/updated as new files are being translated. The format is: input_document,target_language_code,translation_output,error_output, glossary_translation_output,glossary_error_output `input_document` is one file we matched using gcs_source.input_uri. `target_language_code` is provided in the request. `translation_output` contains the translations. (details provided below) `error_output` contains the error message during processing of the file. Both translations_file and errors_file could be empty strings if we have no content to output. `glossary_translation_output` and `glossary_error_output` are the translated output/error when we apply glossaries. They could also be empty if we have no content to output. Once a row is present in index.csv, the input/output matching never changes. Callers should also expect all the content in input_file are processed and ready to be consumed (that is, no partial output file is written). Since index.csv will be keeping updated during the process, please make sure there is no custom retention policy applied on the output bucket that may avoid file updating. (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) The naming format of translation output files follows (for target language code [trg]): `translation_output`: gs://translation_output/a_b_c_[trg]_translation.[extension] `glossary_translation_output`: gs://translation_test/a_b_c_[trg]_glossary_translation.[extension] The output document will maintain the same file format as the input document. The naming format of error output files follows (for target language code [trg]): `error_output`: gs://translation_test/a_b_c_[trg]_errors.txt `glossary_error_output`: gs://translation_test/a_b_c_[trg]_glossary_translation.txt The error output is a txt file containing error details.
* `gcsDestination` (*type:* `GoogleApi.Translate.V3.Model.GcsDestination.t`, *default:* `nil`) - Google Cloud Storage destination for output content. For every single input document (for example, gs://a/b/c.[extension]), we generate at most 2 * n output files. (n is the # of target_language_codes in the BatchTranslateDocumentRequest). While the input documents are being processed, we write/update an index file `index.csv` under `gcs_destination.output_uri_prefix` (for example, gs://translation_output/index.csv) The index file is generated/updated as new files are being translated. The format is: input_document,target_language_code,translation_output,error_output, glossary_translation_output,glossary_error_output `input_document` is one file we matched using gcs_source.input_uri. `target_language_code` is provided in the request. `translation_output` contains the translations. (details provided below) `error_output` contains the error message during processing of the file. Both translations_file and errors_file could be empty strings if we have no content to output. `glossary_translation_output` and `glossary_error_output` are the translated output/error when we apply glossaries. They could also be empty if we have no content to output. Once a row is present in index.csv, the input/output matching never changes. Callers should also expect all the content in input_file are processed and ready to be consumed (that is, no partial output file is written). Since index.csv will be keeping updated during the process, please make sure there is no custom retention policy applied on the output bucket that may avoid file updating. (https://cloud.google.com/storage/docs/bucket-lock#retention-policy) The naming format of translation output files follows (for target language code [trg]): `translation_output`: `gs://translation_output/a_b_c_[trg]_translation.[extension]` `glossary_translation_output`: `gs://translation_test/a_b_c_[trg]_glossary_translation.[extension]`. The output document will maintain the same file format as the input document. The naming format of error output files follows (for target language code [trg]): `error_output`: `gs://translation_test/a_b_c_[trg]_errors.txt` `glossary_error_output`: `gs://translation_test/a_b_c_[trg]_glossary_translation.txt`. The error output is a txt file containing error details.
"""

use GoogleApi.Gax.ModelBase
Expand Down
Loading

0 comments on commit 3f65ecb

Please sign in to comment.