Skip to content

Commit a36b404

Browse files
feat: Automated regeneration of TextToSpeech client (googleapis#12249)
Auto-created at 2024-10-01 13:16:08 +0000 using the toys pull request generator.
1 parent de528e9 commit a36b404

28 files changed

+942
-6
lines changed

clients/text_to_speech/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding
1111

1212
```elixir
1313
def deps do
14-
[{:google_api_text_to_speech, "~> 0.17"}]
14+
[{:google_api_text_to_speech, "~> 0.18"}]
1515
end
1616
```
1717

clients/text_to_speech/lib/google_api/text_to_speech/v1/api/voices.ex

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,71 @@ defmodule GoogleApi.TextToSpeech.V1.Api.Voices do
2525

2626
@library_version Mix.Project.config() |> Keyword.get(:version, "")
2727

28+
@doc """
29+
Generates voice clone key given a short voice prompt. This method validates the voice prompts with a series of checks against the voice talent statement to verify the voice clone is safe to generate.
30+
31+
## Parameters
32+
33+
* `connection` (*type:* `GoogleApi.TextToSpeech.V1.Connection.t`) - Connection to server
34+
* `optional_params` (*type:* `keyword()`) - Optional parameters
35+
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
36+
* `:access_token` (*type:* `String.t`) - OAuth access token.
37+
* `:alt` (*type:* `String.t`) - Data format for response.
38+
* `:callback` (*type:* `String.t`) - JSONP
39+
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
40+
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
41+
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
42+
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
43+
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
44+
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
45+
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
46+
* `:body` (*type:* `GoogleApi.TextToSpeech.V1.Model.GenerateVoiceCloningKeyRequest.t`) -
47+
* `opts` (*type:* `keyword()`) - Call options
48+
49+
## Returns
50+
51+
* `{:ok, %GoogleApi.TextToSpeech.V1.Model.GenerateVoiceCloningKeyResponse{}}` on success
52+
* `{:error, info}` on failure
53+
"""
54+
@spec texttospeech_voices_generate_voice_cloning_key(Tesla.Env.client(), keyword(), keyword()) ::
55+
{:ok, GoogleApi.TextToSpeech.V1.Model.GenerateVoiceCloningKeyResponse.t()}
56+
| {:ok, Tesla.Env.t()}
57+
| {:ok, list()}
58+
| {:error, any()}
59+
def texttospeech_voices_generate_voice_cloning_key(
60+
connection,
61+
optional_params \\ [],
62+
opts \\ []
63+
) do
64+
optional_params_config = %{
65+
:"$.xgafv" => :query,
66+
:access_token => :query,
67+
:alt => :query,
68+
:callback => :query,
69+
:fields => :query,
70+
:key => :query,
71+
:oauth_token => :query,
72+
:prettyPrint => :query,
73+
:quotaUser => :query,
74+
:uploadType => :query,
75+
:upload_protocol => :query,
76+
:body => :body
77+
}
78+
79+
request =
80+
Request.new()
81+
|> Request.method(:post)
82+
|> Request.url("/v1/voices:generateVoiceCloningKey", %{})
83+
|> Request.add_optional_params(optional_params_config, optional_params)
84+
|> Request.library_version(@library_version)
85+
86+
connection
87+
|> Connection.execute(request)
88+
|> Response.decode(
89+
opts ++ [struct: %GoogleApi.TextToSpeech.V1.Model.GenerateVoiceCloningKeyResponse{}]
90+
)
91+
end
92+
2893
@doc """
2994
Returns a list of Voice supported for synthesis.
3095

clients/text_to_speech/lib/google_api/text_to_speech/v1/metadata.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ defmodule GoogleApi.TextToSpeech.V1 do
2020
API client metadata for GoogleApi.TextToSpeech.V1.
2121
"""
2222

23-
@discovery_revision "20240815"
23+
@discovery_revision "20241001"
2424

2525
def discovery_revision(), do: @discovery_revision
2626
end
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.TextToSpeech.V1.Model.AdvancedVoiceOptions do
19+
@moduledoc """
20+
Used for advanced voice options.
21+
22+
## Attributes
23+
24+
* `lowLatencyJourneySynthesis` (*type:* `boolean()`, *default:* `nil`) - Only for Jounrney voices. If false, the synthesis will be context aware and have higher latency.
25+
"""
26+
27+
use GoogleApi.Gax.ModelBase
28+
29+
@type t :: %__MODULE__{
30+
:lowLatencyJourneySynthesis => boolean() | nil
31+
}
32+
33+
field(:lowLatencyJourneySynthesis)
34+
end
35+
36+
defimpl Poison.Decoder, for: GoogleApi.TextToSpeech.V1.Model.AdvancedVoiceOptions do
37+
def decode(value, options) do
38+
GoogleApi.TextToSpeech.V1.Model.AdvancedVoiceOptions.decode(value, options)
39+
end
40+
end
41+
42+
defimpl Poison.Encoder, for: GoogleApi.TextToSpeech.V1.Model.AdvancedVoiceOptions do
43+
def encode(value, options) do
44+
GoogleApi.Gax.ModelBase.encode(value, options)
45+
end
46+
end
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.TextToSpeech.V1.Model.CustomPronunciationParams do
19+
@moduledoc """
20+
Pronunciation customization for a phrase.
21+
22+
## Attributes
23+
24+
* `phoneticEncoding` (*type:* `String.t`, *default:* `nil`) - The phonetic encoding of the phrase.
25+
* `phrase` (*type:* `String.t`, *default:* `nil`) - The phrase to which the customization will be applied. The phrase can be multiple words (in the case of proper nouns etc), but should not span to a whole sentence.
26+
* `pronunciation` (*type:* `String.t`, *default:* `nil`) - The pronunciation of the phrase. This must be in the phonetic encoding specified above.
27+
"""
28+
29+
use GoogleApi.Gax.ModelBase
30+
31+
@type t :: %__MODULE__{
32+
:phoneticEncoding => String.t() | nil,
33+
:phrase => String.t() | nil,
34+
:pronunciation => String.t() | nil
35+
}
36+
37+
field(:phoneticEncoding)
38+
field(:phrase)
39+
field(:pronunciation)
40+
end
41+
42+
defimpl Poison.Decoder, for: GoogleApi.TextToSpeech.V1.Model.CustomPronunciationParams do
43+
def decode(value, options) do
44+
GoogleApi.TextToSpeech.V1.Model.CustomPronunciationParams.decode(value, options)
45+
end
46+
end
47+
48+
defimpl Poison.Encoder, for: GoogleApi.TextToSpeech.V1.Model.CustomPronunciationParams do
49+
def encode(value, options) do
50+
GoogleApi.Gax.ModelBase.encode(value, options)
51+
end
52+
end
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.TextToSpeech.V1.Model.CustomPronunciations do
19+
@moduledoc """
20+
A collection of pronunciation customizations.
21+
22+
## Attributes
23+
24+
* `pronunciations` (*type:* `list(GoogleApi.TextToSpeech.V1.Model.CustomPronunciationParams.t)`, *default:* `nil`) - The pronunciation customizations to be applied.
25+
"""
26+
27+
use GoogleApi.Gax.ModelBase
28+
29+
@type t :: %__MODULE__{
30+
:pronunciations =>
31+
list(GoogleApi.TextToSpeech.V1.Model.CustomPronunciationParams.t()) | nil
32+
}
33+
34+
field(:pronunciations,
35+
as: GoogleApi.TextToSpeech.V1.Model.CustomPronunciationParams,
36+
type: :list
37+
)
38+
end
39+
40+
defimpl Poison.Decoder, for: GoogleApi.TextToSpeech.V1.Model.CustomPronunciations do
41+
def decode(value, options) do
42+
GoogleApi.TextToSpeech.V1.Model.CustomPronunciations.decode(value, options)
43+
end
44+
end
45+
46+
defimpl Poison.Encoder, for: GoogleApi.TextToSpeech.V1.Model.CustomPronunciations do
47+
def encode(value, options) do
48+
GoogleApi.Gax.ModelBase.encode(value, options)
49+
end
50+
end
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.TextToSpeech.V1.Model.GenerateVoiceCloningKeyRequest do
19+
@moduledoc """
20+
Request message for the `GenerateVoiceCloningKey` method.
21+
22+
## Attributes
23+
24+
* `consentScript` (*type:* `String.t`, *default:* `nil`) - Required. The script used for the voice talent statement. The script will be provided to the caller through other channels. It must be returned unchanged in this field.
25+
* `languageCode` (*type:* `String.t`, *default:* `nil`) - Required. The language of the supplied audio as a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. Example: "en-US". See [Language Support](https://cloud.google.com/speech-to-text/docs/languages) for a list of the currently supported language codes.
26+
* `referenceAudio` (*type:* `GoogleApi.TextToSpeech.V1.Model.InputAudio.t`, *default:* `nil`) - Required. The training audio used to create voice clone. This is currently limited to LINEAR16 PCM WAV files mono audio with 24khz sample rate. This needs to be specified in [InputAudio.audio_config], other values will be explicitly rejected.
27+
* `voiceTalentConsent` (*type:* `GoogleApi.TextToSpeech.V1.Model.InputAudio.t`, *default:* `nil`) - Required. The voice talent audio used to verify consent to voice clone.
28+
"""
29+
30+
use GoogleApi.Gax.ModelBase
31+
32+
@type t :: %__MODULE__{
33+
:consentScript => String.t() | nil,
34+
:languageCode => String.t() | nil,
35+
:referenceAudio => GoogleApi.TextToSpeech.V1.Model.InputAudio.t() | nil,
36+
:voiceTalentConsent => GoogleApi.TextToSpeech.V1.Model.InputAudio.t() | nil
37+
}
38+
39+
field(:consentScript)
40+
field(:languageCode)
41+
field(:referenceAudio, as: GoogleApi.TextToSpeech.V1.Model.InputAudio)
42+
field(:voiceTalentConsent, as: GoogleApi.TextToSpeech.V1.Model.InputAudio)
43+
end
44+
45+
defimpl Poison.Decoder, for: GoogleApi.TextToSpeech.V1.Model.GenerateVoiceCloningKeyRequest do
46+
def decode(value, options) do
47+
GoogleApi.TextToSpeech.V1.Model.GenerateVoiceCloningKeyRequest.decode(value, options)
48+
end
49+
end
50+
51+
defimpl Poison.Encoder, for: GoogleApi.TextToSpeech.V1.Model.GenerateVoiceCloningKeyRequest do
52+
def encode(value, options) do
53+
GoogleApi.Gax.ModelBase.encode(value, options)
54+
end
55+
end
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.TextToSpeech.V1.Model.GenerateVoiceCloningKeyResponse do
19+
@moduledoc """
20+
Response message for the `GenerateVoiceCloningKey` method.
21+
22+
## Attributes
23+
24+
* `voiceCloningKey` (*type:* `String.t`, *default:* `nil`) - The voice clone key. Use it in the SynthesizeSpeechRequest by setting [voice.voice_clone.voice_cloning_key].
25+
"""
26+
27+
use GoogleApi.Gax.ModelBase
28+
29+
@type t :: %__MODULE__{
30+
:voiceCloningKey => String.t() | nil
31+
}
32+
33+
field(:voiceCloningKey)
34+
end
35+
36+
defimpl Poison.Decoder, for: GoogleApi.TextToSpeech.V1.Model.GenerateVoiceCloningKeyResponse do
37+
def decode(value, options) do
38+
GoogleApi.TextToSpeech.V1.Model.GenerateVoiceCloningKeyResponse.decode(value, options)
39+
end
40+
end
41+
42+
defimpl Poison.Encoder, for: GoogleApi.TextToSpeech.V1.Model.GenerateVoiceCloningKeyResponse do
43+
def encode(value, options) do
44+
GoogleApi.Gax.ModelBase.encode(value, options)
45+
end
46+
end
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.TextToSpeech.V1.Model.InputAudio do
19+
@moduledoc """
20+
Holds audio content and config.
21+
22+
## Attributes
23+
24+
* `audioConfig` (*type:* `GoogleApi.TextToSpeech.V1.Model.InputAudioConfig.t`, *default:* `nil`) - Required. Provides information that specifies how to process content.
25+
* `content` (*type:* `String.t`, *default:* `nil`) - Required. The audio data bytes encoded as specified in `InputAudioConfig`. Note: as with all bytes fields, proto buffers use a pure binary representation, whereas JSON representations use base64. Audio samples should be between 5-25 seconds in length.
26+
"""
27+
28+
use GoogleApi.Gax.ModelBase
29+
30+
@type t :: %__MODULE__{
31+
:audioConfig => GoogleApi.TextToSpeech.V1.Model.InputAudioConfig.t() | nil,
32+
:content => String.t() | nil
33+
}
34+
35+
field(:audioConfig, as: GoogleApi.TextToSpeech.V1.Model.InputAudioConfig)
36+
field(:content)
37+
end
38+
39+
defimpl Poison.Decoder, for: GoogleApi.TextToSpeech.V1.Model.InputAudio do
40+
def decode(value, options) do
41+
GoogleApi.TextToSpeech.V1.Model.InputAudio.decode(value, options)
42+
end
43+
end
44+
45+
defimpl Poison.Encoder, for: GoogleApi.TextToSpeech.V1.Model.InputAudio do
46+
def encode(value, options) do
47+
GoogleApi.Gax.ModelBase.encode(value, options)
48+
end
49+
end

0 commit comments

Comments
 (0)