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