# 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.GoogleMapsPlayablelocationsV3SamplePlayableLocation do
  @moduledoc """
  A geographical point suitable for placing game objects in location-based games.

  ## Attributes

  *   `centerPoint` (*type:* `GoogleApi.PlayableLocations.V3.Model.GoogleTypeLatLng.t`, *default:* `nil`) - Required. The latitude and longitude associated with the center of the playable location. By default, the set of playable locations returned from SamplePlayableLocations use center-point coordinates.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. The name of this playable location.
  *   `placeId` (*type:* `String.t`, *default:* `nil`) - A [place ID] (https://developers.google.com/places/place-id)
  *   `plusCode` (*type:* `String.t`, *default:* `nil`) - A [plus code] (http://openlocationcode.com)
  *   `snappedPoint` (*type:* `GoogleApi.PlayableLocations.V3.Model.GoogleTypeLatLng.t`, *default:* `nil`) - The playable location's coordinates, snapped to the sidewalk of the nearest road, if a nearby road exists.
  *   `types` (*type:* `list(String.t)`, *default:* `nil`) - A collection of [Playable Location Types](/maps/documentation/gaming/tt/types) for this playable location. The first type in the collection is the primary type. Type information might not be available for all playable locations.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :centerPoint => GoogleApi.PlayableLocations.V3.Model.GoogleTypeLatLng.t() | nil,
          :name => String.t() | nil,
          :placeId => String.t() | nil,
          :plusCode => String.t() | nil,
          :snappedPoint => GoogleApi.PlayableLocations.V3.Model.GoogleTypeLatLng.t() | nil,
          :types => list(String.t()) | nil
        }

  field(:centerPoint, as: GoogleApi.PlayableLocations.V3.Model.GoogleTypeLatLng)
  field(:name)
  field(:placeId)
  field(:plusCode)
  field(:snappedPoint, as: GoogleApi.PlayableLocations.V3.Model.GoogleTypeLatLng)
  field(:types, type: :list)
end

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

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