{-# 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.CalculateRouteSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Location.Types.DistanceUnit
import qualified Amazonka.Prelude as Prelude
data CalculateRouteSummary = CalculateRouteSummary'
{
CalculateRouteSummary -> Text
dataSource :: Prelude.Text,
CalculateRouteSummary -> Double
distance :: Prelude.Double,
CalculateRouteSummary -> DistanceUnit
distanceUnit :: DistanceUnit,
CalculateRouteSummary -> Double
durationSeconds :: Prelude.Double,
CalculateRouteSummary -> Sensitive (NonEmpty Double)
routeBBox :: Core.Sensitive (Prelude.NonEmpty Prelude.Double)
}
deriving (CalculateRouteSummary -> CalculateRouteSummary -> Bool
(CalculateRouteSummary -> CalculateRouteSummary -> Bool)
-> (CalculateRouteSummary -> CalculateRouteSummary -> Bool)
-> Eq CalculateRouteSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CalculateRouteSummary -> CalculateRouteSummary -> Bool
$c/= :: CalculateRouteSummary -> CalculateRouteSummary -> Bool
== :: CalculateRouteSummary -> CalculateRouteSummary -> Bool
$c== :: CalculateRouteSummary -> CalculateRouteSummary -> Bool
Prelude.Eq, Int -> CalculateRouteSummary -> ShowS
[CalculateRouteSummary] -> ShowS
CalculateRouteSummary -> String
(Int -> CalculateRouteSummary -> ShowS)
-> (CalculateRouteSummary -> String)
-> ([CalculateRouteSummary] -> ShowS)
-> Show CalculateRouteSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CalculateRouteSummary] -> ShowS
$cshowList :: [CalculateRouteSummary] -> ShowS
show :: CalculateRouteSummary -> String
$cshow :: CalculateRouteSummary -> String
showsPrec :: Int -> CalculateRouteSummary -> ShowS
$cshowsPrec :: Int -> CalculateRouteSummary -> ShowS
Prelude.Show, (forall x. CalculateRouteSummary -> Rep CalculateRouteSummary x)
-> (forall x. Rep CalculateRouteSummary x -> CalculateRouteSummary)
-> Generic CalculateRouteSummary
forall x. Rep CalculateRouteSummary x -> CalculateRouteSummary
forall x. CalculateRouteSummary -> Rep CalculateRouteSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CalculateRouteSummary x -> CalculateRouteSummary
$cfrom :: forall x. CalculateRouteSummary -> Rep CalculateRouteSummary x
Prelude.Generic)
newCalculateRouteSummary ::
Prelude.Text ->
Prelude.Double ->
DistanceUnit ->
Prelude.Double ->
Prelude.NonEmpty Prelude.Double ->
CalculateRouteSummary
newCalculateRouteSummary :: Text
-> Double
-> DistanceUnit
-> Double
-> NonEmpty Double
-> CalculateRouteSummary
newCalculateRouteSummary
Text
pDataSource_
Double
pDistance_
DistanceUnit
pDistanceUnit_
Double
pDurationSeconds_
NonEmpty Double
pRouteBBox_ =
CalculateRouteSummary' :: Text
-> Double
-> DistanceUnit
-> Double
-> Sensitive (NonEmpty Double)
-> CalculateRouteSummary
CalculateRouteSummary'
{ $sel:dataSource:CalculateRouteSummary' :: Text
dataSource = Text
pDataSource_,
$sel:distance:CalculateRouteSummary' :: Double
distance = Double
pDistance_,
$sel:distanceUnit:CalculateRouteSummary' :: DistanceUnit
distanceUnit = DistanceUnit
pDistanceUnit_,
$sel:durationSeconds:CalculateRouteSummary' :: Double
durationSeconds = Double
pDurationSeconds_,
$sel:routeBBox:CalculateRouteSummary' :: Sensitive (NonEmpty Double)
routeBBox =
Tagged (NonEmpty Double) (Identity (NonEmpty Double))
-> Tagged
(Sensitive (NonEmpty Double))
(Identity (Sensitive (NonEmpty Double)))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged (NonEmpty Double) (Identity (NonEmpty Double))
-> Tagged
(Sensitive (NonEmpty Double))
(Identity (Sensitive (NonEmpty Double))))
-> (Tagged (NonEmpty Double) (Identity (NonEmpty Double))
-> Tagged (NonEmpty Double) (Identity (NonEmpty Double)))
-> Tagged (NonEmpty Double) (Identity (NonEmpty Double))
-> Tagged
(Sensitive (NonEmpty Double))
(Identity (Sensitive (NonEmpty Double)))
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Tagged (NonEmpty Double) (Identity (NonEmpty Double))
-> Tagged (NonEmpty Double) (Identity (NonEmpty Double))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
(Tagged (NonEmpty Double) (Identity (NonEmpty Double))
-> Tagged
(Sensitive (NonEmpty Double))
(Identity (Sensitive (NonEmpty Double))))
-> NonEmpty Double -> Sensitive (NonEmpty Double)
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Double
pRouteBBox_
}
calculateRouteSummary_dataSource :: Lens.Lens' CalculateRouteSummary Prelude.Text
calculateRouteSummary_dataSource :: (Text -> f Text)
-> CalculateRouteSummary -> f CalculateRouteSummary
calculateRouteSummary_dataSource = (CalculateRouteSummary -> Text)
-> (CalculateRouteSummary -> Text -> CalculateRouteSummary)
-> Lens CalculateRouteSummary CalculateRouteSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CalculateRouteSummary' {Text
dataSource :: Text
$sel:dataSource:CalculateRouteSummary' :: CalculateRouteSummary -> Text
dataSource} -> Text
dataSource) (\s :: CalculateRouteSummary
s@CalculateRouteSummary' {} Text
a -> CalculateRouteSummary
s {$sel:dataSource:CalculateRouteSummary' :: Text
dataSource = Text
a} :: CalculateRouteSummary)
calculateRouteSummary_distance :: Lens.Lens' CalculateRouteSummary Prelude.Double
calculateRouteSummary_distance :: (Double -> f Double)
-> CalculateRouteSummary -> f CalculateRouteSummary
calculateRouteSummary_distance = (CalculateRouteSummary -> Double)
-> (CalculateRouteSummary -> Double -> CalculateRouteSummary)
-> Lens CalculateRouteSummary CalculateRouteSummary Double Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CalculateRouteSummary' {Double
distance :: Double
$sel:distance:CalculateRouteSummary' :: CalculateRouteSummary -> Double
distance} -> Double
distance) (\s :: CalculateRouteSummary
s@CalculateRouteSummary' {} Double
a -> CalculateRouteSummary
s {$sel:distance:CalculateRouteSummary' :: Double
distance = Double
a} :: CalculateRouteSummary)
calculateRouteSummary_distanceUnit :: Lens.Lens' CalculateRouteSummary DistanceUnit
calculateRouteSummary_distanceUnit :: (DistanceUnit -> f DistanceUnit)
-> CalculateRouteSummary -> f CalculateRouteSummary
calculateRouteSummary_distanceUnit = (CalculateRouteSummary -> DistanceUnit)
-> (CalculateRouteSummary -> DistanceUnit -> CalculateRouteSummary)
-> Lens
CalculateRouteSummary
CalculateRouteSummary
DistanceUnit
DistanceUnit
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CalculateRouteSummary' {DistanceUnit
distanceUnit :: DistanceUnit
$sel:distanceUnit:CalculateRouteSummary' :: CalculateRouteSummary -> DistanceUnit
distanceUnit} -> DistanceUnit
distanceUnit) (\s :: CalculateRouteSummary
s@CalculateRouteSummary' {} DistanceUnit
a -> CalculateRouteSummary
s {$sel:distanceUnit:CalculateRouteSummary' :: DistanceUnit
distanceUnit = DistanceUnit
a} :: CalculateRouteSummary)
calculateRouteSummary_durationSeconds :: Lens.Lens' CalculateRouteSummary Prelude.Double
calculateRouteSummary_durationSeconds :: (Double -> f Double)
-> CalculateRouteSummary -> f CalculateRouteSummary
calculateRouteSummary_durationSeconds = (CalculateRouteSummary -> Double)
-> (CalculateRouteSummary -> Double -> CalculateRouteSummary)
-> Lens CalculateRouteSummary CalculateRouteSummary Double Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CalculateRouteSummary' {Double
durationSeconds :: Double
$sel:durationSeconds:CalculateRouteSummary' :: CalculateRouteSummary -> Double
durationSeconds} -> Double
durationSeconds) (\s :: CalculateRouteSummary
s@CalculateRouteSummary' {} Double
a -> CalculateRouteSummary
s {$sel:durationSeconds:CalculateRouteSummary' :: Double
durationSeconds = Double
a} :: CalculateRouteSummary)
calculateRouteSummary_routeBBox :: Lens.Lens' CalculateRouteSummary (Prelude.NonEmpty Prelude.Double)
calculateRouteSummary_routeBBox :: (NonEmpty Double -> f (NonEmpty Double))
-> CalculateRouteSummary -> f CalculateRouteSummary
calculateRouteSummary_routeBBox = (CalculateRouteSummary -> Sensitive (NonEmpty Double))
-> (CalculateRouteSummary
-> Sensitive (NonEmpty Double) -> CalculateRouteSummary)
-> Lens
CalculateRouteSummary
CalculateRouteSummary
(Sensitive (NonEmpty Double))
(Sensitive (NonEmpty Double))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CalculateRouteSummary' {Sensitive (NonEmpty Double)
routeBBox :: Sensitive (NonEmpty Double)
$sel:routeBBox:CalculateRouteSummary' :: CalculateRouteSummary -> Sensitive (NonEmpty Double)
routeBBox} -> Sensitive (NonEmpty Double)
routeBBox) (\s :: CalculateRouteSummary
s@CalculateRouteSummary' {} Sensitive (NonEmpty Double)
a -> CalculateRouteSummary
s {$sel:routeBBox:CalculateRouteSummary' :: Sensitive (NonEmpty Double)
routeBBox = Sensitive (NonEmpty Double)
a} :: CalculateRouteSummary) ((Sensitive (NonEmpty Double) -> f (Sensitive (NonEmpty Double)))
-> CalculateRouteSummary -> f CalculateRouteSummary)
-> ((NonEmpty Double -> f (NonEmpty Double))
-> Sensitive (NonEmpty Double) -> f (Sensitive (NonEmpty Double)))
-> (NonEmpty Double -> f (NonEmpty Double))
-> CalculateRouteSummary
-> f CalculateRouteSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Double -> f (NonEmpty Double))
-> Sensitive (NonEmpty Double) -> f (Sensitive (NonEmpty Double))
forall a. Iso' (Sensitive a) a
Core._Sensitive ((NonEmpty Double -> f (NonEmpty Double))
-> Sensitive (NonEmpty Double) -> f (Sensitive (NonEmpty Double)))
-> ((NonEmpty Double -> f (NonEmpty Double))
-> NonEmpty Double -> f (NonEmpty Double))
-> (NonEmpty Double -> f (NonEmpty Double))
-> Sensitive (NonEmpty Double)
-> f (Sensitive (NonEmpty Double))
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Double -> f (NonEmpty Double))
-> NonEmpty Double -> f (NonEmpty Double)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON CalculateRouteSummary where
parseJSON :: Value -> Parser CalculateRouteSummary
parseJSON =
String
-> (Object -> Parser CalculateRouteSummary)
-> Value
-> Parser CalculateRouteSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CalculateRouteSummary"
( \Object
x ->
Text
-> Double
-> DistanceUnit
-> Double
-> Sensitive (NonEmpty Double)
-> CalculateRouteSummary
CalculateRouteSummary'
(Text
-> Double
-> DistanceUnit
-> Double
-> Sensitive (NonEmpty Double)
-> CalculateRouteSummary)
-> Parser Text
-> Parser
(Double
-> DistanceUnit
-> Double
-> Sensitive (NonEmpty Double)
-> CalculateRouteSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DataSource")
Parser
(Double
-> DistanceUnit
-> Double
-> Sensitive (NonEmpty Double)
-> CalculateRouteSummary)
-> Parser Double
-> Parser
(DistanceUnit
-> Double -> Sensitive (NonEmpty Double) -> CalculateRouteSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Double
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Distance")
Parser
(DistanceUnit
-> Double -> Sensitive (NonEmpty Double) -> CalculateRouteSummary)
-> Parser DistanceUnit
-> Parser
(Double -> Sensitive (NonEmpty Double) -> CalculateRouteSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DistanceUnit
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DistanceUnit")
Parser
(Double -> Sensitive (NonEmpty Double) -> CalculateRouteSummary)
-> Parser Double
-> Parser (Sensitive (NonEmpty Double) -> CalculateRouteSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Double
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DurationSeconds")
Parser (Sensitive (NonEmpty Double) -> CalculateRouteSummary)
-> Parser (Sensitive (NonEmpty Double))
-> Parser CalculateRouteSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Sensitive (NonEmpty Double))
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RouteBBox")
)
instance Prelude.Hashable CalculateRouteSummary
instance Prelude.NFData CalculateRouteSummary