# 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.AchievementConfiguration do
  @moduledoc """
  An achievement configuration resource.

  ## Attributes

  *   `achievementType` (*type:* `String.t`, *default:* `nil`) - The type of the achievement.
  *   `draft` (*type:* `GoogleApi.GamesConfiguration.V1configuration.Model.AchievementConfigurationDetail.t`, *default:* `nil`) - The draft data of the achievement.
  *   `id` (*type:* `String.t`, *default:* `nil`) - The ID of the achievement.
  *   `initialState` (*type:* `String.t`, *default:* `nil`) - The initial state of the achievement.
  *   `kind` (*type:* `String.t`, *default:* `nil`) - Uniquely identifies the type of this resource. Value is always the fixed string `gamesConfiguration#achievementConfiguration`.
  *   `published` (*type:* `GoogleApi.GamesConfiguration.V1configuration.Model.AchievementConfigurationDetail.t`, *default:* `nil`) - The read-only published data of the achievement.
  *   `stepsToUnlock` (*type:* `integer()`, *default:* `nil`) - Steps to unlock. Only applicable to incremental achievements.
  *   `token` (*type:* `String.t`, *default:* `nil`) - The token for this resource.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :achievementType => String.t() | nil,
          :draft =>
            GoogleApi.GamesConfiguration.V1configuration.Model.AchievementConfigurationDetail.t()
            | nil,
          :id => String.t() | nil,
          :initialState => String.t() | nil,
          :kind => String.t() | nil,
          :published =>
            GoogleApi.GamesConfiguration.V1configuration.Model.AchievementConfigurationDetail.t()
            | nil,
          :stepsToUnlock => integer() | nil,
          :token => String.t() | nil
        }

  field(:achievementType)

  field(:draft,
    as: GoogleApi.GamesConfiguration.V1configuration.Model.AchievementConfigurationDetail
  )

  field(:id)
  field(:initialState)
  field(:kind)

  field(:published,
    as: GoogleApi.GamesConfiguration.V1configuration.Model.AchievementConfigurationDetail
  )

  field(:stepsToUnlock)
  field(:token)
end

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

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