{-# 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.Chime.Types.VoiceConnectorItem where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data VoiceConnectorItem = VoiceConnectorItem'
{
VoiceConnectorItem -> Text
voiceConnectorId :: Prelude.Text,
VoiceConnectorItem -> Natural
priority :: Prelude.Natural
}
deriving (VoiceConnectorItem -> VoiceConnectorItem -> Bool
(VoiceConnectorItem -> VoiceConnectorItem -> Bool)
-> (VoiceConnectorItem -> VoiceConnectorItem -> Bool)
-> Eq VoiceConnectorItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VoiceConnectorItem -> VoiceConnectorItem -> Bool
$c/= :: VoiceConnectorItem -> VoiceConnectorItem -> Bool
== :: VoiceConnectorItem -> VoiceConnectorItem -> Bool
$c== :: VoiceConnectorItem -> VoiceConnectorItem -> Bool
Prelude.Eq, ReadPrec [VoiceConnectorItem]
ReadPrec VoiceConnectorItem
Int -> ReadS VoiceConnectorItem
ReadS [VoiceConnectorItem]
(Int -> ReadS VoiceConnectorItem)
-> ReadS [VoiceConnectorItem]
-> ReadPrec VoiceConnectorItem
-> ReadPrec [VoiceConnectorItem]
-> Read VoiceConnectorItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VoiceConnectorItem]
$creadListPrec :: ReadPrec [VoiceConnectorItem]
readPrec :: ReadPrec VoiceConnectorItem
$creadPrec :: ReadPrec VoiceConnectorItem
readList :: ReadS [VoiceConnectorItem]
$creadList :: ReadS [VoiceConnectorItem]
readsPrec :: Int -> ReadS VoiceConnectorItem
$creadsPrec :: Int -> ReadS VoiceConnectorItem
Prelude.Read, Int -> VoiceConnectorItem -> ShowS
[VoiceConnectorItem] -> ShowS
VoiceConnectorItem -> String
(Int -> VoiceConnectorItem -> ShowS)
-> (VoiceConnectorItem -> String)
-> ([VoiceConnectorItem] -> ShowS)
-> Show VoiceConnectorItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VoiceConnectorItem] -> ShowS
$cshowList :: [VoiceConnectorItem] -> ShowS
show :: VoiceConnectorItem -> String
$cshow :: VoiceConnectorItem -> String
showsPrec :: Int -> VoiceConnectorItem -> ShowS
$cshowsPrec :: Int -> VoiceConnectorItem -> ShowS
Prelude.Show, (forall x. VoiceConnectorItem -> Rep VoiceConnectorItem x)
-> (forall x. Rep VoiceConnectorItem x -> VoiceConnectorItem)
-> Generic VoiceConnectorItem
forall x. Rep VoiceConnectorItem x -> VoiceConnectorItem
forall x. VoiceConnectorItem -> Rep VoiceConnectorItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VoiceConnectorItem x -> VoiceConnectorItem
$cfrom :: forall x. VoiceConnectorItem -> Rep VoiceConnectorItem x
Prelude.Generic)
newVoiceConnectorItem ::
Prelude.Text ->
Prelude.Natural ->
VoiceConnectorItem
newVoiceConnectorItem :: Text -> Natural -> VoiceConnectorItem
newVoiceConnectorItem Text
pVoiceConnectorId_ Natural
pPriority_ =
VoiceConnectorItem' :: Text -> Natural -> VoiceConnectorItem
VoiceConnectorItem'
{ $sel:voiceConnectorId:VoiceConnectorItem' :: Text
voiceConnectorId =
Text
pVoiceConnectorId_,
$sel:priority:VoiceConnectorItem' :: Natural
priority = Natural
pPriority_
}
voiceConnectorItem_voiceConnectorId :: Lens.Lens' VoiceConnectorItem Prelude.Text
voiceConnectorItem_voiceConnectorId :: (Text -> f Text) -> VoiceConnectorItem -> f VoiceConnectorItem
voiceConnectorItem_voiceConnectorId = (VoiceConnectorItem -> Text)
-> (VoiceConnectorItem -> Text -> VoiceConnectorItem)
-> Lens VoiceConnectorItem VoiceConnectorItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VoiceConnectorItem' {Text
voiceConnectorId :: Text
$sel:voiceConnectorId:VoiceConnectorItem' :: VoiceConnectorItem -> Text
voiceConnectorId} -> Text
voiceConnectorId) (\s :: VoiceConnectorItem
s@VoiceConnectorItem' {} Text
a -> VoiceConnectorItem
s {$sel:voiceConnectorId:VoiceConnectorItem' :: Text
voiceConnectorId = Text
a} :: VoiceConnectorItem)
voiceConnectorItem_priority :: Lens.Lens' VoiceConnectorItem Prelude.Natural
voiceConnectorItem_priority :: (Natural -> f Natural)
-> VoiceConnectorItem -> f VoiceConnectorItem
voiceConnectorItem_priority = (VoiceConnectorItem -> Natural)
-> (VoiceConnectorItem -> Natural -> VoiceConnectorItem)
-> Lens VoiceConnectorItem VoiceConnectorItem Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VoiceConnectorItem' {Natural
priority :: Natural
$sel:priority:VoiceConnectorItem' :: VoiceConnectorItem -> Natural
priority} -> Natural
priority) (\s :: VoiceConnectorItem
s@VoiceConnectorItem' {} Natural
a -> VoiceConnectorItem
s {$sel:priority:VoiceConnectorItem' :: Natural
priority = Natural
a} :: VoiceConnectorItem)
instance Core.FromJSON VoiceConnectorItem where
parseJSON :: Value -> Parser VoiceConnectorItem
parseJSON =
String
-> (Object -> Parser VoiceConnectorItem)
-> Value
-> Parser VoiceConnectorItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"VoiceConnectorItem"
( \Object
x ->
Text -> Natural -> VoiceConnectorItem
VoiceConnectorItem'
(Text -> Natural -> VoiceConnectorItem)
-> Parser Text -> Parser (Natural -> VoiceConnectorItem)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"VoiceConnectorId")
Parser (Natural -> VoiceConnectorItem)
-> Parser Natural -> Parser VoiceConnectorItem
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Priority")
)
instance Prelude.Hashable VoiceConnectorItem
instance Prelude.NFData VoiceConnectorItem
instance Core.ToJSON VoiceConnectorItem where
toJSON :: VoiceConnectorItem -> Value
toJSON VoiceConnectorItem' {Natural
Text
priority :: Natural
voiceConnectorId :: Text
$sel:priority:VoiceConnectorItem' :: VoiceConnectorItem -> Natural
$sel:voiceConnectorId:VoiceConnectorItem' :: VoiceConnectorItem -> Text
..} =
[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
"VoiceConnectorId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
voiceConnectorId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Priority" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
priority)
]
)