{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Location.Types.CalculateRouteTruckModeOptions
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Location.Types.CalculateRouteTruckModeOptions where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Location.Types.TruckDimensions
import Amazonka.Location.Types.TruckWeight
import qualified Amazonka.Prelude as Prelude

-- | Contains details about additional route preferences for requests that
-- specify @TravelMode@ as @Truck@.
--
-- /See:/ 'newCalculateRouteTruckModeOptions' smart constructor.
data CalculateRouteTruckModeOptions = CalculateRouteTruckModeOptions'
  { -- | Specifies the truck\'s weight specifications including total weight and
    -- unit of measurement. Used to avoid roads that can\'t support the
    -- truck\'s weight.
    CalculateRouteTruckModeOptions -> Maybe TruckWeight
weight :: Prelude.Maybe TruckWeight,
    -- | Avoids ferries when calculating routes.
    --
    -- Default Value: @false@
    --
    -- Valid Values: @false@ | @true@
    CalculateRouteTruckModeOptions -> Maybe Bool
avoidTolls :: Prelude.Maybe Prelude.Bool,
    -- | Specifies the truck\'s dimension specifications including length,
    -- height, width, and unit of measurement. Used to avoid roads that can\'t
    -- support the truck\'s dimensions.
    CalculateRouteTruckModeOptions -> Maybe TruckDimensions
dimensions :: Prelude.Maybe TruckDimensions,
    -- | Avoids ferries when calculating routes.
    --
    -- Default Value: @false@
    --
    -- Valid Values: @false@ | @true@
    CalculateRouteTruckModeOptions -> Maybe Bool
avoidFerries :: Prelude.Maybe Prelude.Bool
  }
  deriving (CalculateRouteTruckModeOptions
-> CalculateRouteTruckModeOptions -> Bool
(CalculateRouteTruckModeOptions
 -> CalculateRouteTruckModeOptions -> Bool)
-> (CalculateRouteTruckModeOptions
    -> CalculateRouteTruckModeOptions -> Bool)
-> Eq CalculateRouteTruckModeOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CalculateRouteTruckModeOptions
-> CalculateRouteTruckModeOptions -> Bool
$c/= :: CalculateRouteTruckModeOptions
-> CalculateRouteTruckModeOptions -> Bool
== :: CalculateRouteTruckModeOptions
-> CalculateRouteTruckModeOptions -> Bool
$c== :: CalculateRouteTruckModeOptions
-> CalculateRouteTruckModeOptions -> Bool
Prelude.Eq, ReadPrec [CalculateRouteTruckModeOptions]
ReadPrec CalculateRouteTruckModeOptions
Int -> ReadS CalculateRouteTruckModeOptions
ReadS [CalculateRouteTruckModeOptions]
(Int -> ReadS CalculateRouteTruckModeOptions)
-> ReadS [CalculateRouteTruckModeOptions]
-> ReadPrec CalculateRouteTruckModeOptions
-> ReadPrec [CalculateRouteTruckModeOptions]
-> Read CalculateRouteTruckModeOptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CalculateRouteTruckModeOptions]
$creadListPrec :: ReadPrec [CalculateRouteTruckModeOptions]
readPrec :: ReadPrec CalculateRouteTruckModeOptions
$creadPrec :: ReadPrec CalculateRouteTruckModeOptions
readList :: ReadS [CalculateRouteTruckModeOptions]
$creadList :: ReadS [CalculateRouteTruckModeOptions]
readsPrec :: Int -> ReadS CalculateRouteTruckModeOptions
$creadsPrec :: Int -> ReadS CalculateRouteTruckModeOptions
Prelude.Read, Int -> CalculateRouteTruckModeOptions -> ShowS
[CalculateRouteTruckModeOptions] -> ShowS
CalculateRouteTruckModeOptions -> String
(Int -> CalculateRouteTruckModeOptions -> ShowS)
-> (CalculateRouteTruckModeOptions -> String)
-> ([CalculateRouteTruckModeOptions] -> ShowS)
-> Show CalculateRouteTruckModeOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CalculateRouteTruckModeOptions] -> ShowS
$cshowList :: [CalculateRouteTruckModeOptions] -> ShowS
show :: CalculateRouteTruckModeOptions -> String
$cshow :: CalculateRouteTruckModeOptions -> String
showsPrec :: Int -> CalculateRouteTruckModeOptions -> ShowS
$cshowsPrec :: Int -> CalculateRouteTruckModeOptions -> ShowS
Prelude.Show, (forall x.
 CalculateRouteTruckModeOptions
 -> Rep CalculateRouteTruckModeOptions x)
-> (forall x.
    Rep CalculateRouteTruckModeOptions x
    -> CalculateRouteTruckModeOptions)
-> Generic CalculateRouteTruckModeOptions
forall x.
Rep CalculateRouteTruckModeOptions x
-> CalculateRouteTruckModeOptions
forall x.
CalculateRouteTruckModeOptions
-> Rep CalculateRouteTruckModeOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CalculateRouteTruckModeOptions x
-> CalculateRouteTruckModeOptions
$cfrom :: forall x.
CalculateRouteTruckModeOptions
-> Rep CalculateRouteTruckModeOptions x
Prelude.Generic)

-- |
-- Create a value of 'CalculateRouteTruckModeOptions' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'weight', 'calculateRouteTruckModeOptions_weight' - Specifies the truck\'s weight specifications including total weight and
-- unit of measurement. Used to avoid roads that can\'t support the
-- truck\'s weight.
--
-- 'avoidTolls', 'calculateRouteTruckModeOptions_avoidTolls' - Avoids ferries when calculating routes.
--
-- Default Value: @false@
--
-- Valid Values: @false@ | @true@
--
-- 'dimensions', 'calculateRouteTruckModeOptions_dimensions' - Specifies the truck\'s dimension specifications including length,
-- height, width, and unit of measurement. Used to avoid roads that can\'t
-- support the truck\'s dimensions.
--
-- 'avoidFerries', 'calculateRouteTruckModeOptions_avoidFerries' - Avoids ferries when calculating routes.
--
-- Default Value: @false@
--
-- Valid Values: @false@ | @true@
newCalculateRouteTruckModeOptions ::
  CalculateRouteTruckModeOptions
newCalculateRouteTruckModeOptions :: CalculateRouteTruckModeOptions
newCalculateRouteTruckModeOptions =
  CalculateRouteTruckModeOptions' :: Maybe TruckWeight
-> Maybe Bool
-> Maybe TruckDimensions
-> Maybe Bool
-> CalculateRouteTruckModeOptions
CalculateRouteTruckModeOptions'
    { $sel:weight:CalculateRouteTruckModeOptions' :: Maybe TruckWeight
weight =
        Maybe TruckWeight
forall a. Maybe a
Prelude.Nothing,
      $sel:avoidTolls:CalculateRouteTruckModeOptions' :: Maybe Bool
avoidTolls = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:dimensions:CalculateRouteTruckModeOptions' :: Maybe TruckDimensions
dimensions = Maybe TruckDimensions
forall a. Maybe a
Prelude.Nothing,
      $sel:avoidFerries:CalculateRouteTruckModeOptions' :: Maybe Bool
avoidFerries = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the truck\'s weight specifications including total weight and
-- unit of measurement. Used to avoid roads that can\'t support the
-- truck\'s weight.
calculateRouteTruckModeOptions_weight :: Lens.Lens' CalculateRouteTruckModeOptions (Prelude.Maybe TruckWeight)
calculateRouteTruckModeOptions_weight :: (Maybe TruckWeight -> f (Maybe TruckWeight))
-> CalculateRouteTruckModeOptions
-> f CalculateRouteTruckModeOptions
calculateRouteTruckModeOptions_weight = (CalculateRouteTruckModeOptions -> Maybe TruckWeight)
-> (CalculateRouteTruckModeOptions
    -> Maybe TruckWeight -> CalculateRouteTruckModeOptions)
-> Lens
     CalculateRouteTruckModeOptions
     CalculateRouteTruckModeOptions
     (Maybe TruckWeight)
     (Maybe TruckWeight)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CalculateRouteTruckModeOptions' {Maybe TruckWeight
weight :: Maybe TruckWeight
$sel:weight:CalculateRouteTruckModeOptions' :: CalculateRouteTruckModeOptions -> Maybe TruckWeight
weight} -> Maybe TruckWeight
weight) (\s :: CalculateRouteTruckModeOptions
s@CalculateRouteTruckModeOptions' {} Maybe TruckWeight
a -> CalculateRouteTruckModeOptions
s {$sel:weight:CalculateRouteTruckModeOptions' :: Maybe TruckWeight
weight = Maybe TruckWeight
a} :: CalculateRouteTruckModeOptions)

-- | Avoids ferries when calculating routes.
--
-- Default Value: @false@
--
-- Valid Values: @false@ | @true@
calculateRouteTruckModeOptions_avoidTolls :: Lens.Lens' CalculateRouteTruckModeOptions (Prelude.Maybe Prelude.Bool)
calculateRouteTruckModeOptions_avoidTolls :: (Maybe Bool -> f (Maybe Bool))
-> CalculateRouteTruckModeOptions
-> f CalculateRouteTruckModeOptions
calculateRouteTruckModeOptions_avoidTolls = (CalculateRouteTruckModeOptions -> Maybe Bool)
-> (CalculateRouteTruckModeOptions
    -> Maybe Bool -> CalculateRouteTruckModeOptions)
-> Lens
     CalculateRouteTruckModeOptions
     CalculateRouteTruckModeOptions
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CalculateRouteTruckModeOptions' {Maybe Bool
avoidTolls :: Maybe Bool
$sel:avoidTolls:CalculateRouteTruckModeOptions' :: CalculateRouteTruckModeOptions -> Maybe Bool
avoidTolls} -> Maybe Bool
avoidTolls) (\s :: CalculateRouteTruckModeOptions
s@CalculateRouteTruckModeOptions' {} Maybe Bool
a -> CalculateRouteTruckModeOptions
s {$sel:avoidTolls:CalculateRouteTruckModeOptions' :: Maybe Bool
avoidTolls = Maybe Bool
a} :: CalculateRouteTruckModeOptions)

-- | Specifies the truck\'s dimension specifications including length,
-- height, width, and unit of measurement. Used to avoid roads that can\'t
-- support the truck\'s dimensions.
calculateRouteTruckModeOptions_dimensions :: Lens.Lens' CalculateRouteTruckModeOptions (Prelude.Maybe TruckDimensions)
calculateRouteTruckModeOptions_dimensions :: (Maybe TruckDimensions -> f (Maybe TruckDimensions))
-> CalculateRouteTruckModeOptions
-> f CalculateRouteTruckModeOptions
calculateRouteTruckModeOptions_dimensions = (CalculateRouteTruckModeOptions -> Maybe TruckDimensions)
-> (CalculateRouteTruckModeOptions
    -> Maybe TruckDimensions -> CalculateRouteTruckModeOptions)
-> Lens
     CalculateRouteTruckModeOptions
     CalculateRouteTruckModeOptions
     (Maybe TruckDimensions)
     (Maybe TruckDimensions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CalculateRouteTruckModeOptions' {Maybe TruckDimensions
dimensions :: Maybe TruckDimensions
$sel:dimensions:CalculateRouteTruckModeOptions' :: CalculateRouteTruckModeOptions -> Maybe TruckDimensions
dimensions} -> Maybe TruckDimensions
dimensions) (\s :: CalculateRouteTruckModeOptions
s@CalculateRouteTruckModeOptions' {} Maybe TruckDimensions
a -> CalculateRouteTruckModeOptions
s {$sel:dimensions:CalculateRouteTruckModeOptions' :: Maybe TruckDimensions
dimensions = Maybe TruckDimensions
a} :: CalculateRouteTruckModeOptions)

-- | Avoids ferries when calculating routes.
--
-- Default Value: @false@
--
-- Valid Values: @false@ | @true@
calculateRouteTruckModeOptions_avoidFerries :: Lens.Lens' CalculateRouteTruckModeOptions (Prelude.Maybe Prelude.Bool)
calculateRouteTruckModeOptions_avoidFerries :: (Maybe Bool -> f (Maybe Bool))
-> CalculateRouteTruckModeOptions
-> f CalculateRouteTruckModeOptions
calculateRouteTruckModeOptions_avoidFerries = (CalculateRouteTruckModeOptions -> Maybe Bool)
-> (CalculateRouteTruckModeOptions
    -> Maybe Bool -> CalculateRouteTruckModeOptions)
-> Lens
     CalculateRouteTruckModeOptions
     CalculateRouteTruckModeOptions
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CalculateRouteTruckModeOptions' {Maybe Bool
avoidFerries :: Maybe Bool
$sel:avoidFerries:CalculateRouteTruckModeOptions' :: CalculateRouteTruckModeOptions -> Maybe Bool
avoidFerries} -> Maybe Bool
avoidFerries) (\s :: CalculateRouteTruckModeOptions
s@CalculateRouteTruckModeOptions' {} Maybe Bool
a -> CalculateRouteTruckModeOptions
s {$sel:avoidFerries:CalculateRouteTruckModeOptions' :: Maybe Bool
avoidFerries = Maybe Bool
a} :: CalculateRouteTruckModeOptions)

instance
  Prelude.Hashable
    CalculateRouteTruckModeOptions

instance
  Prelude.NFData
    CalculateRouteTruckModeOptions

instance Core.ToJSON CalculateRouteTruckModeOptions where
  toJSON :: CalculateRouteTruckModeOptions -> Value
toJSON CalculateRouteTruckModeOptions' {Maybe Bool
Maybe TruckDimensions
Maybe TruckWeight
avoidFerries :: Maybe Bool
dimensions :: Maybe TruckDimensions
avoidTolls :: Maybe Bool
weight :: Maybe TruckWeight
$sel:avoidFerries:CalculateRouteTruckModeOptions' :: CalculateRouteTruckModeOptions -> Maybe Bool
$sel:dimensions:CalculateRouteTruckModeOptions' :: CalculateRouteTruckModeOptions -> Maybe TruckDimensions
$sel:avoidTolls:CalculateRouteTruckModeOptions' :: CalculateRouteTruckModeOptions -> Maybe Bool
$sel:weight:CalculateRouteTruckModeOptions' :: CalculateRouteTruckModeOptions -> Maybe TruckWeight
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Weight" Text -> TruckWeight -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TruckWeight -> Pair) -> Maybe TruckWeight -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TruckWeight
weight,
            (Text
"AvoidTolls" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
avoidTolls,
            (Text
"Dimensions" Text -> TruckDimensions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TruckDimensions -> Pair) -> Maybe TruckDimensions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TruckDimensions
dimensions,
            (Text
"AvoidFerries" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
avoidFerries
          ]
      )