{-# 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 #-}

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

-- |
-- Module      : Amazonka.DynamoDB.Types.DeleteReplicationGroupMemberAction
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DynamoDB.Types.DeleteReplicationGroupMemberAction where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents a replica to be deleted.
--
-- /See:/ 'newDeleteReplicationGroupMemberAction' smart constructor.
data DeleteReplicationGroupMemberAction = DeleteReplicationGroupMemberAction'
  { -- | The Region where the replica exists.
    DeleteReplicationGroupMemberAction -> Text
regionName :: Prelude.Text
  }
  deriving (DeleteReplicationGroupMemberAction
-> DeleteReplicationGroupMemberAction -> Bool
(DeleteReplicationGroupMemberAction
 -> DeleteReplicationGroupMemberAction -> Bool)
-> (DeleteReplicationGroupMemberAction
    -> DeleteReplicationGroupMemberAction -> Bool)
-> Eq DeleteReplicationGroupMemberAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteReplicationGroupMemberAction
-> DeleteReplicationGroupMemberAction -> Bool
$c/= :: DeleteReplicationGroupMemberAction
-> DeleteReplicationGroupMemberAction -> Bool
== :: DeleteReplicationGroupMemberAction
-> DeleteReplicationGroupMemberAction -> Bool
$c== :: DeleteReplicationGroupMemberAction
-> DeleteReplicationGroupMemberAction -> Bool
Prelude.Eq, ReadPrec [DeleteReplicationGroupMemberAction]
ReadPrec DeleteReplicationGroupMemberAction
Int -> ReadS DeleteReplicationGroupMemberAction
ReadS [DeleteReplicationGroupMemberAction]
(Int -> ReadS DeleteReplicationGroupMemberAction)
-> ReadS [DeleteReplicationGroupMemberAction]
-> ReadPrec DeleteReplicationGroupMemberAction
-> ReadPrec [DeleteReplicationGroupMemberAction]
-> Read DeleteReplicationGroupMemberAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteReplicationGroupMemberAction]
$creadListPrec :: ReadPrec [DeleteReplicationGroupMemberAction]
readPrec :: ReadPrec DeleteReplicationGroupMemberAction
$creadPrec :: ReadPrec DeleteReplicationGroupMemberAction
readList :: ReadS [DeleteReplicationGroupMemberAction]
$creadList :: ReadS [DeleteReplicationGroupMemberAction]
readsPrec :: Int -> ReadS DeleteReplicationGroupMemberAction
$creadsPrec :: Int -> ReadS DeleteReplicationGroupMemberAction
Prelude.Read, Int -> DeleteReplicationGroupMemberAction -> ShowS
[DeleteReplicationGroupMemberAction] -> ShowS
DeleteReplicationGroupMemberAction -> String
(Int -> DeleteReplicationGroupMemberAction -> ShowS)
-> (DeleteReplicationGroupMemberAction -> String)
-> ([DeleteReplicationGroupMemberAction] -> ShowS)
-> Show DeleteReplicationGroupMemberAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteReplicationGroupMemberAction] -> ShowS
$cshowList :: [DeleteReplicationGroupMemberAction] -> ShowS
show :: DeleteReplicationGroupMemberAction -> String
$cshow :: DeleteReplicationGroupMemberAction -> String
showsPrec :: Int -> DeleteReplicationGroupMemberAction -> ShowS
$cshowsPrec :: Int -> DeleteReplicationGroupMemberAction -> ShowS
Prelude.Show, (forall x.
 DeleteReplicationGroupMemberAction
 -> Rep DeleteReplicationGroupMemberAction x)
-> (forall x.
    Rep DeleteReplicationGroupMemberAction x
    -> DeleteReplicationGroupMemberAction)
-> Generic DeleteReplicationGroupMemberAction
forall x.
Rep DeleteReplicationGroupMemberAction x
-> DeleteReplicationGroupMemberAction
forall x.
DeleteReplicationGroupMemberAction
-> Rep DeleteReplicationGroupMemberAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteReplicationGroupMemberAction x
-> DeleteReplicationGroupMemberAction
$cfrom :: forall x.
DeleteReplicationGroupMemberAction
-> Rep DeleteReplicationGroupMemberAction x
Prelude.Generic)

-- |
-- Create a value of 'DeleteReplicationGroupMemberAction' 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:
--
-- 'regionName', 'deleteReplicationGroupMemberAction_regionName' - The Region where the replica exists.
newDeleteReplicationGroupMemberAction ::
  -- | 'regionName'
  Prelude.Text ->
  DeleteReplicationGroupMemberAction
newDeleteReplicationGroupMemberAction :: Text -> DeleteReplicationGroupMemberAction
newDeleteReplicationGroupMemberAction Text
pRegionName_ =
  DeleteReplicationGroupMemberAction' :: Text -> DeleteReplicationGroupMemberAction
DeleteReplicationGroupMemberAction'
    { $sel:regionName:DeleteReplicationGroupMemberAction' :: Text
regionName =
        Text
pRegionName_
    }

-- | The Region where the replica exists.
deleteReplicationGroupMemberAction_regionName :: Lens.Lens' DeleteReplicationGroupMemberAction Prelude.Text
deleteReplicationGroupMemberAction_regionName :: (Text -> f Text)
-> DeleteReplicationGroupMemberAction
-> f DeleteReplicationGroupMemberAction
deleteReplicationGroupMemberAction_regionName = (DeleteReplicationGroupMemberAction -> Text)
-> (DeleteReplicationGroupMemberAction
    -> Text -> DeleteReplicationGroupMemberAction)
-> Lens
     DeleteReplicationGroupMemberAction
     DeleteReplicationGroupMemberAction
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReplicationGroupMemberAction' {Text
regionName :: Text
$sel:regionName:DeleteReplicationGroupMemberAction' :: DeleteReplicationGroupMemberAction -> Text
regionName} -> Text
regionName) (\s :: DeleteReplicationGroupMemberAction
s@DeleteReplicationGroupMemberAction' {} Text
a -> DeleteReplicationGroupMemberAction
s {$sel:regionName:DeleteReplicationGroupMemberAction' :: Text
regionName = Text
a} :: DeleteReplicationGroupMemberAction)

instance
  Prelude.Hashable
    DeleteReplicationGroupMemberAction

instance
  Prelude.NFData
    DeleteReplicationGroupMemberAction

instance
  Core.ToJSON
    DeleteReplicationGroupMemberAction
  where
  toJSON :: DeleteReplicationGroupMemberAction -> Value
toJSON DeleteReplicationGroupMemberAction' {Text
regionName :: Text
$sel:regionName:DeleteReplicationGroupMemberAction' :: DeleteReplicationGroupMemberAction -> 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
"RegionName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
regionName)]
      )