{-# 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.SingleMasterChannelEndpointConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.KinesisVideo.Types.ChannelProtocol
import Amazonka.KinesisVideo.Types.ChannelRole
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SingleMasterChannelEndpointConfiguration = SingleMasterChannelEndpointConfiguration'
{
SingleMasterChannelEndpointConfiguration
-> Maybe (NonEmpty ChannelProtocol)
protocols :: Prelude.Maybe (Prelude.NonEmpty ChannelProtocol),
SingleMasterChannelEndpointConfiguration -> Maybe ChannelRole
role' :: Prelude.Maybe ChannelRole
}
deriving (SingleMasterChannelEndpointConfiguration
-> SingleMasterChannelEndpointConfiguration -> Bool
(SingleMasterChannelEndpointConfiguration
-> SingleMasterChannelEndpointConfiguration -> Bool)
-> (SingleMasterChannelEndpointConfiguration
-> SingleMasterChannelEndpointConfiguration -> Bool)
-> Eq SingleMasterChannelEndpointConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SingleMasterChannelEndpointConfiguration
-> SingleMasterChannelEndpointConfiguration -> Bool
$c/= :: SingleMasterChannelEndpointConfiguration
-> SingleMasterChannelEndpointConfiguration -> Bool
== :: SingleMasterChannelEndpointConfiguration
-> SingleMasterChannelEndpointConfiguration -> Bool
$c== :: SingleMasterChannelEndpointConfiguration
-> SingleMasterChannelEndpointConfiguration -> Bool
Prelude.Eq, ReadPrec [SingleMasterChannelEndpointConfiguration]
ReadPrec SingleMasterChannelEndpointConfiguration
Int -> ReadS SingleMasterChannelEndpointConfiguration
ReadS [SingleMasterChannelEndpointConfiguration]
(Int -> ReadS SingleMasterChannelEndpointConfiguration)
-> ReadS [SingleMasterChannelEndpointConfiguration]
-> ReadPrec SingleMasterChannelEndpointConfiguration
-> ReadPrec [SingleMasterChannelEndpointConfiguration]
-> Read SingleMasterChannelEndpointConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SingleMasterChannelEndpointConfiguration]
$creadListPrec :: ReadPrec [SingleMasterChannelEndpointConfiguration]
readPrec :: ReadPrec SingleMasterChannelEndpointConfiguration
$creadPrec :: ReadPrec SingleMasterChannelEndpointConfiguration
readList :: ReadS [SingleMasterChannelEndpointConfiguration]
$creadList :: ReadS [SingleMasterChannelEndpointConfiguration]
readsPrec :: Int -> ReadS SingleMasterChannelEndpointConfiguration
$creadsPrec :: Int -> ReadS SingleMasterChannelEndpointConfiguration
Prelude.Read, Int -> SingleMasterChannelEndpointConfiguration -> ShowS
[SingleMasterChannelEndpointConfiguration] -> ShowS
SingleMasterChannelEndpointConfiguration -> String
(Int -> SingleMasterChannelEndpointConfiguration -> ShowS)
-> (SingleMasterChannelEndpointConfiguration -> String)
-> ([SingleMasterChannelEndpointConfiguration] -> ShowS)
-> Show SingleMasterChannelEndpointConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SingleMasterChannelEndpointConfiguration] -> ShowS
$cshowList :: [SingleMasterChannelEndpointConfiguration] -> ShowS
show :: SingleMasterChannelEndpointConfiguration -> String
$cshow :: SingleMasterChannelEndpointConfiguration -> String
showsPrec :: Int -> SingleMasterChannelEndpointConfiguration -> ShowS
$cshowsPrec :: Int -> SingleMasterChannelEndpointConfiguration -> ShowS
Prelude.Show, (forall x.
SingleMasterChannelEndpointConfiguration
-> Rep SingleMasterChannelEndpointConfiguration x)
-> (forall x.
Rep SingleMasterChannelEndpointConfiguration x
-> SingleMasterChannelEndpointConfiguration)
-> Generic SingleMasterChannelEndpointConfiguration
forall x.
Rep SingleMasterChannelEndpointConfiguration x
-> SingleMasterChannelEndpointConfiguration
forall x.
SingleMasterChannelEndpointConfiguration
-> Rep SingleMasterChannelEndpointConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SingleMasterChannelEndpointConfiguration x
-> SingleMasterChannelEndpointConfiguration
$cfrom :: forall x.
SingleMasterChannelEndpointConfiguration
-> Rep SingleMasterChannelEndpointConfiguration x
Prelude.Generic)
newSingleMasterChannelEndpointConfiguration ::
SingleMasterChannelEndpointConfiguration
newSingleMasterChannelEndpointConfiguration :: SingleMasterChannelEndpointConfiguration
newSingleMasterChannelEndpointConfiguration =
SingleMasterChannelEndpointConfiguration' :: Maybe (NonEmpty ChannelProtocol)
-> Maybe ChannelRole -> SingleMasterChannelEndpointConfiguration
SingleMasterChannelEndpointConfiguration'
{ $sel:protocols:SingleMasterChannelEndpointConfiguration' :: Maybe (NonEmpty ChannelProtocol)
protocols =
Maybe (NonEmpty ChannelProtocol)
forall a. Maybe a
Prelude.Nothing,
$sel:role':SingleMasterChannelEndpointConfiguration' :: Maybe ChannelRole
role' = Maybe ChannelRole
forall a. Maybe a
Prelude.Nothing
}
singleMasterChannelEndpointConfiguration_protocols :: Lens.Lens' SingleMasterChannelEndpointConfiguration (Prelude.Maybe (Prelude.NonEmpty ChannelProtocol))
singleMasterChannelEndpointConfiguration_protocols :: (Maybe (NonEmpty ChannelProtocol)
-> f (Maybe (NonEmpty ChannelProtocol)))
-> SingleMasterChannelEndpointConfiguration
-> f SingleMasterChannelEndpointConfiguration
singleMasterChannelEndpointConfiguration_protocols = (SingleMasterChannelEndpointConfiguration
-> Maybe (NonEmpty ChannelProtocol))
-> (SingleMasterChannelEndpointConfiguration
-> Maybe (NonEmpty ChannelProtocol)
-> SingleMasterChannelEndpointConfiguration)
-> Lens
SingleMasterChannelEndpointConfiguration
SingleMasterChannelEndpointConfiguration
(Maybe (NonEmpty ChannelProtocol))
(Maybe (NonEmpty ChannelProtocol))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SingleMasterChannelEndpointConfiguration' {Maybe (NonEmpty ChannelProtocol)
protocols :: Maybe (NonEmpty ChannelProtocol)
$sel:protocols:SingleMasterChannelEndpointConfiguration' :: SingleMasterChannelEndpointConfiguration
-> Maybe (NonEmpty ChannelProtocol)
protocols} -> Maybe (NonEmpty ChannelProtocol)
protocols) (\s :: SingleMasterChannelEndpointConfiguration
s@SingleMasterChannelEndpointConfiguration' {} Maybe (NonEmpty ChannelProtocol)
a -> SingleMasterChannelEndpointConfiguration
s {$sel:protocols:SingleMasterChannelEndpointConfiguration' :: Maybe (NonEmpty ChannelProtocol)
protocols = Maybe (NonEmpty ChannelProtocol)
a} :: SingleMasterChannelEndpointConfiguration) ((Maybe (NonEmpty ChannelProtocol)
-> f (Maybe (NonEmpty ChannelProtocol)))
-> SingleMasterChannelEndpointConfiguration
-> f SingleMasterChannelEndpointConfiguration)
-> ((Maybe (NonEmpty ChannelProtocol)
-> f (Maybe (NonEmpty ChannelProtocol)))
-> Maybe (NonEmpty ChannelProtocol)
-> f (Maybe (NonEmpty ChannelProtocol)))
-> (Maybe (NonEmpty ChannelProtocol)
-> f (Maybe (NonEmpty ChannelProtocol)))
-> SingleMasterChannelEndpointConfiguration
-> f SingleMasterChannelEndpointConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty ChannelProtocol)
(NonEmpty ChannelProtocol)
(NonEmpty ChannelProtocol)
(NonEmpty ChannelProtocol)
-> Iso
(Maybe (NonEmpty ChannelProtocol))
(Maybe (NonEmpty ChannelProtocol))
(Maybe (NonEmpty ChannelProtocol))
(Maybe (NonEmpty ChannelProtocol))
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
(NonEmpty ChannelProtocol)
(NonEmpty ChannelProtocol)
(NonEmpty ChannelProtocol)
(NonEmpty ChannelProtocol)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
singleMasterChannelEndpointConfiguration_role :: Lens.Lens' SingleMasterChannelEndpointConfiguration (Prelude.Maybe ChannelRole)
singleMasterChannelEndpointConfiguration_role :: (Maybe ChannelRole -> f (Maybe ChannelRole))
-> SingleMasterChannelEndpointConfiguration
-> f SingleMasterChannelEndpointConfiguration
singleMasterChannelEndpointConfiguration_role = (SingleMasterChannelEndpointConfiguration -> Maybe ChannelRole)
-> (SingleMasterChannelEndpointConfiguration
-> Maybe ChannelRole -> SingleMasterChannelEndpointConfiguration)
-> Lens
SingleMasterChannelEndpointConfiguration
SingleMasterChannelEndpointConfiguration
(Maybe ChannelRole)
(Maybe ChannelRole)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SingleMasterChannelEndpointConfiguration' {Maybe ChannelRole
role' :: Maybe ChannelRole
$sel:role':SingleMasterChannelEndpointConfiguration' :: SingleMasterChannelEndpointConfiguration -> Maybe ChannelRole
role'} -> Maybe ChannelRole
role') (\s :: SingleMasterChannelEndpointConfiguration
s@SingleMasterChannelEndpointConfiguration' {} Maybe ChannelRole
a -> SingleMasterChannelEndpointConfiguration
s {$sel:role':SingleMasterChannelEndpointConfiguration' :: Maybe ChannelRole
role' = Maybe ChannelRole
a} :: SingleMasterChannelEndpointConfiguration)
instance
Prelude.Hashable
SingleMasterChannelEndpointConfiguration
instance
Prelude.NFData
SingleMasterChannelEndpointConfiguration
instance
Core.ToJSON
SingleMasterChannelEndpointConfiguration
where
toJSON :: SingleMasterChannelEndpointConfiguration -> Value
toJSON SingleMasterChannelEndpointConfiguration' {Maybe (NonEmpty ChannelProtocol)
Maybe ChannelRole
role' :: Maybe ChannelRole
protocols :: Maybe (NonEmpty ChannelProtocol)
$sel:role':SingleMasterChannelEndpointConfiguration' :: SingleMasterChannelEndpointConfiguration -> Maybe ChannelRole
$sel:protocols:SingleMasterChannelEndpointConfiguration' :: SingleMasterChannelEndpointConfiguration
-> Maybe (NonEmpty ChannelProtocol)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Protocols" Text -> NonEmpty ChannelProtocol -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty ChannelProtocol -> Pair)
-> Maybe (NonEmpty ChannelProtocol) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty ChannelProtocol)
protocols,
(Text
"Role" Text -> ChannelRole -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ChannelRole -> Pair) -> Maybe ChannelRole -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChannelRole
role'
]
)