{-# 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.ChimeSDKMessaging.Types.ElasticChannelConfiguration 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
data ElasticChannelConfiguration = ElasticChannelConfiguration'
{
ElasticChannelConfiguration -> Natural
maximumSubChannels :: Prelude.Natural,
ElasticChannelConfiguration -> Natural
targetMembershipsPerSubChannel :: Prelude.Natural,
ElasticChannelConfiguration -> Natural
minimumMembershipPercentage :: Prelude.Natural
}
deriving (ElasticChannelConfiguration -> ElasticChannelConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ElasticChannelConfiguration -> ElasticChannelConfiguration -> Bool
$c/= :: ElasticChannelConfiguration -> ElasticChannelConfiguration -> Bool
== :: ElasticChannelConfiguration -> ElasticChannelConfiguration -> Bool
$c== :: ElasticChannelConfiguration -> ElasticChannelConfiguration -> Bool
Prelude.Eq, ReadPrec [ElasticChannelConfiguration]
ReadPrec ElasticChannelConfiguration
Int -> ReadS ElasticChannelConfiguration
ReadS [ElasticChannelConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ElasticChannelConfiguration]
$creadListPrec :: ReadPrec [ElasticChannelConfiguration]
readPrec :: ReadPrec ElasticChannelConfiguration
$creadPrec :: ReadPrec ElasticChannelConfiguration
readList :: ReadS [ElasticChannelConfiguration]
$creadList :: ReadS [ElasticChannelConfiguration]
readsPrec :: Int -> ReadS ElasticChannelConfiguration
$creadsPrec :: Int -> ReadS ElasticChannelConfiguration
Prelude.Read, Int -> ElasticChannelConfiguration -> ShowS
[ElasticChannelConfiguration] -> ShowS
ElasticChannelConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ElasticChannelConfiguration] -> ShowS
$cshowList :: [ElasticChannelConfiguration] -> ShowS
show :: ElasticChannelConfiguration -> String
$cshow :: ElasticChannelConfiguration -> String
showsPrec :: Int -> ElasticChannelConfiguration -> ShowS
$cshowsPrec :: Int -> ElasticChannelConfiguration -> ShowS
Prelude.Show, forall x.
Rep ElasticChannelConfiguration x -> ElasticChannelConfiguration
forall x.
ElasticChannelConfiguration -> Rep ElasticChannelConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ElasticChannelConfiguration x -> ElasticChannelConfiguration
$cfrom :: forall x.
ElasticChannelConfiguration -> Rep ElasticChannelConfiguration x
Prelude.Generic)
newElasticChannelConfiguration ::
Prelude.Natural ->
Prelude.Natural ->
Prelude.Natural ->
ElasticChannelConfiguration
newElasticChannelConfiguration :: Natural -> Natural -> Natural -> ElasticChannelConfiguration
newElasticChannelConfiguration
Natural
pMaximumSubChannels_
Natural
pTargetMembershipsPerSubChannel_
Natural
pMinimumMembershipPercentage_ =
ElasticChannelConfiguration'
{ $sel:maximumSubChannels:ElasticChannelConfiguration' :: Natural
maximumSubChannels =
Natural
pMaximumSubChannels_,
$sel:targetMembershipsPerSubChannel:ElasticChannelConfiguration' :: Natural
targetMembershipsPerSubChannel =
Natural
pTargetMembershipsPerSubChannel_,
$sel:minimumMembershipPercentage:ElasticChannelConfiguration' :: Natural
minimumMembershipPercentage =
Natural
pMinimumMembershipPercentage_
}
elasticChannelConfiguration_maximumSubChannels :: Lens.Lens' ElasticChannelConfiguration Prelude.Natural
elasticChannelConfiguration_maximumSubChannels :: Lens' ElasticChannelConfiguration Natural
elasticChannelConfiguration_maximumSubChannels = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticChannelConfiguration' {Natural
maximumSubChannels :: Natural
$sel:maximumSubChannels:ElasticChannelConfiguration' :: ElasticChannelConfiguration -> Natural
maximumSubChannels} -> Natural
maximumSubChannels) (\s :: ElasticChannelConfiguration
s@ElasticChannelConfiguration' {} Natural
a -> ElasticChannelConfiguration
s {$sel:maximumSubChannels:ElasticChannelConfiguration' :: Natural
maximumSubChannels = Natural
a} :: ElasticChannelConfiguration)
elasticChannelConfiguration_targetMembershipsPerSubChannel :: Lens.Lens' ElasticChannelConfiguration Prelude.Natural
elasticChannelConfiguration_targetMembershipsPerSubChannel :: Lens' ElasticChannelConfiguration Natural
elasticChannelConfiguration_targetMembershipsPerSubChannel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticChannelConfiguration' {Natural
targetMembershipsPerSubChannel :: Natural
$sel:targetMembershipsPerSubChannel:ElasticChannelConfiguration' :: ElasticChannelConfiguration -> Natural
targetMembershipsPerSubChannel} -> Natural
targetMembershipsPerSubChannel) (\s :: ElasticChannelConfiguration
s@ElasticChannelConfiguration' {} Natural
a -> ElasticChannelConfiguration
s {$sel:targetMembershipsPerSubChannel:ElasticChannelConfiguration' :: Natural
targetMembershipsPerSubChannel = Natural
a} :: ElasticChannelConfiguration)
elasticChannelConfiguration_minimumMembershipPercentage :: Lens.Lens' ElasticChannelConfiguration Prelude.Natural
elasticChannelConfiguration_minimumMembershipPercentage :: Lens' ElasticChannelConfiguration Natural
elasticChannelConfiguration_minimumMembershipPercentage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticChannelConfiguration' {Natural
minimumMembershipPercentage :: Natural
$sel:minimumMembershipPercentage:ElasticChannelConfiguration' :: ElasticChannelConfiguration -> Natural
minimumMembershipPercentage} -> Natural
minimumMembershipPercentage) (\s :: ElasticChannelConfiguration
s@ElasticChannelConfiguration' {} Natural
a -> ElasticChannelConfiguration
s {$sel:minimumMembershipPercentage:ElasticChannelConfiguration' :: Natural
minimumMembershipPercentage = Natural
a} :: ElasticChannelConfiguration)
instance Data.FromJSON ElasticChannelConfiguration where
parseJSON :: Value -> Parser ElasticChannelConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ElasticChannelConfiguration"
( \Object
x ->
Natural -> Natural -> Natural -> ElasticChannelConfiguration
ElasticChannelConfiguration'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"MaximumSubChannels")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"TargetMembershipsPerSubChannel")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"MinimumMembershipPercentage")
)
instance Prelude.Hashable ElasticChannelConfiguration where
hashWithSalt :: Int -> ElasticChannelConfiguration -> Int
hashWithSalt Int
_salt ElasticChannelConfiguration' {Natural
minimumMembershipPercentage :: Natural
targetMembershipsPerSubChannel :: Natural
maximumSubChannels :: Natural
$sel:minimumMembershipPercentage:ElasticChannelConfiguration' :: ElasticChannelConfiguration -> Natural
$sel:targetMembershipsPerSubChannel:ElasticChannelConfiguration' :: ElasticChannelConfiguration -> Natural
$sel:maximumSubChannels:ElasticChannelConfiguration' :: ElasticChannelConfiguration -> Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
maximumSubChannels
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
targetMembershipsPerSubChannel
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
minimumMembershipPercentage
instance Prelude.NFData ElasticChannelConfiguration where
rnf :: ElasticChannelConfiguration -> ()
rnf ElasticChannelConfiguration' {Natural
minimumMembershipPercentage :: Natural
targetMembershipsPerSubChannel :: Natural
maximumSubChannels :: Natural
$sel:minimumMembershipPercentage:ElasticChannelConfiguration' :: ElasticChannelConfiguration -> Natural
$sel:targetMembershipsPerSubChannel:ElasticChannelConfiguration' :: ElasticChannelConfiguration -> Natural
$sel:maximumSubChannels:ElasticChannelConfiguration' :: ElasticChannelConfiguration -> Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Natural
maximumSubChannels
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
targetMembershipsPerSubChannel
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
minimumMembershipPercentage
instance Data.ToJSON ElasticChannelConfiguration where
toJSON :: ElasticChannelConfiguration -> Value
toJSON ElasticChannelConfiguration' {Natural
minimumMembershipPercentage :: Natural
targetMembershipsPerSubChannel :: Natural
maximumSubChannels :: Natural
$sel:minimumMembershipPercentage:ElasticChannelConfiguration' :: ElasticChannelConfiguration -> Natural
$sel:targetMembershipsPerSubChannel:ElasticChannelConfiguration' :: ElasticChannelConfiguration -> Natural
$sel:maximumSubChannels:ElasticChannelConfiguration' :: ElasticChannelConfiguration -> Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"MaximumSubChannels" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
maximumSubChannels),
forall a. a -> Maybe a
Prelude.Just
( Key
"TargetMembershipsPerSubChannel"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
targetMembershipsPerSubChannel
),
forall a. a -> Maybe a
Prelude.Just
( Key
"MinimumMembershipPercentage"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
minimumMembershipPercentage
)
]
)