{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ElastiCache.DecreaseNodeGroupsInGlobalReplicationGroup
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Decreases the number of node groups in a Global datastore
module Amazonka.ElastiCache.DecreaseNodeGroupsInGlobalReplicationGroup
  ( -- * Creating a Request
    DecreaseNodeGroupsInGlobalReplicationGroup (..),
    newDecreaseNodeGroupsInGlobalReplicationGroup,

    -- * Request Lenses
    decreaseNodeGroupsInGlobalReplicationGroup_globalNodeGroupsToRemove,
    decreaseNodeGroupsInGlobalReplicationGroup_globalNodeGroupsToRetain,
    decreaseNodeGroupsInGlobalReplicationGroup_globalReplicationGroupId,
    decreaseNodeGroupsInGlobalReplicationGroup_nodeGroupCount,
    decreaseNodeGroupsInGlobalReplicationGroup_applyImmediately,

    -- * Destructuring the Response
    DecreaseNodeGroupsInGlobalReplicationGroupResponse (..),
    newDecreaseNodeGroupsInGlobalReplicationGroupResponse,

    -- * Response Lenses
    decreaseNodeGroupsInGlobalReplicationGroupResponse_globalReplicationGroup,
    decreaseNodeGroupsInGlobalReplicationGroupResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElastiCache.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDecreaseNodeGroupsInGlobalReplicationGroup' smart constructor.
data DecreaseNodeGroupsInGlobalReplicationGroup = DecreaseNodeGroupsInGlobalReplicationGroup'
  { -- | If the value of NodeGroupCount is less than the current number of node
    -- groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is
    -- required. GlobalNodeGroupsToRemove is a list of NodeGroupIds to remove
    -- from the cluster. ElastiCache for Redis will attempt to remove all node
    -- groups listed by GlobalNodeGroupsToRemove from the cluster.
    DecreaseNodeGroupsInGlobalReplicationGroup -> Maybe [Text]
globalNodeGroupsToRemove :: Prelude.Maybe [Prelude.Text],
    -- | If the value of NodeGroupCount is less than the current number of node
    -- groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is
    -- required. GlobalNodeGroupsToRetain is a list of NodeGroupIds to retain
    -- from the cluster. ElastiCache for Redis will attempt to retain all node
    -- groups listed by GlobalNodeGroupsToRetain from the cluster.
    DecreaseNodeGroupsInGlobalReplicationGroup -> Maybe [Text]
globalNodeGroupsToRetain :: Prelude.Maybe [Prelude.Text],
    -- | The name of the Global datastore
    DecreaseNodeGroupsInGlobalReplicationGroup -> Text
globalReplicationGroupId :: Prelude.Text,
    -- | The number of node groups (shards) that results from the modification of
    -- the shard configuration
    DecreaseNodeGroupsInGlobalReplicationGroup -> Int
nodeGroupCount :: Prelude.Int,
    -- | Indicates that the shard reconfiguration process begins immediately. At
    -- present, the only permitted value for this parameter is true.
    DecreaseNodeGroupsInGlobalReplicationGroup -> Bool
applyImmediately :: Prelude.Bool
  }
  deriving (DecreaseNodeGroupsInGlobalReplicationGroup
-> DecreaseNodeGroupsInGlobalReplicationGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DecreaseNodeGroupsInGlobalReplicationGroup
-> DecreaseNodeGroupsInGlobalReplicationGroup -> Bool
$c/= :: DecreaseNodeGroupsInGlobalReplicationGroup
-> DecreaseNodeGroupsInGlobalReplicationGroup -> Bool
== :: DecreaseNodeGroupsInGlobalReplicationGroup
-> DecreaseNodeGroupsInGlobalReplicationGroup -> Bool
$c== :: DecreaseNodeGroupsInGlobalReplicationGroup
-> DecreaseNodeGroupsInGlobalReplicationGroup -> Bool
Prelude.Eq, ReadPrec [DecreaseNodeGroupsInGlobalReplicationGroup]
ReadPrec DecreaseNodeGroupsInGlobalReplicationGroup
Int -> ReadS DecreaseNodeGroupsInGlobalReplicationGroup
ReadS [DecreaseNodeGroupsInGlobalReplicationGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DecreaseNodeGroupsInGlobalReplicationGroup]
$creadListPrec :: ReadPrec [DecreaseNodeGroupsInGlobalReplicationGroup]
readPrec :: ReadPrec DecreaseNodeGroupsInGlobalReplicationGroup
$creadPrec :: ReadPrec DecreaseNodeGroupsInGlobalReplicationGroup
readList :: ReadS [DecreaseNodeGroupsInGlobalReplicationGroup]
$creadList :: ReadS [DecreaseNodeGroupsInGlobalReplicationGroup]
readsPrec :: Int -> ReadS DecreaseNodeGroupsInGlobalReplicationGroup
$creadsPrec :: Int -> ReadS DecreaseNodeGroupsInGlobalReplicationGroup
Prelude.Read, Int -> DecreaseNodeGroupsInGlobalReplicationGroup -> ShowS
[DecreaseNodeGroupsInGlobalReplicationGroup] -> ShowS
DecreaseNodeGroupsInGlobalReplicationGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DecreaseNodeGroupsInGlobalReplicationGroup] -> ShowS
$cshowList :: [DecreaseNodeGroupsInGlobalReplicationGroup] -> ShowS
show :: DecreaseNodeGroupsInGlobalReplicationGroup -> String
$cshow :: DecreaseNodeGroupsInGlobalReplicationGroup -> String
showsPrec :: Int -> DecreaseNodeGroupsInGlobalReplicationGroup -> ShowS
$cshowsPrec :: Int -> DecreaseNodeGroupsInGlobalReplicationGroup -> ShowS
Prelude.Show, forall x.
Rep DecreaseNodeGroupsInGlobalReplicationGroup x
-> DecreaseNodeGroupsInGlobalReplicationGroup
forall x.
DecreaseNodeGroupsInGlobalReplicationGroup
-> Rep DecreaseNodeGroupsInGlobalReplicationGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DecreaseNodeGroupsInGlobalReplicationGroup x
-> DecreaseNodeGroupsInGlobalReplicationGroup
$cfrom :: forall x.
DecreaseNodeGroupsInGlobalReplicationGroup
-> Rep DecreaseNodeGroupsInGlobalReplicationGroup x
Prelude.Generic)

-- |
-- Create a value of 'DecreaseNodeGroupsInGlobalReplicationGroup' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'globalNodeGroupsToRemove', 'decreaseNodeGroupsInGlobalReplicationGroup_globalNodeGroupsToRemove' - If the value of NodeGroupCount is less than the current number of node
-- groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is
-- required. GlobalNodeGroupsToRemove is a list of NodeGroupIds to remove
-- from the cluster. ElastiCache for Redis will attempt to remove all node
-- groups listed by GlobalNodeGroupsToRemove from the cluster.
--
-- 'globalNodeGroupsToRetain', 'decreaseNodeGroupsInGlobalReplicationGroup_globalNodeGroupsToRetain' - If the value of NodeGroupCount is less than the current number of node
-- groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is
-- required. GlobalNodeGroupsToRetain is a list of NodeGroupIds to retain
-- from the cluster. ElastiCache for Redis will attempt to retain all node
-- groups listed by GlobalNodeGroupsToRetain from the cluster.
--
-- 'globalReplicationGroupId', 'decreaseNodeGroupsInGlobalReplicationGroup_globalReplicationGroupId' - The name of the Global datastore
--
-- 'nodeGroupCount', 'decreaseNodeGroupsInGlobalReplicationGroup_nodeGroupCount' - The number of node groups (shards) that results from the modification of
-- the shard configuration
--
-- 'applyImmediately', 'decreaseNodeGroupsInGlobalReplicationGroup_applyImmediately' - Indicates that the shard reconfiguration process begins immediately. At
-- present, the only permitted value for this parameter is true.
newDecreaseNodeGroupsInGlobalReplicationGroup ::
  -- | 'globalReplicationGroupId'
  Prelude.Text ->
  -- | 'nodeGroupCount'
  Prelude.Int ->
  -- | 'applyImmediately'
  Prelude.Bool ->
  DecreaseNodeGroupsInGlobalReplicationGroup
newDecreaseNodeGroupsInGlobalReplicationGroup :: Text -> Int -> Bool -> DecreaseNodeGroupsInGlobalReplicationGroup
newDecreaseNodeGroupsInGlobalReplicationGroup
  Text
pGlobalReplicationGroupId_
  Int
pNodeGroupCount_
  Bool
pApplyImmediately_ =
    DecreaseNodeGroupsInGlobalReplicationGroup'
      { $sel:globalNodeGroupsToRemove:DecreaseNodeGroupsInGlobalReplicationGroup' :: Maybe [Text]
globalNodeGroupsToRemove =
          forall a. Maybe a
Prelude.Nothing,
        $sel:globalNodeGroupsToRetain:DecreaseNodeGroupsInGlobalReplicationGroup' :: Maybe [Text]
globalNodeGroupsToRetain =
          forall a. Maybe a
Prelude.Nothing,
        $sel:globalReplicationGroupId:DecreaseNodeGroupsInGlobalReplicationGroup' :: Text
globalReplicationGroupId =
          Text
pGlobalReplicationGroupId_,
        $sel:nodeGroupCount:DecreaseNodeGroupsInGlobalReplicationGroup' :: Int
nodeGroupCount =
          Int
pNodeGroupCount_,
        $sel:applyImmediately:DecreaseNodeGroupsInGlobalReplicationGroup' :: Bool
applyImmediately =
          Bool
pApplyImmediately_
      }

-- | If the value of NodeGroupCount is less than the current number of node
-- groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is
-- required. GlobalNodeGroupsToRemove is a list of NodeGroupIds to remove
-- from the cluster. ElastiCache for Redis will attempt to remove all node
-- groups listed by GlobalNodeGroupsToRemove from the cluster.
decreaseNodeGroupsInGlobalReplicationGroup_globalNodeGroupsToRemove :: Lens.Lens' DecreaseNodeGroupsInGlobalReplicationGroup (Prelude.Maybe [Prelude.Text])
decreaseNodeGroupsInGlobalReplicationGroup_globalNodeGroupsToRemove :: Lens' DecreaseNodeGroupsInGlobalReplicationGroup (Maybe [Text])
decreaseNodeGroupsInGlobalReplicationGroup_globalNodeGroupsToRemove = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecreaseNodeGroupsInGlobalReplicationGroup' {Maybe [Text]
globalNodeGroupsToRemove :: Maybe [Text]
$sel:globalNodeGroupsToRemove:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Maybe [Text]
globalNodeGroupsToRemove} -> Maybe [Text]
globalNodeGroupsToRemove) (\s :: DecreaseNodeGroupsInGlobalReplicationGroup
s@DecreaseNodeGroupsInGlobalReplicationGroup' {} Maybe [Text]
a -> DecreaseNodeGroupsInGlobalReplicationGroup
s {$sel:globalNodeGroupsToRemove:DecreaseNodeGroupsInGlobalReplicationGroup' :: Maybe [Text]
globalNodeGroupsToRemove = Maybe [Text]
a} :: DecreaseNodeGroupsInGlobalReplicationGroup) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the value of NodeGroupCount is less than the current number of node
-- groups (shards), then either NodeGroupsToRemove or NodeGroupsToRetain is
-- required. GlobalNodeGroupsToRetain is a list of NodeGroupIds to retain
-- from the cluster. ElastiCache for Redis will attempt to retain all node
-- groups listed by GlobalNodeGroupsToRetain from the cluster.
decreaseNodeGroupsInGlobalReplicationGroup_globalNodeGroupsToRetain :: Lens.Lens' DecreaseNodeGroupsInGlobalReplicationGroup (Prelude.Maybe [Prelude.Text])
decreaseNodeGroupsInGlobalReplicationGroup_globalNodeGroupsToRetain :: Lens' DecreaseNodeGroupsInGlobalReplicationGroup (Maybe [Text])
decreaseNodeGroupsInGlobalReplicationGroup_globalNodeGroupsToRetain = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecreaseNodeGroupsInGlobalReplicationGroup' {Maybe [Text]
globalNodeGroupsToRetain :: Maybe [Text]
$sel:globalNodeGroupsToRetain:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Maybe [Text]
globalNodeGroupsToRetain} -> Maybe [Text]
globalNodeGroupsToRetain) (\s :: DecreaseNodeGroupsInGlobalReplicationGroup
s@DecreaseNodeGroupsInGlobalReplicationGroup' {} Maybe [Text]
a -> DecreaseNodeGroupsInGlobalReplicationGroup
s {$sel:globalNodeGroupsToRetain:DecreaseNodeGroupsInGlobalReplicationGroup' :: Maybe [Text]
globalNodeGroupsToRetain = Maybe [Text]
a} :: DecreaseNodeGroupsInGlobalReplicationGroup) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the Global datastore
decreaseNodeGroupsInGlobalReplicationGroup_globalReplicationGroupId :: Lens.Lens' DecreaseNodeGroupsInGlobalReplicationGroup Prelude.Text
decreaseNodeGroupsInGlobalReplicationGroup_globalReplicationGroupId :: Lens' DecreaseNodeGroupsInGlobalReplicationGroup Text
decreaseNodeGroupsInGlobalReplicationGroup_globalReplicationGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecreaseNodeGroupsInGlobalReplicationGroup' {Text
globalReplicationGroupId :: Text
$sel:globalReplicationGroupId:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Text
globalReplicationGroupId} -> Text
globalReplicationGroupId) (\s :: DecreaseNodeGroupsInGlobalReplicationGroup
s@DecreaseNodeGroupsInGlobalReplicationGroup' {} Text
a -> DecreaseNodeGroupsInGlobalReplicationGroup
s {$sel:globalReplicationGroupId:DecreaseNodeGroupsInGlobalReplicationGroup' :: Text
globalReplicationGroupId = Text
a} :: DecreaseNodeGroupsInGlobalReplicationGroup)

-- | The number of node groups (shards) that results from the modification of
-- the shard configuration
decreaseNodeGroupsInGlobalReplicationGroup_nodeGroupCount :: Lens.Lens' DecreaseNodeGroupsInGlobalReplicationGroup Prelude.Int
decreaseNodeGroupsInGlobalReplicationGroup_nodeGroupCount :: Lens' DecreaseNodeGroupsInGlobalReplicationGroup Int
decreaseNodeGroupsInGlobalReplicationGroup_nodeGroupCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecreaseNodeGroupsInGlobalReplicationGroup' {Int
nodeGroupCount :: Int
$sel:nodeGroupCount:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Int
nodeGroupCount} -> Int
nodeGroupCount) (\s :: DecreaseNodeGroupsInGlobalReplicationGroup
s@DecreaseNodeGroupsInGlobalReplicationGroup' {} Int
a -> DecreaseNodeGroupsInGlobalReplicationGroup
s {$sel:nodeGroupCount:DecreaseNodeGroupsInGlobalReplicationGroup' :: Int
nodeGroupCount = Int
a} :: DecreaseNodeGroupsInGlobalReplicationGroup)

-- | Indicates that the shard reconfiguration process begins immediately. At
-- present, the only permitted value for this parameter is true.
decreaseNodeGroupsInGlobalReplicationGroup_applyImmediately :: Lens.Lens' DecreaseNodeGroupsInGlobalReplicationGroup Prelude.Bool
decreaseNodeGroupsInGlobalReplicationGroup_applyImmediately :: Lens' DecreaseNodeGroupsInGlobalReplicationGroup Bool
decreaseNodeGroupsInGlobalReplicationGroup_applyImmediately = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecreaseNodeGroupsInGlobalReplicationGroup' {Bool
applyImmediately :: Bool
$sel:applyImmediately:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Bool
applyImmediately} -> Bool
applyImmediately) (\s :: DecreaseNodeGroupsInGlobalReplicationGroup
s@DecreaseNodeGroupsInGlobalReplicationGroup' {} Bool
a -> DecreaseNodeGroupsInGlobalReplicationGroup
s {$sel:applyImmediately:DecreaseNodeGroupsInGlobalReplicationGroup' :: Bool
applyImmediately = Bool
a} :: DecreaseNodeGroupsInGlobalReplicationGroup)

instance
  Core.AWSRequest
    DecreaseNodeGroupsInGlobalReplicationGroup
  where
  type
    AWSResponse
      DecreaseNodeGroupsInGlobalReplicationGroup =
      DecreaseNodeGroupsInGlobalReplicationGroupResponse
  request :: (Service -> Service)
-> DecreaseNodeGroupsInGlobalReplicationGroup
-> Request DecreaseNodeGroupsInGlobalReplicationGroup
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DecreaseNodeGroupsInGlobalReplicationGroup
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DecreaseNodeGroupsInGlobalReplicationGroup)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DecreaseNodeGroupsInGlobalReplicationGroupResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe GlobalReplicationGroup
-> Int -> DecreaseNodeGroupsInGlobalReplicationGroupResponse
DecreaseNodeGroupsInGlobalReplicationGroupResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"GlobalReplicationGroup")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    DecreaseNodeGroupsInGlobalReplicationGroup
  where
  hashWithSalt :: Int -> DecreaseNodeGroupsInGlobalReplicationGroup -> Int
hashWithSalt
    Int
_salt
    DecreaseNodeGroupsInGlobalReplicationGroup' {Bool
Int
Maybe [Text]
Text
applyImmediately :: Bool
nodeGroupCount :: Int
globalReplicationGroupId :: Text
globalNodeGroupsToRetain :: Maybe [Text]
globalNodeGroupsToRemove :: Maybe [Text]
$sel:applyImmediately:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Bool
$sel:nodeGroupCount:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Int
$sel:globalReplicationGroupId:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Text
$sel:globalNodeGroupsToRetain:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Maybe [Text]
$sel:globalNodeGroupsToRemove:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Maybe [Text]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
globalNodeGroupsToRemove
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
globalNodeGroupsToRetain
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
globalReplicationGroupId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
nodeGroupCount
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
applyImmediately

instance
  Prelude.NFData
    DecreaseNodeGroupsInGlobalReplicationGroup
  where
  rnf :: DecreaseNodeGroupsInGlobalReplicationGroup -> ()
rnf DecreaseNodeGroupsInGlobalReplicationGroup' {Bool
Int
Maybe [Text]
Text
applyImmediately :: Bool
nodeGroupCount :: Int
globalReplicationGroupId :: Text
globalNodeGroupsToRetain :: Maybe [Text]
globalNodeGroupsToRemove :: Maybe [Text]
$sel:applyImmediately:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Bool
$sel:nodeGroupCount:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Int
$sel:globalReplicationGroupId:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Text
$sel:globalNodeGroupsToRetain:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Maybe [Text]
$sel:globalNodeGroupsToRemove:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
globalNodeGroupsToRemove
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
globalNodeGroupsToRetain
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
globalReplicationGroupId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
nodeGroupCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
applyImmediately

instance
  Data.ToHeaders
    DecreaseNodeGroupsInGlobalReplicationGroup
  where
  toHeaders :: DecreaseNodeGroupsInGlobalReplicationGroup -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance
  Data.ToPath
    DecreaseNodeGroupsInGlobalReplicationGroup
  where
  toPath :: DecreaseNodeGroupsInGlobalReplicationGroup -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance
  Data.ToQuery
    DecreaseNodeGroupsInGlobalReplicationGroup
  where
  toQuery :: DecreaseNodeGroupsInGlobalReplicationGroup -> QueryString
toQuery
    DecreaseNodeGroupsInGlobalReplicationGroup' {Bool
Int
Maybe [Text]
Text
applyImmediately :: Bool
nodeGroupCount :: Int
globalReplicationGroupId :: Text
globalNodeGroupsToRetain :: Maybe [Text]
globalNodeGroupsToRemove :: Maybe [Text]
$sel:applyImmediately:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Bool
$sel:nodeGroupCount:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Int
$sel:globalReplicationGroupId:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Text
$sel:globalNodeGroupsToRetain:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Maybe [Text]
$sel:globalNodeGroupsToRemove:DecreaseNodeGroupsInGlobalReplicationGroup' :: DecreaseNodeGroupsInGlobalReplicationGroup -> Maybe [Text]
..} =
      forall a. Monoid a => [a] -> a
Prelude.mconcat
        [ ByteString
"Action"
            forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DecreaseNodeGroupsInGlobalReplicationGroup" ::
                        Prelude.ByteString
                    ),
          ByteString
"Version"
            forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
          ByteString
"GlobalNodeGroupsToRemove"
            forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
              ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"GlobalNodeGroupId"
                  forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
globalNodeGroupsToRemove
              ),
          ByteString
"GlobalNodeGroupsToRetain"
            forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
              ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"GlobalNodeGroupId"
                  forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
globalNodeGroupsToRetain
              ),
          ByteString
"GlobalReplicationGroupId"
            forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
globalReplicationGroupId,
          ByteString
"NodeGroupCount" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Int
nodeGroupCount,
          ByteString
"ApplyImmediately" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Bool
applyImmediately
        ]

-- | /See:/ 'newDecreaseNodeGroupsInGlobalReplicationGroupResponse' smart constructor.
data DecreaseNodeGroupsInGlobalReplicationGroupResponse = DecreaseNodeGroupsInGlobalReplicationGroupResponse'
  { DecreaseNodeGroupsInGlobalReplicationGroupResponse
-> Maybe GlobalReplicationGroup
globalReplicationGroup :: Prelude.Maybe GlobalReplicationGroup,
    -- | The response's http status code.
    DecreaseNodeGroupsInGlobalReplicationGroupResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DecreaseNodeGroupsInGlobalReplicationGroupResponse
-> DecreaseNodeGroupsInGlobalReplicationGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DecreaseNodeGroupsInGlobalReplicationGroupResponse
-> DecreaseNodeGroupsInGlobalReplicationGroupResponse -> Bool
$c/= :: DecreaseNodeGroupsInGlobalReplicationGroupResponse
-> DecreaseNodeGroupsInGlobalReplicationGroupResponse -> Bool
== :: DecreaseNodeGroupsInGlobalReplicationGroupResponse
-> DecreaseNodeGroupsInGlobalReplicationGroupResponse -> Bool
$c== :: DecreaseNodeGroupsInGlobalReplicationGroupResponse
-> DecreaseNodeGroupsInGlobalReplicationGroupResponse -> Bool
Prelude.Eq, ReadPrec [DecreaseNodeGroupsInGlobalReplicationGroupResponse]
ReadPrec DecreaseNodeGroupsInGlobalReplicationGroupResponse
Int -> ReadS DecreaseNodeGroupsInGlobalReplicationGroupResponse
ReadS [DecreaseNodeGroupsInGlobalReplicationGroupResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DecreaseNodeGroupsInGlobalReplicationGroupResponse]
$creadListPrec :: ReadPrec [DecreaseNodeGroupsInGlobalReplicationGroupResponse]
readPrec :: ReadPrec DecreaseNodeGroupsInGlobalReplicationGroupResponse
$creadPrec :: ReadPrec DecreaseNodeGroupsInGlobalReplicationGroupResponse
readList :: ReadS [DecreaseNodeGroupsInGlobalReplicationGroupResponse]
$creadList :: ReadS [DecreaseNodeGroupsInGlobalReplicationGroupResponse]
readsPrec :: Int -> ReadS DecreaseNodeGroupsInGlobalReplicationGroupResponse
$creadsPrec :: Int -> ReadS DecreaseNodeGroupsInGlobalReplicationGroupResponse
Prelude.Read, Int -> DecreaseNodeGroupsInGlobalReplicationGroupResponse -> ShowS
[DecreaseNodeGroupsInGlobalReplicationGroupResponse] -> ShowS
DecreaseNodeGroupsInGlobalReplicationGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DecreaseNodeGroupsInGlobalReplicationGroupResponse] -> ShowS
$cshowList :: [DecreaseNodeGroupsInGlobalReplicationGroupResponse] -> ShowS
show :: DecreaseNodeGroupsInGlobalReplicationGroupResponse -> String
$cshow :: DecreaseNodeGroupsInGlobalReplicationGroupResponse -> String
showsPrec :: Int -> DecreaseNodeGroupsInGlobalReplicationGroupResponse -> ShowS
$cshowsPrec :: Int -> DecreaseNodeGroupsInGlobalReplicationGroupResponse -> ShowS
Prelude.Show, forall x.
Rep DecreaseNodeGroupsInGlobalReplicationGroupResponse x
-> DecreaseNodeGroupsInGlobalReplicationGroupResponse
forall x.
DecreaseNodeGroupsInGlobalReplicationGroupResponse
-> Rep DecreaseNodeGroupsInGlobalReplicationGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DecreaseNodeGroupsInGlobalReplicationGroupResponse x
-> DecreaseNodeGroupsInGlobalReplicationGroupResponse
$cfrom :: forall x.
DecreaseNodeGroupsInGlobalReplicationGroupResponse
-> Rep DecreaseNodeGroupsInGlobalReplicationGroupResponse x
Prelude.Generic)

-- |
-- Create a value of 'DecreaseNodeGroupsInGlobalReplicationGroupResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'globalReplicationGroup', 'decreaseNodeGroupsInGlobalReplicationGroupResponse_globalReplicationGroup' - Undocumented member.
--
-- 'httpStatus', 'decreaseNodeGroupsInGlobalReplicationGroupResponse_httpStatus' - The response's http status code.
newDecreaseNodeGroupsInGlobalReplicationGroupResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DecreaseNodeGroupsInGlobalReplicationGroupResponse
newDecreaseNodeGroupsInGlobalReplicationGroupResponse :: Int -> DecreaseNodeGroupsInGlobalReplicationGroupResponse
newDecreaseNodeGroupsInGlobalReplicationGroupResponse
  Int
pHttpStatus_ =
    DecreaseNodeGroupsInGlobalReplicationGroupResponse'
      { $sel:globalReplicationGroup:DecreaseNodeGroupsInGlobalReplicationGroupResponse' :: Maybe GlobalReplicationGroup
globalReplicationGroup =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DecreaseNodeGroupsInGlobalReplicationGroupResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | Undocumented member.
decreaseNodeGroupsInGlobalReplicationGroupResponse_globalReplicationGroup :: Lens.Lens' DecreaseNodeGroupsInGlobalReplicationGroupResponse (Prelude.Maybe GlobalReplicationGroup)
decreaseNodeGroupsInGlobalReplicationGroupResponse_globalReplicationGroup :: Lens'
  DecreaseNodeGroupsInGlobalReplicationGroupResponse
  (Maybe GlobalReplicationGroup)
decreaseNodeGroupsInGlobalReplicationGroupResponse_globalReplicationGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecreaseNodeGroupsInGlobalReplicationGroupResponse' {Maybe GlobalReplicationGroup
globalReplicationGroup :: Maybe GlobalReplicationGroup
$sel:globalReplicationGroup:DecreaseNodeGroupsInGlobalReplicationGroupResponse' :: DecreaseNodeGroupsInGlobalReplicationGroupResponse
-> Maybe GlobalReplicationGroup
globalReplicationGroup} -> Maybe GlobalReplicationGroup
globalReplicationGroup) (\s :: DecreaseNodeGroupsInGlobalReplicationGroupResponse
s@DecreaseNodeGroupsInGlobalReplicationGroupResponse' {} Maybe GlobalReplicationGroup
a -> DecreaseNodeGroupsInGlobalReplicationGroupResponse
s {$sel:globalReplicationGroup:DecreaseNodeGroupsInGlobalReplicationGroupResponse' :: Maybe GlobalReplicationGroup
globalReplicationGroup = Maybe GlobalReplicationGroup
a} :: DecreaseNodeGroupsInGlobalReplicationGroupResponse)

-- | The response's http status code.
decreaseNodeGroupsInGlobalReplicationGroupResponse_httpStatus :: Lens.Lens' DecreaseNodeGroupsInGlobalReplicationGroupResponse Prelude.Int
decreaseNodeGroupsInGlobalReplicationGroupResponse_httpStatus :: Lens' DecreaseNodeGroupsInGlobalReplicationGroupResponse Int
decreaseNodeGroupsInGlobalReplicationGroupResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DecreaseNodeGroupsInGlobalReplicationGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:DecreaseNodeGroupsInGlobalReplicationGroupResponse' :: DecreaseNodeGroupsInGlobalReplicationGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DecreaseNodeGroupsInGlobalReplicationGroupResponse
s@DecreaseNodeGroupsInGlobalReplicationGroupResponse' {} Int
a -> DecreaseNodeGroupsInGlobalReplicationGroupResponse
s {$sel:httpStatus:DecreaseNodeGroupsInGlobalReplicationGroupResponse' :: Int
httpStatus = Int
a} :: DecreaseNodeGroupsInGlobalReplicationGroupResponse)

instance
  Prelude.NFData
    DecreaseNodeGroupsInGlobalReplicationGroupResponse
  where
  rnf :: DecreaseNodeGroupsInGlobalReplicationGroupResponse -> ()
rnf
    DecreaseNodeGroupsInGlobalReplicationGroupResponse' {Int
Maybe GlobalReplicationGroup
httpStatus :: Int
globalReplicationGroup :: Maybe GlobalReplicationGroup
$sel:httpStatus:DecreaseNodeGroupsInGlobalReplicationGroupResponse' :: DecreaseNodeGroupsInGlobalReplicationGroupResponse -> Int
$sel:globalReplicationGroup:DecreaseNodeGroupsInGlobalReplicationGroupResponse' :: DecreaseNodeGroupsInGlobalReplicationGroupResponse
-> Maybe GlobalReplicationGroup
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe GlobalReplicationGroup
globalReplicationGroup
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus