{-# 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.KinesisVideoMedia.Types.StartSelector where
import qualified Amazonka.Core as Core
import Amazonka.KinesisVideoMedia.Types.StartSelectorType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StartSelector = StartSelector'
{
StartSelector -> Maybe Text
continuationToken :: Prelude.Maybe Prelude.Text,
StartSelector -> Maybe Text
afterFragmentNumber :: Prelude.Maybe Prelude.Text,
StartSelector -> Maybe POSIX
startTimestamp :: Prelude.Maybe Core.POSIX,
StartSelector -> StartSelectorType
startSelectorType :: StartSelectorType
}
deriving (StartSelector -> StartSelector -> Bool
(StartSelector -> StartSelector -> Bool)
-> (StartSelector -> StartSelector -> Bool) -> Eq StartSelector
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartSelector -> StartSelector -> Bool
$c/= :: StartSelector -> StartSelector -> Bool
== :: StartSelector -> StartSelector -> Bool
$c== :: StartSelector -> StartSelector -> Bool
Prelude.Eq, ReadPrec [StartSelector]
ReadPrec StartSelector
Int -> ReadS StartSelector
ReadS [StartSelector]
(Int -> ReadS StartSelector)
-> ReadS [StartSelector]
-> ReadPrec StartSelector
-> ReadPrec [StartSelector]
-> Read StartSelector
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartSelector]
$creadListPrec :: ReadPrec [StartSelector]
readPrec :: ReadPrec StartSelector
$creadPrec :: ReadPrec StartSelector
readList :: ReadS [StartSelector]
$creadList :: ReadS [StartSelector]
readsPrec :: Int -> ReadS StartSelector
$creadsPrec :: Int -> ReadS StartSelector
Prelude.Read, Int -> StartSelector -> ShowS
[StartSelector] -> ShowS
StartSelector -> String
(Int -> StartSelector -> ShowS)
-> (StartSelector -> String)
-> ([StartSelector] -> ShowS)
-> Show StartSelector
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartSelector] -> ShowS
$cshowList :: [StartSelector] -> ShowS
show :: StartSelector -> String
$cshow :: StartSelector -> String
showsPrec :: Int -> StartSelector -> ShowS
$cshowsPrec :: Int -> StartSelector -> ShowS
Prelude.Show, (forall x. StartSelector -> Rep StartSelector x)
-> (forall x. Rep StartSelector x -> StartSelector)
-> Generic StartSelector
forall x. Rep StartSelector x -> StartSelector
forall x. StartSelector -> Rep StartSelector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartSelector x -> StartSelector
$cfrom :: forall x. StartSelector -> Rep StartSelector x
Prelude.Generic)
newStartSelector ::
StartSelectorType ->
StartSelector
newStartSelector :: StartSelectorType -> StartSelector
newStartSelector StartSelectorType
pStartSelectorType_ =
StartSelector' :: Maybe Text
-> Maybe Text -> Maybe POSIX -> StartSelectorType -> StartSelector
StartSelector'
{ $sel:continuationToken:StartSelector' :: Maybe Text
continuationToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:afterFragmentNumber:StartSelector' :: Maybe Text
afterFragmentNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:startTimestamp:StartSelector' :: Maybe POSIX
startTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:startSelectorType:StartSelector' :: StartSelectorType
startSelectorType = StartSelectorType
pStartSelectorType_
}
startSelector_continuationToken :: Lens.Lens' StartSelector (Prelude.Maybe Prelude.Text)
startSelector_continuationToken :: (Maybe Text -> f (Maybe Text)) -> StartSelector -> f StartSelector
startSelector_continuationToken = (StartSelector -> Maybe Text)
-> (StartSelector -> Maybe Text -> StartSelector)
-> Lens StartSelector StartSelector (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSelector' {Maybe Text
continuationToken :: Maybe Text
$sel:continuationToken:StartSelector' :: StartSelector -> Maybe Text
continuationToken} -> Maybe Text
continuationToken) (\s :: StartSelector
s@StartSelector' {} Maybe Text
a -> StartSelector
s {$sel:continuationToken:StartSelector' :: Maybe Text
continuationToken = Maybe Text
a} :: StartSelector)
startSelector_afterFragmentNumber :: Lens.Lens' StartSelector (Prelude.Maybe Prelude.Text)
startSelector_afterFragmentNumber :: (Maybe Text -> f (Maybe Text)) -> StartSelector -> f StartSelector
startSelector_afterFragmentNumber = (StartSelector -> Maybe Text)
-> (StartSelector -> Maybe Text -> StartSelector)
-> Lens StartSelector StartSelector (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSelector' {Maybe Text
afterFragmentNumber :: Maybe Text
$sel:afterFragmentNumber:StartSelector' :: StartSelector -> Maybe Text
afterFragmentNumber} -> Maybe Text
afterFragmentNumber) (\s :: StartSelector
s@StartSelector' {} Maybe Text
a -> StartSelector
s {$sel:afterFragmentNumber:StartSelector' :: Maybe Text
afterFragmentNumber = Maybe Text
a} :: StartSelector)
startSelector_startTimestamp :: Lens.Lens' StartSelector (Prelude.Maybe Prelude.UTCTime)
startSelector_startTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> StartSelector -> f StartSelector
startSelector_startTimestamp = (StartSelector -> Maybe POSIX)
-> (StartSelector -> Maybe POSIX -> StartSelector)
-> Lens StartSelector StartSelector (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSelector' {Maybe POSIX
startTimestamp :: Maybe POSIX
$sel:startTimestamp:StartSelector' :: StartSelector -> Maybe POSIX
startTimestamp} -> Maybe POSIX
startTimestamp) (\s :: StartSelector
s@StartSelector' {} Maybe POSIX
a -> StartSelector
s {$sel:startTimestamp:StartSelector' :: Maybe POSIX
startTimestamp = Maybe POSIX
a} :: StartSelector) ((Maybe POSIX -> f (Maybe POSIX))
-> StartSelector -> f StartSelector)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> StartSelector
-> f StartSelector
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
startSelector_startSelectorType :: Lens.Lens' StartSelector StartSelectorType
startSelector_startSelectorType :: (StartSelectorType -> f StartSelectorType)
-> StartSelector -> f StartSelector
startSelector_startSelectorType = (StartSelector -> StartSelectorType)
-> (StartSelector -> StartSelectorType -> StartSelector)
-> Lens
StartSelector StartSelector StartSelectorType StartSelectorType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSelector' {StartSelectorType
startSelectorType :: StartSelectorType
$sel:startSelectorType:StartSelector' :: StartSelector -> StartSelectorType
startSelectorType} -> StartSelectorType
startSelectorType) (\s :: StartSelector
s@StartSelector' {} StartSelectorType
a -> StartSelector
s {$sel:startSelectorType:StartSelector' :: StartSelectorType
startSelectorType = StartSelectorType
a} :: StartSelector)
instance Prelude.Hashable StartSelector
instance Prelude.NFData StartSelector
instance Core.ToJSON StartSelector where
toJSON :: StartSelector -> Value
toJSON StartSelector' {Maybe Text
Maybe POSIX
StartSelectorType
startSelectorType :: StartSelectorType
startTimestamp :: Maybe POSIX
afterFragmentNumber :: Maybe Text
continuationToken :: Maybe Text
$sel:startSelectorType:StartSelector' :: StartSelector -> StartSelectorType
$sel:startTimestamp:StartSelector' :: StartSelector -> Maybe POSIX
$sel:afterFragmentNumber:StartSelector' :: StartSelector -> Maybe Text
$sel:continuationToken:StartSelector' :: StartSelector -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ContinuationToken" 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
continuationToken,
(Text
"AfterFragmentNumber" 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
afterFragmentNumber,
(Text
"StartTimestamp" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
startTimestamp,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"StartSelectorType" Text -> StartSelectorType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= StartSelectorType
startSelectorType)
]
)