{-# 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.ChannelNameCondition 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 ChannelNameCondition = ChannelNameCondition'
{
ChannelNameCondition -> Maybe ComparisonOperator
comparisonOperator :: Prelude.Maybe ComparisonOperator,
ChannelNameCondition -> Maybe Text
comparisonValue :: Prelude.Maybe Prelude.Text
}
deriving (ChannelNameCondition -> ChannelNameCondition -> Bool
(ChannelNameCondition -> ChannelNameCondition -> Bool)
-> (ChannelNameCondition -> ChannelNameCondition -> Bool)
-> Eq ChannelNameCondition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelNameCondition -> ChannelNameCondition -> Bool
$c/= :: ChannelNameCondition -> ChannelNameCondition -> Bool
== :: ChannelNameCondition -> ChannelNameCondition -> Bool
$c== :: ChannelNameCondition -> ChannelNameCondition -> Bool
Prelude.Eq, ReadPrec [ChannelNameCondition]
ReadPrec ChannelNameCondition
Int -> ReadS ChannelNameCondition
ReadS [ChannelNameCondition]
(Int -> ReadS ChannelNameCondition)
-> ReadS [ChannelNameCondition]
-> ReadPrec ChannelNameCondition
-> ReadPrec [ChannelNameCondition]
-> Read ChannelNameCondition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChannelNameCondition]
$creadListPrec :: ReadPrec [ChannelNameCondition]
readPrec :: ReadPrec ChannelNameCondition
$creadPrec :: ReadPrec ChannelNameCondition
readList :: ReadS [ChannelNameCondition]
$creadList :: ReadS [ChannelNameCondition]
readsPrec :: Int -> ReadS ChannelNameCondition
$creadsPrec :: Int -> ReadS ChannelNameCondition
Prelude.Read, Int -> ChannelNameCondition -> ShowS
[ChannelNameCondition] -> ShowS
ChannelNameCondition -> String
(Int -> ChannelNameCondition -> ShowS)
-> (ChannelNameCondition -> String)
-> ([ChannelNameCondition] -> ShowS)
-> Show ChannelNameCondition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelNameCondition] -> ShowS
$cshowList :: [ChannelNameCondition] -> ShowS
show :: ChannelNameCondition -> String
$cshow :: ChannelNameCondition -> String
showsPrec :: Int -> ChannelNameCondition -> ShowS
$cshowsPrec :: Int -> ChannelNameCondition -> ShowS
Prelude.Show, (forall x. ChannelNameCondition -> Rep ChannelNameCondition x)
-> (forall x. Rep ChannelNameCondition x -> ChannelNameCondition)
-> Generic ChannelNameCondition
forall x. Rep ChannelNameCondition x -> ChannelNameCondition
forall x. ChannelNameCondition -> Rep ChannelNameCondition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChannelNameCondition x -> ChannelNameCondition
$cfrom :: forall x. ChannelNameCondition -> Rep ChannelNameCondition x
Prelude.Generic)
newChannelNameCondition ::
ChannelNameCondition
newChannelNameCondition :: ChannelNameCondition
newChannelNameCondition =
ChannelNameCondition' :: Maybe ComparisonOperator -> Maybe Text -> ChannelNameCondition
ChannelNameCondition'
{ $sel:comparisonOperator:ChannelNameCondition' :: Maybe ComparisonOperator
comparisonOperator =
Maybe ComparisonOperator
forall a. Maybe a
Prelude.Nothing,
$sel:comparisonValue:ChannelNameCondition' :: Maybe Text
comparisonValue = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
channelNameCondition_comparisonOperator :: Lens.Lens' ChannelNameCondition (Prelude.Maybe ComparisonOperator)
channelNameCondition_comparisonOperator :: (Maybe ComparisonOperator -> f (Maybe ComparisonOperator))
-> ChannelNameCondition -> f ChannelNameCondition
channelNameCondition_comparisonOperator = (ChannelNameCondition -> Maybe ComparisonOperator)
-> (ChannelNameCondition
-> Maybe ComparisonOperator -> ChannelNameCondition)
-> Lens
ChannelNameCondition
ChannelNameCondition
(Maybe ComparisonOperator)
(Maybe ComparisonOperator)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelNameCondition' {Maybe ComparisonOperator
comparisonOperator :: Maybe ComparisonOperator
$sel:comparisonOperator:ChannelNameCondition' :: ChannelNameCondition -> Maybe ComparisonOperator
comparisonOperator} -> Maybe ComparisonOperator
comparisonOperator) (\s :: ChannelNameCondition
s@ChannelNameCondition' {} Maybe ComparisonOperator
a -> ChannelNameCondition
s {$sel:comparisonOperator:ChannelNameCondition' :: Maybe ComparisonOperator
comparisonOperator = Maybe ComparisonOperator
a} :: ChannelNameCondition)
channelNameCondition_comparisonValue :: Lens.Lens' ChannelNameCondition (Prelude.Maybe Prelude.Text)
channelNameCondition_comparisonValue :: (Maybe Text -> f (Maybe Text))
-> ChannelNameCondition -> f ChannelNameCondition
channelNameCondition_comparisonValue = (ChannelNameCondition -> Maybe Text)
-> (ChannelNameCondition -> Maybe Text -> ChannelNameCondition)
-> Lens
ChannelNameCondition ChannelNameCondition (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelNameCondition' {Maybe Text
comparisonValue :: Maybe Text
$sel:comparisonValue:ChannelNameCondition' :: ChannelNameCondition -> Maybe Text
comparisonValue} -> Maybe Text
comparisonValue) (\s :: ChannelNameCondition
s@ChannelNameCondition' {} Maybe Text
a -> ChannelNameCondition
s {$sel:comparisonValue:ChannelNameCondition' :: Maybe Text
comparisonValue = Maybe Text
a} :: ChannelNameCondition)
instance Prelude.Hashable ChannelNameCondition
instance Prelude.NFData ChannelNameCondition
instance Core.ToJSON ChannelNameCondition where
toJSON :: ChannelNameCondition -> Value
toJSON ChannelNameCondition' {Maybe Text
Maybe ComparisonOperator
comparisonValue :: Maybe Text
comparisonOperator :: Maybe ComparisonOperator
$sel:comparisonValue:ChannelNameCondition' :: ChannelNameCondition -> Maybe Text
$sel:comparisonOperator:ChannelNameCondition' :: ChannelNameCondition -> 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
]
)