{-# 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.TruckDimensions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Location.Types.DimensionUnit
import qualified Amazonka.Prelude as Prelude
data TruckDimensions = TruckDimensions'
{
TruckDimensions -> Maybe Double
length :: Prelude.Maybe Prelude.Double,
TruckDimensions -> Maybe Double
height :: Prelude.Maybe Prelude.Double,
TruckDimensions -> Maybe Double
width :: Prelude.Maybe Prelude.Double,
TruckDimensions -> Maybe DimensionUnit
unit :: Prelude.Maybe DimensionUnit
}
deriving (TruckDimensions -> TruckDimensions -> Bool
(TruckDimensions -> TruckDimensions -> Bool)
-> (TruckDimensions -> TruckDimensions -> Bool)
-> Eq TruckDimensions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TruckDimensions -> TruckDimensions -> Bool
$c/= :: TruckDimensions -> TruckDimensions -> Bool
== :: TruckDimensions -> TruckDimensions -> Bool
$c== :: TruckDimensions -> TruckDimensions -> Bool
Prelude.Eq, ReadPrec [TruckDimensions]
ReadPrec TruckDimensions
Int -> ReadS TruckDimensions
ReadS [TruckDimensions]
(Int -> ReadS TruckDimensions)
-> ReadS [TruckDimensions]
-> ReadPrec TruckDimensions
-> ReadPrec [TruckDimensions]
-> Read TruckDimensions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TruckDimensions]
$creadListPrec :: ReadPrec [TruckDimensions]
readPrec :: ReadPrec TruckDimensions
$creadPrec :: ReadPrec TruckDimensions
readList :: ReadS [TruckDimensions]
$creadList :: ReadS [TruckDimensions]
readsPrec :: Int -> ReadS TruckDimensions
$creadsPrec :: Int -> ReadS TruckDimensions
Prelude.Read, Int -> TruckDimensions -> ShowS
[TruckDimensions] -> ShowS
TruckDimensions -> String
(Int -> TruckDimensions -> ShowS)
-> (TruckDimensions -> String)
-> ([TruckDimensions] -> ShowS)
-> Show TruckDimensions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TruckDimensions] -> ShowS
$cshowList :: [TruckDimensions] -> ShowS
show :: TruckDimensions -> String
$cshow :: TruckDimensions -> String
showsPrec :: Int -> TruckDimensions -> ShowS
$cshowsPrec :: Int -> TruckDimensions -> ShowS
Prelude.Show, (forall x. TruckDimensions -> Rep TruckDimensions x)
-> (forall x. Rep TruckDimensions x -> TruckDimensions)
-> Generic TruckDimensions
forall x. Rep TruckDimensions x -> TruckDimensions
forall x. TruckDimensions -> Rep TruckDimensions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TruckDimensions x -> TruckDimensions
$cfrom :: forall x. TruckDimensions -> Rep TruckDimensions x
Prelude.Generic)
newTruckDimensions ::
TruckDimensions
newTruckDimensions :: TruckDimensions
newTruckDimensions =
TruckDimensions' :: Maybe Double
-> Maybe Double
-> Maybe Double
-> Maybe DimensionUnit
-> TruckDimensions
TruckDimensions'
{ $sel:length:TruckDimensions' :: Maybe Double
length = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:height:TruckDimensions' :: Maybe Double
height = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:width:TruckDimensions' :: Maybe Double
width = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:unit:TruckDimensions' :: Maybe DimensionUnit
unit = Maybe DimensionUnit
forall a. Maybe a
Prelude.Nothing
}
truckDimensions_length :: Lens.Lens' TruckDimensions (Prelude.Maybe Prelude.Double)
truckDimensions_length :: (Maybe Double -> f (Maybe Double))
-> TruckDimensions -> f TruckDimensions
truckDimensions_length = (TruckDimensions -> Maybe Double)
-> (TruckDimensions -> Maybe Double -> TruckDimensions)
-> Lens
TruckDimensions TruckDimensions (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TruckDimensions' {Maybe Double
length :: Maybe Double
$sel:length:TruckDimensions' :: TruckDimensions -> Maybe Double
length} -> Maybe Double
length) (\s :: TruckDimensions
s@TruckDimensions' {} Maybe Double
a -> TruckDimensions
s {$sel:length:TruckDimensions' :: Maybe Double
length = Maybe Double
a} :: TruckDimensions)
truckDimensions_height :: Lens.Lens' TruckDimensions (Prelude.Maybe Prelude.Double)
truckDimensions_height :: (Maybe Double -> f (Maybe Double))
-> TruckDimensions -> f TruckDimensions
truckDimensions_height = (TruckDimensions -> Maybe Double)
-> (TruckDimensions -> Maybe Double -> TruckDimensions)
-> Lens
TruckDimensions TruckDimensions (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TruckDimensions' {Maybe Double
height :: Maybe Double
$sel:height:TruckDimensions' :: TruckDimensions -> Maybe Double
height} -> Maybe Double
height) (\s :: TruckDimensions
s@TruckDimensions' {} Maybe Double
a -> TruckDimensions
s {$sel:height:TruckDimensions' :: Maybe Double
height = Maybe Double
a} :: TruckDimensions)
truckDimensions_width :: Lens.Lens' TruckDimensions (Prelude.Maybe Prelude.Double)
truckDimensions_width :: (Maybe Double -> f (Maybe Double))
-> TruckDimensions -> f TruckDimensions
truckDimensions_width = (TruckDimensions -> Maybe Double)
-> (TruckDimensions -> Maybe Double -> TruckDimensions)
-> Lens
TruckDimensions TruckDimensions (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TruckDimensions' {Maybe Double
width :: Maybe Double
$sel:width:TruckDimensions' :: TruckDimensions -> Maybe Double
width} -> Maybe Double
width) (\s :: TruckDimensions
s@TruckDimensions' {} Maybe Double
a -> TruckDimensions
s {$sel:width:TruckDimensions' :: Maybe Double
width = Maybe Double
a} :: TruckDimensions)
truckDimensions_unit :: Lens.Lens' TruckDimensions (Prelude.Maybe DimensionUnit)
truckDimensions_unit :: (Maybe DimensionUnit -> f (Maybe DimensionUnit))
-> TruckDimensions -> f TruckDimensions
truckDimensions_unit = (TruckDimensions -> Maybe DimensionUnit)
-> (TruckDimensions -> Maybe DimensionUnit -> TruckDimensions)
-> Lens
TruckDimensions
TruckDimensions
(Maybe DimensionUnit)
(Maybe DimensionUnit)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TruckDimensions' {Maybe DimensionUnit
unit :: Maybe DimensionUnit
$sel:unit:TruckDimensions' :: TruckDimensions -> Maybe DimensionUnit
unit} -> Maybe DimensionUnit
unit) (\s :: TruckDimensions
s@TruckDimensions' {} Maybe DimensionUnit
a -> TruckDimensions
s {$sel:unit:TruckDimensions' :: Maybe DimensionUnit
unit = Maybe DimensionUnit
a} :: TruckDimensions)
instance Prelude.Hashable TruckDimensions
instance Prelude.NFData TruckDimensions
instance Core.ToJSON TruckDimensions where
toJSON :: TruckDimensions -> Value
toJSON TruckDimensions' {Maybe Double
Maybe DimensionUnit
unit :: Maybe DimensionUnit
width :: Maybe Double
height :: Maybe Double
length :: Maybe Double
$sel:unit:TruckDimensions' :: TruckDimensions -> Maybe DimensionUnit
$sel:width:TruckDimensions' :: TruckDimensions -> Maybe Double
$sel:height:TruckDimensions' :: TruckDimensions -> Maybe Double
$sel:length:TruckDimensions' :: TruckDimensions -> Maybe Double
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Length" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
length,
(Text
"Height" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
height,
(Text
"Width" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Double -> Pair) -> Maybe Double -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
width,
(Text
"Unit" Text -> DimensionUnit -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DimensionUnit -> Pair) -> Maybe DimensionUnit -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DimensionUnit
unit
]
)