{-# 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 #-}
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
data CalculateRouteTruckModeOptions = CalculateRouteTruckModeOptions'
{
CalculateRouteTruckModeOptions -> Maybe TruckWeight
weight :: Prelude.Maybe TruckWeight,
CalculateRouteTruckModeOptions -> Maybe Bool
avoidTolls :: Prelude.Maybe Prelude.Bool,
CalculateRouteTruckModeOptions -> Maybe TruckDimensions
dimensions :: Prelude.Maybe TruckDimensions,
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)
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
}
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)
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)
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)
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
]
)