{-# 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.KinesisVideoArchivedMedia.Types.FragmentSelector where
import qualified Amazonka.Core as Core
import Amazonka.KinesisVideoArchivedMedia.Types.FragmentSelectorType
import Amazonka.KinesisVideoArchivedMedia.Types.TimestampRange
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data FragmentSelector = FragmentSelector'
{
FragmentSelector -> FragmentSelectorType
fragmentSelectorType :: FragmentSelectorType,
FragmentSelector -> TimestampRange
timestampRange :: TimestampRange
}
deriving (FragmentSelector -> FragmentSelector -> Bool
(FragmentSelector -> FragmentSelector -> Bool)
-> (FragmentSelector -> FragmentSelector -> Bool)
-> Eq FragmentSelector
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FragmentSelector -> FragmentSelector -> Bool
$c/= :: FragmentSelector -> FragmentSelector -> Bool
== :: FragmentSelector -> FragmentSelector -> Bool
$c== :: FragmentSelector -> FragmentSelector -> Bool
Prelude.Eq, ReadPrec [FragmentSelector]
ReadPrec FragmentSelector
Int -> ReadS FragmentSelector
ReadS [FragmentSelector]
(Int -> ReadS FragmentSelector)
-> ReadS [FragmentSelector]
-> ReadPrec FragmentSelector
-> ReadPrec [FragmentSelector]
-> Read FragmentSelector
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FragmentSelector]
$creadListPrec :: ReadPrec [FragmentSelector]
readPrec :: ReadPrec FragmentSelector
$creadPrec :: ReadPrec FragmentSelector
readList :: ReadS [FragmentSelector]
$creadList :: ReadS [FragmentSelector]
readsPrec :: Int -> ReadS FragmentSelector
$creadsPrec :: Int -> ReadS FragmentSelector
Prelude.Read, Int -> FragmentSelector -> ShowS
[FragmentSelector] -> ShowS
FragmentSelector -> String
(Int -> FragmentSelector -> ShowS)
-> (FragmentSelector -> String)
-> ([FragmentSelector] -> ShowS)
-> Show FragmentSelector
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FragmentSelector] -> ShowS
$cshowList :: [FragmentSelector] -> ShowS
show :: FragmentSelector -> String
$cshow :: FragmentSelector -> String
showsPrec :: Int -> FragmentSelector -> ShowS
$cshowsPrec :: Int -> FragmentSelector -> ShowS
Prelude.Show, (forall x. FragmentSelector -> Rep FragmentSelector x)
-> (forall x. Rep FragmentSelector x -> FragmentSelector)
-> Generic FragmentSelector
forall x. Rep FragmentSelector x -> FragmentSelector
forall x. FragmentSelector -> Rep FragmentSelector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FragmentSelector x -> FragmentSelector
$cfrom :: forall x. FragmentSelector -> Rep FragmentSelector x
Prelude.Generic)
newFragmentSelector ::
FragmentSelectorType ->
TimestampRange ->
FragmentSelector
newFragmentSelector :: FragmentSelectorType -> TimestampRange -> FragmentSelector
newFragmentSelector
FragmentSelectorType
pFragmentSelectorType_
TimestampRange
pTimestampRange_ =
FragmentSelector' :: FragmentSelectorType -> TimestampRange -> FragmentSelector
FragmentSelector'
{ $sel:fragmentSelectorType:FragmentSelector' :: FragmentSelectorType
fragmentSelectorType =
FragmentSelectorType
pFragmentSelectorType_,
$sel:timestampRange:FragmentSelector' :: TimestampRange
timestampRange = TimestampRange
pTimestampRange_
}
fragmentSelector_fragmentSelectorType :: Lens.Lens' FragmentSelector FragmentSelectorType
fragmentSelector_fragmentSelectorType :: (FragmentSelectorType -> f FragmentSelectorType)
-> FragmentSelector -> f FragmentSelector
fragmentSelector_fragmentSelectorType = (FragmentSelector -> FragmentSelectorType)
-> (FragmentSelector -> FragmentSelectorType -> FragmentSelector)
-> Lens
FragmentSelector
FragmentSelector
FragmentSelectorType
FragmentSelectorType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FragmentSelector' {FragmentSelectorType
fragmentSelectorType :: FragmentSelectorType
$sel:fragmentSelectorType:FragmentSelector' :: FragmentSelector -> FragmentSelectorType
fragmentSelectorType} -> FragmentSelectorType
fragmentSelectorType) (\s :: FragmentSelector
s@FragmentSelector' {} FragmentSelectorType
a -> FragmentSelector
s {$sel:fragmentSelectorType:FragmentSelector' :: FragmentSelectorType
fragmentSelectorType = FragmentSelectorType
a} :: FragmentSelector)
fragmentSelector_timestampRange :: Lens.Lens' FragmentSelector TimestampRange
fragmentSelector_timestampRange :: (TimestampRange -> f TimestampRange)
-> FragmentSelector -> f FragmentSelector
fragmentSelector_timestampRange = (FragmentSelector -> TimestampRange)
-> (FragmentSelector -> TimestampRange -> FragmentSelector)
-> Lens
FragmentSelector FragmentSelector TimestampRange TimestampRange
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FragmentSelector' {TimestampRange
timestampRange :: TimestampRange
$sel:timestampRange:FragmentSelector' :: FragmentSelector -> TimestampRange
timestampRange} -> TimestampRange
timestampRange) (\s :: FragmentSelector
s@FragmentSelector' {} TimestampRange
a -> FragmentSelector
s {$sel:timestampRange:FragmentSelector' :: TimestampRange
timestampRange = TimestampRange
a} :: FragmentSelector)
instance Prelude.Hashable FragmentSelector
instance Prelude.NFData FragmentSelector
instance Core.ToJSON FragmentSelector where
toJSON :: FragmentSelector -> Value
toJSON FragmentSelector' {FragmentSelectorType
TimestampRange
timestampRange :: TimestampRange
fragmentSelectorType :: FragmentSelectorType
$sel:timestampRange:FragmentSelector' :: FragmentSelector -> TimestampRange
$sel:fragmentSelectorType:FragmentSelector' :: FragmentSelector -> FragmentSelectorType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"FragmentSelectorType"
Text -> FragmentSelectorType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= FragmentSelectorType
fragmentSelectorType
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"TimestampRange" Text -> TimestampRange -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TimestampRange
timestampRange)
]
)