# 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.GamesConfiguration.V1configuration.Model.GamesNumberFormatConfiguration do
  @moduledoc """
  A number format resource.

  ## Attributes

  *   `currencyCode` (*type:* `String.t`, *default:* `nil`) - The curreny code string. Only used for CURRENCY format type.
  *   `numDecimalPlaces` (*type:* `integer()`, *default:* `nil`) - The number of decimal places for number. Only used for NUMERIC format type.
  *   `numberFormatType` (*type:* `String.t`, *default:* `nil`) - The formatting for the number.
  *   `suffix` (*type:* `GoogleApi.GamesConfiguration.V1configuration.Model.GamesNumberAffixConfiguration.t`, *default:* `nil`) - An optional suffix for the NUMERIC format type. These strings follow the same plural rules as all Android string resources.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :currencyCode => String.t() | nil,
          :numDecimalPlaces => integer() | nil,
          :numberFormatType => String.t() | nil,
          :suffix =>
            GoogleApi.GamesConfiguration.V1configuration.Model.GamesNumberAffixConfiguration.t()
            | nil
        }

  field(:currencyCode)
  field(:numDecimalPlaces)
  field(:numberFormatType)

  field(:suffix,
    as: GoogleApi.GamesConfiguration.V1configuration.Model.GamesNumberAffixConfiguration
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.GamesConfiguration.V1configuration.Model.GamesNumberFormatConfiguration do
  def decode(value, options) do
    GoogleApi.GamesConfiguration.V1configuration.Model.GamesNumberFormatConfiguration.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.GamesConfiguration.V1configuration.Model.GamesNumberFormatConfiguration do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
