{-# 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.Transcribe.Types.ChannelDefinition where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Transcribe.Types.ParticipantRole
data ChannelDefinition = ChannelDefinition'
{
ChannelDefinition -> Maybe Natural
channelId :: Prelude.Maybe Prelude.Natural,
ChannelDefinition -> Maybe ParticipantRole
participantRole :: Prelude.Maybe ParticipantRole
}
deriving (ChannelDefinition -> ChannelDefinition -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelDefinition -> ChannelDefinition -> Bool
$c/= :: ChannelDefinition -> ChannelDefinition -> Bool
== :: ChannelDefinition -> ChannelDefinition -> Bool
$c== :: ChannelDefinition -> ChannelDefinition -> Bool
Prelude.Eq, ReadPrec [ChannelDefinition]
ReadPrec ChannelDefinition
Int -> ReadS ChannelDefinition
ReadS [ChannelDefinition]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChannelDefinition]
$creadListPrec :: ReadPrec [ChannelDefinition]
readPrec :: ReadPrec ChannelDefinition
$creadPrec :: ReadPrec ChannelDefinition
readList :: ReadS [ChannelDefinition]
$creadList :: ReadS [ChannelDefinition]
readsPrec :: Int -> ReadS ChannelDefinition
$creadsPrec :: Int -> ReadS ChannelDefinition
Prelude.Read, Int -> ChannelDefinition -> ShowS
[ChannelDefinition] -> ShowS
ChannelDefinition -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelDefinition] -> ShowS
$cshowList :: [ChannelDefinition] -> ShowS
show :: ChannelDefinition -> String
$cshow :: ChannelDefinition -> String
showsPrec :: Int -> ChannelDefinition -> ShowS
$cshowsPrec :: Int -> ChannelDefinition -> ShowS
Prelude.Show, forall x. Rep ChannelDefinition x -> ChannelDefinition
forall x. ChannelDefinition -> Rep ChannelDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChannelDefinition x -> ChannelDefinition
$cfrom :: forall x. ChannelDefinition -> Rep ChannelDefinition x
Prelude.Generic)
newChannelDefinition ::
ChannelDefinition
newChannelDefinition :: ChannelDefinition
newChannelDefinition =
ChannelDefinition'
{ $sel:channelId:ChannelDefinition' :: Maybe Natural
channelId = forall a. Maybe a
Prelude.Nothing,
$sel:participantRole:ChannelDefinition' :: Maybe ParticipantRole
participantRole = forall a. Maybe a
Prelude.Nothing
}
channelDefinition_channelId :: Lens.Lens' ChannelDefinition (Prelude.Maybe Prelude.Natural)
channelDefinition_channelId :: Lens' ChannelDefinition (Maybe Natural)
channelDefinition_channelId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelDefinition' {Maybe Natural
channelId :: Maybe Natural
$sel:channelId:ChannelDefinition' :: ChannelDefinition -> Maybe Natural
channelId} -> Maybe Natural
channelId) (\s :: ChannelDefinition
s@ChannelDefinition' {} Maybe Natural
a -> ChannelDefinition
s {$sel:channelId:ChannelDefinition' :: Maybe Natural
channelId = Maybe Natural
a} :: ChannelDefinition)
channelDefinition_participantRole :: Lens.Lens' ChannelDefinition (Prelude.Maybe ParticipantRole)
channelDefinition_participantRole :: Lens' ChannelDefinition (Maybe ParticipantRole)
channelDefinition_participantRole = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelDefinition' {Maybe ParticipantRole
participantRole :: Maybe ParticipantRole
$sel:participantRole:ChannelDefinition' :: ChannelDefinition -> Maybe ParticipantRole
participantRole} -> Maybe ParticipantRole
participantRole) (\s :: ChannelDefinition
s@ChannelDefinition' {} Maybe ParticipantRole
a -> ChannelDefinition
s {$sel:participantRole:ChannelDefinition' :: Maybe ParticipantRole
participantRole = Maybe ParticipantRole
a} :: ChannelDefinition)
instance Data.FromJSON ChannelDefinition where
parseJSON :: Value -> Parser ChannelDefinition
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ChannelDefinition"
( \Object
x ->
Maybe Natural -> Maybe ParticipantRole -> ChannelDefinition
ChannelDefinition'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ChannelId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ParticipantRole")
)
instance Prelude.Hashable ChannelDefinition where
hashWithSalt :: Int -> ChannelDefinition -> Int
hashWithSalt Int
_salt ChannelDefinition' {Maybe Natural
Maybe ParticipantRole
participantRole :: Maybe ParticipantRole
channelId :: Maybe Natural
$sel:participantRole:ChannelDefinition' :: ChannelDefinition -> Maybe ParticipantRole
$sel:channelId:ChannelDefinition' :: ChannelDefinition -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
channelId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ParticipantRole
participantRole
instance Prelude.NFData ChannelDefinition where
rnf :: ChannelDefinition -> ()
rnf ChannelDefinition' {Maybe Natural
Maybe ParticipantRole
participantRole :: Maybe ParticipantRole
channelId :: Maybe Natural
$sel:participantRole:ChannelDefinition' :: ChannelDefinition -> Maybe ParticipantRole
$sel:channelId:ChannelDefinition' :: ChannelDefinition -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
channelId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ParticipantRole
participantRole
instance Data.ToJSON ChannelDefinition where
toJSON :: ChannelDefinition -> Value
toJSON ChannelDefinition' {Maybe Natural
Maybe ParticipantRole
participantRole :: Maybe ParticipantRole
channelId :: Maybe Natural
$sel:participantRole:ChannelDefinition' :: ChannelDefinition -> Maybe ParticipantRole
$sel:channelId:ChannelDefinition' :: ChannelDefinition -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ChannelId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
channelId,
(Key
"ParticipantRole" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ParticipantRole
participantRole
]
)