{-# 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.SSMIncidents.Types.DeleteRegionAction
-- 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.SSMIncidents.Types.DeleteRegionAction where

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

-- | Defines the information about the Region you\'re deleting from your
-- replication set.
--
-- /See:/ 'newDeleteRegionAction' smart constructor.
data DeleteRegionAction = DeleteRegionAction'
  { -- | The name of the Region you\'re deleting from the replication set.
    DeleteRegionAction -> Text
regionName :: Prelude.Text
  }
  deriving (DeleteRegionAction -> DeleteRegionAction -> Bool
(DeleteRegionAction -> DeleteRegionAction -> Bool)
-> (DeleteRegionAction -> DeleteRegionAction -> Bool)
-> Eq DeleteRegionAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRegionAction -> DeleteRegionAction -> Bool
$c/= :: DeleteRegionAction -> DeleteRegionAction -> Bool
== :: DeleteRegionAction -> DeleteRegionAction -> Bool
$c== :: DeleteRegionAction -> DeleteRegionAction -> Bool
Prelude.Eq, ReadPrec [DeleteRegionAction]
ReadPrec DeleteRegionAction
Int -> ReadS DeleteRegionAction
ReadS [DeleteRegionAction]
(Int -> ReadS DeleteRegionAction)
-> ReadS [DeleteRegionAction]
-> ReadPrec DeleteRegionAction
-> ReadPrec [DeleteRegionAction]
-> Read DeleteRegionAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRegionAction]
$creadListPrec :: ReadPrec [DeleteRegionAction]
readPrec :: ReadPrec DeleteRegionAction
$creadPrec :: ReadPrec DeleteRegionAction
readList :: ReadS [DeleteRegionAction]
$creadList :: ReadS [DeleteRegionAction]
readsPrec :: Int -> ReadS DeleteRegionAction
$creadsPrec :: Int -> ReadS DeleteRegionAction
Prelude.Read, Int -> DeleteRegionAction -> ShowS
[DeleteRegionAction] -> ShowS
DeleteRegionAction -> String
(Int -> DeleteRegionAction -> ShowS)
-> (DeleteRegionAction -> String)
-> ([DeleteRegionAction] -> ShowS)
-> Show DeleteRegionAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRegionAction] -> ShowS
$cshowList :: [DeleteRegionAction] -> ShowS
show :: DeleteRegionAction -> String
$cshow :: DeleteRegionAction -> String
showsPrec :: Int -> DeleteRegionAction -> ShowS
$cshowsPrec :: Int -> DeleteRegionAction -> ShowS
Prelude.Show, (forall x. DeleteRegionAction -> Rep DeleteRegionAction x)
-> (forall x. Rep DeleteRegionAction x -> DeleteRegionAction)
-> Generic DeleteRegionAction
forall x. Rep DeleteRegionAction x -> DeleteRegionAction
forall x. DeleteRegionAction -> Rep DeleteRegionAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteRegionAction x -> DeleteRegionAction
$cfrom :: forall x. DeleteRegionAction -> Rep DeleteRegionAction x
Prelude.Generic)

-- |
-- Create a value of 'DeleteRegionAction' 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', 'deleteRegionAction_regionName' - The name of the Region you\'re deleting from the replication set.
newDeleteRegionAction ::
  -- | 'regionName'
  Prelude.Text ->
  DeleteRegionAction
newDeleteRegionAction :: Text -> DeleteRegionAction
newDeleteRegionAction Text
pRegionName_ =
  DeleteRegionAction' :: Text -> DeleteRegionAction
DeleteRegionAction' {$sel:regionName:DeleteRegionAction' :: Text
regionName = Text
pRegionName_}

-- | The name of the Region you\'re deleting from the replication set.
deleteRegionAction_regionName :: Lens.Lens' DeleteRegionAction Prelude.Text
deleteRegionAction_regionName :: (Text -> f Text) -> DeleteRegionAction -> f DeleteRegionAction
deleteRegionAction_regionName = (DeleteRegionAction -> Text)
-> (DeleteRegionAction -> Text -> DeleteRegionAction)
-> Lens DeleteRegionAction DeleteRegionAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRegionAction' {Text
regionName :: Text
$sel:regionName:DeleteRegionAction' :: DeleteRegionAction -> Text
regionName} -> Text
regionName) (\s :: DeleteRegionAction
s@DeleteRegionAction' {} Text
a -> DeleteRegionAction
s {$sel:regionName:DeleteRegionAction' :: Text
regionName = Text
a} :: DeleteRegionAction)

instance Prelude.Hashable DeleteRegionAction

instance Prelude.NFData DeleteRegionAction

instance Core.ToJSON DeleteRegionAction where
  toJSON :: DeleteRegionAction -> Value
toJSON DeleteRegionAction' {Text
regionName :: Text
$sel:regionName:DeleteRegionAction' :: DeleteRegionAction -> 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)]
      )