# 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.PlayableLocations.V3.Model.GoogleMapsPlayablelocationsV3SamplePlayableLocationsResponse do
  @moduledoc """
   Response for the SamplePlayableLocations method.

  ## Attributes

  *   `locationsPerGameObjectType` (*type:* `%{optional(String.t) => GoogleApi.PlayableLocations.V3.Model.GoogleMapsPlayablelocationsV3SamplePlayableLocationList.t}`, *default:* `nil`) - Each PlayableLocation object corresponds to a game_object_type specified in the request.
  *   `ttl` (*type:* `String.t`, *default:* `nil`) - Required. Specifies the "time-to-live" for the set of playable locations. You can use this value to determine how long to cache the set of playable locations. After this length of time, your back-end game server should issue a new SamplePlayableLocations request to get a fresh set of playable locations (because for example, they might have been removed, a park might have closed for the day, a business might have closed permanently).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :locationsPerGameObjectType =>
            %{
              optional(String.t()) =>
                GoogleApi.PlayableLocations.V3.Model.GoogleMapsPlayablelocationsV3SamplePlayableLocationList.t()
            }
            | nil,
          :ttl => String.t() | nil
        }

  field(:locationsPerGameObjectType,
    as:
      GoogleApi.PlayableLocations.V3.Model.GoogleMapsPlayablelocationsV3SamplePlayableLocationList,
    type: :map
  )

  field(:ttl)
end

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

defimpl Poison.Encoder,
  for:
    GoogleApi.PlayableLocations.V3.Model.GoogleMapsPlayablelocationsV3SamplePlayableLocationsResponse do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
