{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SSMIncidents.Types.DeleteRegionAction 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

-- | Defines the information about the Amazon Web Services Region you\'re
-- deleting from your replication set.
--
-- /See:/ 'newDeleteRegionAction' smart constructor.
data DeleteRegionAction = DeleteRegionAction'
  { -- | The name of the Amazon Web Services Region you\'re deleting from the
    -- replication set.
    DeleteRegionAction -> Text
regionName :: Prelude.Text
  }
  deriving (DeleteRegionAction -> DeleteRegionAction -> Bool
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]
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
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. 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 Amazon Web Services Region you\'re deleting from the
-- replication set.
newDeleteRegionAction ::
  -- | 'regionName'
  Prelude.Text ->
  DeleteRegionAction
newDeleteRegionAction :: Text -> DeleteRegionAction
newDeleteRegionAction Text
pRegionName_ =
  DeleteRegionAction' {$sel:regionName:DeleteRegionAction' :: Text
regionName = Text
pRegionName_}

-- | The name of the Amazon Web Services Region you\'re deleting from the
-- replication set.
deleteRegionAction_regionName :: Lens.Lens' DeleteRegionAction Prelude.Text
deleteRegionAction_regionName :: Lens' DeleteRegionAction Text
deleteRegionAction_regionName = 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 where
  hashWithSalt :: Int -> DeleteRegionAction -> Int
hashWithSalt Int
_salt DeleteRegionAction' {Text
regionName :: Text
$sel:regionName:DeleteRegionAction' :: DeleteRegionAction -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
regionName

instance Prelude.NFData DeleteRegionAction where
  rnf :: DeleteRegionAction -> ()
rnf DeleteRegionAction' {Text
regionName :: Text
$sel:regionName:DeleteRegionAction' :: DeleteRegionAction -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
regionName

instance Data.ToJSON DeleteRegionAction where
  toJSON :: DeleteRegionAction -> Value
toJSON DeleteRegionAction' {Text
regionName :: Text
$sel:regionName:DeleteRegionAction' :: DeleteRegionAction -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"regionName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
regionName)]
      )