{-# 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.ElastiCache.Types.ConfigureShard where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ConfigureShard = ConfigureShard'
{
ConfigureShard -> Maybe [Text]
preferredAvailabilityZones :: Prelude.Maybe [Prelude.Text],
ConfigureShard -> Maybe [Text]
preferredOutpostArns :: Prelude.Maybe [Prelude.Text],
ConfigureShard -> Text
nodeGroupId :: Prelude.Text,
ConfigureShard -> Int
newReplicaCount' :: Prelude.Int
}
deriving (ConfigureShard -> ConfigureShard -> Bool
(ConfigureShard -> ConfigureShard -> Bool)
-> (ConfigureShard -> ConfigureShard -> Bool) -> Eq ConfigureShard
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfigureShard -> ConfigureShard -> Bool
$c/= :: ConfigureShard -> ConfigureShard -> Bool
== :: ConfigureShard -> ConfigureShard -> Bool
$c== :: ConfigureShard -> ConfigureShard -> Bool
Prelude.Eq, ReadPrec [ConfigureShard]
ReadPrec ConfigureShard
Int -> ReadS ConfigureShard
ReadS [ConfigureShard]
(Int -> ReadS ConfigureShard)
-> ReadS [ConfigureShard]
-> ReadPrec ConfigureShard
-> ReadPrec [ConfigureShard]
-> Read ConfigureShard
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConfigureShard]
$creadListPrec :: ReadPrec [ConfigureShard]
readPrec :: ReadPrec ConfigureShard
$creadPrec :: ReadPrec ConfigureShard
readList :: ReadS [ConfigureShard]
$creadList :: ReadS [ConfigureShard]
readsPrec :: Int -> ReadS ConfigureShard
$creadsPrec :: Int -> ReadS ConfigureShard
Prelude.Read, Int -> ConfigureShard -> ShowS
[ConfigureShard] -> ShowS
ConfigureShard -> String
(Int -> ConfigureShard -> ShowS)
-> (ConfigureShard -> String)
-> ([ConfigureShard] -> ShowS)
-> Show ConfigureShard
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfigureShard] -> ShowS
$cshowList :: [ConfigureShard] -> ShowS
show :: ConfigureShard -> String
$cshow :: ConfigureShard -> String
showsPrec :: Int -> ConfigureShard -> ShowS
$cshowsPrec :: Int -> ConfigureShard -> ShowS
Prelude.Show, (forall x. ConfigureShard -> Rep ConfigureShard x)
-> (forall x. Rep ConfigureShard x -> ConfigureShard)
-> Generic ConfigureShard
forall x. Rep ConfigureShard x -> ConfigureShard
forall x. ConfigureShard -> Rep ConfigureShard x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConfigureShard x -> ConfigureShard
$cfrom :: forall x. ConfigureShard -> Rep ConfigureShard x
Prelude.Generic)
newConfigureShard ::
Prelude.Text ->
Prelude.Int ->
ConfigureShard
newConfigureShard :: Text -> Int -> ConfigureShard
newConfigureShard Text
pNodeGroupId_ Int
pNewReplicaCount_ =
ConfigureShard' :: Maybe [Text] -> Maybe [Text] -> Text -> Int -> ConfigureShard
ConfigureShard'
{ $sel:preferredAvailabilityZones:ConfigureShard' :: Maybe [Text]
preferredAvailabilityZones =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:preferredOutpostArns:ConfigureShard' :: Maybe [Text]
preferredOutpostArns = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:nodeGroupId:ConfigureShard' :: Text
nodeGroupId = Text
pNodeGroupId_,
$sel:newReplicaCount':ConfigureShard' :: Int
newReplicaCount' = Int
pNewReplicaCount_
}
configureShard_preferredAvailabilityZones :: Lens.Lens' ConfigureShard (Prelude.Maybe [Prelude.Text])
configureShard_preferredAvailabilityZones :: (Maybe [Text] -> f (Maybe [Text]))
-> ConfigureShard -> f ConfigureShard
configureShard_preferredAvailabilityZones = (ConfigureShard -> Maybe [Text])
-> (ConfigureShard -> Maybe [Text] -> ConfigureShard)
-> Lens ConfigureShard ConfigureShard (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigureShard' {Maybe [Text]
preferredAvailabilityZones :: Maybe [Text]
$sel:preferredAvailabilityZones:ConfigureShard' :: ConfigureShard -> Maybe [Text]
preferredAvailabilityZones} -> Maybe [Text]
preferredAvailabilityZones) (\s :: ConfigureShard
s@ConfigureShard' {} Maybe [Text]
a -> ConfigureShard
s {$sel:preferredAvailabilityZones:ConfigureShard' :: Maybe [Text]
preferredAvailabilityZones = Maybe [Text]
a} :: ConfigureShard) ((Maybe [Text] -> f (Maybe [Text]))
-> ConfigureShard -> f ConfigureShard)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ConfigureShard
-> f ConfigureShard
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
configureShard_preferredOutpostArns :: Lens.Lens' ConfigureShard (Prelude.Maybe [Prelude.Text])
configureShard_preferredOutpostArns :: (Maybe [Text] -> f (Maybe [Text]))
-> ConfigureShard -> f ConfigureShard
configureShard_preferredOutpostArns = (ConfigureShard -> Maybe [Text])
-> (ConfigureShard -> Maybe [Text] -> ConfigureShard)
-> Lens ConfigureShard ConfigureShard (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigureShard' {Maybe [Text]
preferredOutpostArns :: Maybe [Text]
$sel:preferredOutpostArns:ConfigureShard' :: ConfigureShard -> Maybe [Text]
preferredOutpostArns} -> Maybe [Text]
preferredOutpostArns) (\s :: ConfigureShard
s@ConfigureShard' {} Maybe [Text]
a -> ConfigureShard
s {$sel:preferredOutpostArns:ConfigureShard' :: Maybe [Text]
preferredOutpostArns = Maybe [Text]
a} :: ConfigureShard) ((Maybe [Text] -> f (Maybe [Text]))
-> ConfigureShard -> f ConfigureShard)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ConfigureShard
-> f ConfigureShard
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
configureShard_nodeGroupId :: Lens.Lens' ConfigureShard Prelude.Text
configureShard_nodeGroupId :: (Text -> f Text) -> ConfigureShard -> f ConfigureShard
configureShard_nodeGroupId = (ConfigureShard -> Text)
-> (ConfigureShard -> Text -> ConfigureShard)
-> Lens ConfigureShard ConfigureShard Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigureShard' {Text
nodeGroupId :: Text
$sel:nodeGroupId:ConfigureShard' :: ConfigureShard -> Text
nodeGroupId} -> Text
nodeGroupId) (\s :: ConfigureShard
s@ConfigureShard' {} Text
a -> ConfigureShard
s {$sel:nodeGroupId:ConfigureShard' :: Text
nodeGroupId = Text
a} :: ConfigureShard)
configureShard_newReplicaCount :: Lens.Lens' ConfigureShard Prelude.Int
configureShard_newReplicaCount :: (Int -> f Int) -> ConfigureShard -> f ConfigureShard
configureShard_newReplicaCount = (ConfigureShard -> Int)
-> (ConfigureShard -> Int -> ConfigureShard)
-> Lens ConfigureShard ConfigureShard Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigureShard' {Int
newReplicaCount' :: Int
$sel:newReplicaCount':ConfigureShard' :: ConfigureShard -> Int
newReplicaCount'} -> Int
newReplicaCount') (\s :: ConfigureShard
s@ConfigureShard' {} Int
a -> ConfigureShard
s {$sel:newReplicaCount':ConfigureShard' :: Int
newReplicaCount' = Int
a} :: ConfigureShard)
instance Prelude.Hashable ConfigureShard
instance Prelude.NFData ConfigureShard
instance Core.ToQuery ConfigureShard where
toQuery :: ConfigureShard -> QueryString
toQuery ConfigureShard' {Int
Maybe [Text]
Text
newReplicaCount' :: Int
nodeGroupId :: Text
preferredOutpostArns :: Maybe [Text]
preferredAvailabilityZones :: Maybe [Text]
$sel:newReplicaCount':ConfigureShard' :: ConfigureShard -> Int
$sel:nodeGroupId:ConfigureShard' :: ConfigureShard -> Text
$sel:preferredOutpostArns:ConfigureShard' :: ConfigureShard -> Maybe [Text]
$sel:preferredAvailabilityZones:ConfigureShard' :: ConfigureShard -> Maybe [Text]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"PreferredAvailabilityZones"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"PreferredAvailabilityZone"
([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
preferredAvailabilityZones
),
ByteString
"PreferredOutpostArns"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"PreferredOutpostArn"
([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
preferredOutpostArns
),
ByteString
"NodeGroupId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
nodeGroupId,
ByteString
"NewReplicaCount" ByteString -> Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Int
newReplicaCount'
]