# 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.TextToSpeech.V1beta1.Model.Voice do
  @moduledoc """
  Description of a voice supported by the TTS service.

  ## Attributes

  *   `languageCodes` (*type:* `list(String.t)`, *default:* `nil`) - The languages that this voice supports, expressed as [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. "en-US", "es-419", "cmn-tw").
  *   `name` (*type:* `String.t`, *default:* `nil`) - The name of this voice. Each distinct voice has a unique name.
  *   `naturalSampleRateHertz` (*type:* `integer()`, *default:* `nil`) - The natural sample rate (in hertz) for this voice.
  *   `ssmlGender` (*type:* `String.t`, *default:* `nil`) - The gender of this voice.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :languageCodes => list(String.t()) | nil,
          :name => String.t() | nil,
          :naturalSampleRateHertz => integer() | nil,
          :ssmlGender => String.t() | nil
        }

  field(:languageCodes, type: :list)
  field(:name)
  field(:naturalSampleRateHertz)
  field(:ssmlGender)
end

defimpl Poison.Decoder, for: GoogleApi.TextToSpeech.V1beta1.Model.Voice do
  def decode(value, options) do
    GoogleApi.TextToSpeech.V1beta1.Model.Voice.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.TextToSpeech.V1beta1.Model.Voice do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
