{-# 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.Step where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Step = Step'
{
Step -> Maybe Natural
geometryOffset :: Prelude.Maybe Prelude.Natural,
Step -> Double
distance :: Prelude.Double,
Step -> Double
durationSeconds :: Prelude.Double,
Step -> Sensitive (NonEmpty Double)
endPosition :: Core.Sensitive (Prelude.NonEmpty Prelude.Double),
Step -> Sensitive (NonEmpty Double)
startPosition :: Core.Sensitive (Prelude.NonEmpty Prelude.Double)
}
deriving (Step -> Step -> Bool
(Step -> Step -> Bool) -> (Step -> Step -> Bool) -> Eq Step
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Step -> Step -> Bool
$c/= :: Step -> Step -> Bool
== :: Step -> Step -> Bool
$c== :: Step -> Step -> Bool
Prelude.Eq, Int -> Step -> ShowS
[Step] -> ShowS
Step -> String
(Int -> Step -> ShowS)
-> (Step -> String) -> ([Step] -> ShowS) -> Show Step
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Step] -> ShowS
$cshowList :: [Step] -> ShowS
show :: Step -> String
$cshow :: Step -> String
showsPrec :: Int -> Step -> ShowS
$cshowsPrec :: Int -> Step -> ShowS
Prelude.Show, (forall x. Step -> Rep Step x)
-> (forall x. Rep Step x -> Step) -> Generic Step
forall x. Rep Step x -> Step
forall x. Step -> Rep Step x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Step x -> Step
$cfrom :: forall x. Step -> Rep Step x
Prelude.Generic)
newStep ::
Prelude.Double ->
Prelude.Double ->
Prelude.NonEmpty Prelude.Double ->
Prelude.NonEmpty Prelude.Double ->
Step
newStep :: Double -> Double -> NonEmpty Double -> NonEmpty Double -> Step
newStep
Double
pDistance_
Double
pDurationSeconds_
NonEmpty Double
pEndPosition_
NonEmpty Double
pStartPosition_ =
Step' :: Maybe Natural
-> Double
-> Double
-> Sensitive (NonEmpty Double)
-> Sensitive (NonEmpty Double)
-> Step
Step'
{ $sel:geometryOffset:Step' :: Maybe Natural
geometryOffset = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:distance:Step' :: Double
distance = Double
pDistance_,
$sel:durationSeconds:Step' :: Double
durationSeconds = Double
pDurationSeconds_,
$sel:endPosition:Step' :: Sensitive (NonEmpty Double)
endPosition =
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
pEndPosition_,
$sel:startPosition:Step' :: Sensitive (NonEmpty Double)
startPosition =
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
pStartPosition_
}
step_geometryOffset :: Lens.Lens' Step (Prelude.Maybe Prelude.Natural)
step_geometryOffset :: (Maybe Natural -> f (Maybe Natural)) -> Step -> f Step
step_geometryOffset = (Step -> Maybe Natural)
-> (Step -> Maybe Natural -> Step)
-> Lens Step Step (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Maybe Natural
geometryOffset :: Maybe Natural
$sel:geometryOffset:Step' :: Step -> Maybe Natural
geometryOffset} -> Maybe Natural
geometryOffset) (\s :: Step
s@Step' {} Maybe Natural
a -> Step
s {$sel:geometryOffset:Step' :: Maybe Natural
geometryOffset = Maybe Natural
a} :: Step)
step_distance :: Lens.Lens' Step Prelude.Double
step_distance :: (Double -> f Double) -> Step -> f Step
step_distance = (Step -> Double)
-> (Step -> Double -> Step) -> Lens Step Step Double Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Double
distance :: Double
$sel:distance:Step' :: Step -> Double
distance} -> Double
distance) (\s :: Step
s@Step' {} Double
a -> Step
s {$sel:distance:Step' :: Double
distance = Double
a} :: Step)
step_durationSeconds :: Lens.Lens' Step Prelude.Double
step_durationSeconds :: (Double -> f Double) -> Step -> f Step
step_durationSeconds = (Step -> Double)
-> (Step -> Double -> Step) -> Lens Step Step Double Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Double
durationSeconds :: Double
$sel:durationSeconds:Step' :: Step -> Double
durationSeconds} -> Double
durationSeconds) (\s :: Step
s@Step' {} Double
a -> Step
s {$sel:durationSeconds:Step' :: Double
durationSeconds = Double
a} :: Step)
step_endPosition :: Lens.Lens' Step (Prelude.NonEmpty Prelude.Double)
step_endPosition :: (NonEmpty Double -> f (NonEmpty Double)) -> Step -> f Step
step_endPosition = (Step -> Sensitive (NonEmpty Double))
-> (Step -> Sensitive (NonEmpty Double) -> Step)
-> Lens
Step
Step
(Sensitive (NonEmpty Double))
(Sensitive (NonEmpty Double))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Sensitive (NonEmpty Double)
endPosition :: Sensitive (NonEmpty Double)
$sel:endPosition:Step' :: Step -> Sensitive (NonEmpty Double)
endPosition} -> Sensitive (NonEmpty Double)
endPosition) (\s :: Step
s@Step' {} Sensitive (NonEmpty Double)
a -> Step
s {$sel:endPosition:Step' :: Sensitive (NonEmpty Double)
endPosition = Sensitive (NonEmpty Double)
a} :: Step) ((Sensitive (NonEmpty Double) -> f (Sensitive (NonEmpty Double)))
-> Step -> f Step)
-> ((NonEmpty Double -> f (NonEmpty Double))
-> Sensitive (NonEmpty Double) -> f (Sensitive (NonEmpty Double)))
-> (NonEmpty Double -> f (NonEmpty Double))
-> Step
-> f Step
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
step_startPosition :: Lens.Lens' Step (Prelude.NonEmpty Prelude.Double)
step_startPosition :: (NonEmpty Double -> f (NonEmpty Double)) -> Step -> f Step
step_startPosition = (Step -> Sensitive (NonEmpty Double))
-> (Step -> Sensitive (NonEmpty Double) -> Step)
-> Lens
Step
Step
(Sensitive (NonEmpty Double))
(Sensitive (NonEmpty Double))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Step' {Sensitive (NonEmpty Double)
startPosition :: Sensitive (NonEmpty Double)
$sel:startPosition:Step' :: Step -> Sensitive (NonEmpty Double)
startPosition} -> Sensitive (NonEmpty Double)
startPosition) (\s :: Step
s@Step' {} Sensitive (NonEmpty Double)
a -> Step
s {$sel:startPosition:Step' :: Sensitive (NonEmpty Double)
startPosition = Sensitive (NonEmpty Double)
a} :: Step) ((Sensitive (NonEmpty Double) -> f (Sensitive (NonEmpty Double)))
-> Step -> f Step)
-> ((NonEmpty Double -> f (NonEmpty Double))
-> Sensitive (NonEmpty Double) -> f (Sensitive (NonEmpty Double)))
-> (NonEmpty Double -> f (NonEmpty Double))
-> Step
-> f Step
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 Step where
parseJSON :: Value -> Parser Step
parseJSON =
String -> (Object -> Parser Step) -> Value -> Parser Step
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Step"
( \Object
x ->
Maybe Natural
-> Double
-> Double
-> Sensitive (NonEmpty Double)
-> Sensitive (NonEmpty Double)
-> Step
Step'
(Maybe Natural
-> Double
-> Double
-> Sensitive (NonEmpty Double)
-> Sensitive (NonEmpty Double)
-> Step)
-> Parser (Maybe Natural)
-> Parser
(Double
-> Double
-> Sensitive (NonEmpty Double)
-> Sensitive (NonEmpty Double)
-> Step)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GeometryOffset")
Parser
(Double
-> Double
-> Sensitive (NonEmpty Double)
-> Sensitive (NonEmpty Double)
-> Step)
-> Parser Double
-> Parser
(Double
-> Sensitive (NonEmpty Double)
-> Sensitive (NonEmpty Double)
-> Step)
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
(Double
-> Sensitive (NonEmpty Double)
-> Sensitive (NonEmpty Double)
-> Step)
-> Parser Double
-> Parser
(Sensitive (NonEmpty Double)
-> Sensitive (NonEmpty Double) -> Step)
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)
-> Sensitive (NonEmpty Double) -> Step)
-> Parser (Sensitive (NonEmpty Double))
-> Parser (Sensitive (NonEmpty Double) -> Step)
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
"EndPosition")
Parser (Sensitive (NonEmpty Double) -> Step)
-> Parser (Sensitive (NonEmpty Double)) -> Parser Step
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
"StartPosition")
)
instance Prelude.Hashable Step
instance Prelude.NFData Step