# 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.Places.V1.Model.GoogleMapsPlacesV1RoutingParameters do
  @moduledoc """
  Parameters to configure the routing calculations to the places in the response, both along a route (where result ranking will be influenced) and for calculating travel times on results.

  ## Attributes

  *   `origin` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeLatLng.t`, *default:* `nil`) - Optional. An explicit routing origin that overrides the origin defined in the polyline. By default, the polyline origin is used.
  *   `routeModifiers` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RouteModifiers.t`, *default:* `nil`) - Optional. The route modifiers.
  *   `routingPreference` (*type:* `String.t`, *default:* `nil`) - Optional. Specifies how to compute the routing summaries. The server attempts to use the selected routing preference to compute the route. The traffic aware routing preference is only available for the `DRIVE` or `TWO_WHEELER` `travelMode`.
  *   `travelMode` (*type:* `String.t`, *default:* `nil`) - Optional. The travel mode.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :origin => GoogleApi.Places.V1.Model.GoogleTypeLatLng.t() | nil,
          :routeModifiers => GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RouteModifiers.t() | nil,
          :routingPreference => String.t() | nil,
          :travelMode => String.t() | nil
        }

  field(:origin, as: GoogleApi.Places.V1.Model.GoogleTypeLatLng)
  field(:routeModifiers, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RouteModifiers)
  field(:routingPreference)
  field(:travelMode)
end

defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingParameters do
  def decode(value, options) do
    GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingParameters.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingParameters do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
