{-# 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.ConnectParticipant.Types.StartPosition where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StartPosition = StartPosition'
{
StartPosition -> Maybe Text
absoluteTime :: Prelude.Maybe Prelude.Text,
StartPosition -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
StartPosition -> Maybe Natural
mostRecent :: Prelude.Maybe Prelude.Natural
}
deriving (StartPosition -> StartPosition -> Bool
(StartPosition -> StartPosition -> Bool)
-> (StartPosition -> StartPosition -> Bool) -> Eq StartPosition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartPosition -> StartPosition -> Bool
$c/= :: StartPosition -> StartPosition -> Bool
== :: StartPosition -> StartPosition -> Bool
$c== :: StartPosition -> StartPosition -> Bool
Prelude.Eq, ReadPrec [StartPosition]
ReadPrec StartPosition
Int -> ReadS StartPosition
ReadS [StartPosition]
(Int -> ReadS StartPosition)
-> ReadS [StartPosition]
-> ReadPrec StartPosition
-> ReadPrec [StartPosition]
-> Read StartPosition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartPosition]
$creadListPrec :: ReadPrec [StartPosition]
readPrec :: ReadPrec StartPosition
$creadPrec :: ReadPrec StartPosition
readList :: ReadS [StartPosition]
$creadList :: ReadS [StartPosition]
readsPrec :: Int -> ReadS StartPosition
$creadsPrec :: Int -> ReadS StartPosition
Prelude.Read, Int -> StartPosition -> ShowS
[StartPosition] -> ShowS
StartPosition -> String
(Int -> StartPosition -> ShowS)
-> (StartPosition -> String)
-> ([StartPosition] -> ShowS)
-> Show StartPosition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartPosition] -> ShowS
$cshowList :: [StartPosition] -> ShowS
show :: StartPosition -> String
$cshow :: StartPosition -> String
showsPrec :: Int -> StartPosition -> ShowS
$cshowsPrec :: Int -> StartPosition -> ShowS
Prelude.Show, (forall x. StartPosition -> Rep StartPosition x)
-> (forall x. Rep StartPosition x -> StartPosition)
-> Generic StartPosition
forall x. Rep StartPosition x -> StartPosition
forall x. StartPosition -> Rep StartPosition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartPosition x -> StartPosition
$cfrom :: forall x. StartPosition -> Rep StartPosition x
Prelude.Generic)
newStartPosition ::
StartPosition
newStartPosition :: StartPosition
newStartPosition =
StartPosition' :: Maybe Text -> Maybe Text -> Maybe Natural -> StartPosition
StartPosition'
{ $sel:absoluteTime:StartPosition' :: Maybe Text
absoluteTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:StartPosition' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:mostRecent:StartPosition' :: Maybe Natural
mostRecent = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
startPosition_absoluteTime :: Lens.Lens' StartPosition (Prelude.Maybe Prelude.Text)
startPosition_absoluteTime :: (Maybe Text -> f (Maybe Text)) -> StartPosition -> f StartPosition
startPosition_absoluteTime = (StartPosition -> Maybe Text)
-> (StartPosition -> Maybe Text -> StartPosition)
-> Lens StartPosition StartPosition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartPosition' {Maybe Text
absoluteTime :: Maybe Text
$sel:absoluteTime:StartPosition' :: StartPosition -> Maybe Text
absoluteTime} -> Maybe Text
absoluteTime) (\s :: StartPosition
s@StartPosition' {} Maybe Text
a -> StartPosition
s {$sel:absoluteTime:StartPosition' :: Maybe Text
absoluteTime = Maybe Text
a} :: StartPosition)
startPosition_id :: Lens.Lens' StartPosition (Prelude.Maybe Prelude.Text)
startPosition_id :: (Maybe Text -> f (Maybe Text)) -> StartPosition -> f StartPosition
startPosition_id = (StartPosition -> Maybe Text)
-> (StartPosition -> Maybe Text -> StartPosition)
-> Lens StartPosition StartPosition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartPosition' {Maybe Text
id :: Maybe Text
$sel:id:StartPosition' :: StartPosition -> Maybe Text
id} -> Maybe Text
id) (\s :: StartPosition
s@StartPosition' {} Maybe Text
a -> StartPosition
s {$sel:id:StartPosition' :: Maybe Text
id = Maybe Text
a} :: StartPosition)
startPosition_mostRecent :: Lens.Lens' StartPosition (Prelude.Maybe Prelude.Natural)
startPosition_mostRecent :: (Maybe Natural -> f (Maybe Natural))
-> StartPosition -> f StartPosition
startPosition_mostRecent = (StartPosition -> Maybe Natural)
-> (StartPosition -> Maybe Natural -> StartPosition)
-> Lens StartPosition StartPosition (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartPosition' {Maybe Natural
mostRecent :: Maybe Natural
$sel:mostRecent:StartPosition' :: StartPosition -> Maybe Natural
mostRecent} -> Maybe Natural
mostRecent) (\s :: StartPosition
s@StartPosition' {} Maybe Natural
a -> StartPosition
s {$sel:mostRecent:StartPosition' :: Maybe Natural
mostRecent = Maybe Natural
a} :: StartPosition)
instance Prelude.Hashable StartPosition
instance Prelude.NFData StartPosition
instance Core.ToJSON StartPosition where
toJSON :: StartPosition -> Value
toJSON StartPosition' {Maybe Natural
Maybe Text
mostRecent :: Maybe Natural
id :: Maybe Text
absoluteTime :: Maybe Text
$sel:mostRecent:StartPosition' :: StartPosition -> Maybe Natural
$sel:id:StartPosition' :: StartPosition -> Maybe Text
$sel:absoluteTime:StartPosition' :: StartPosition -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AbsoluteTime" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
absoluteTime,
(Text
"Id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
id,
(Text
"MostRecent" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
mostRecent
]
)