{-# 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.SSMIncidents.DeleteReplicationSet
-- 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)
--
-- Deletes all Regions in your replication set. Deleting the replication
-- set deletes all Incident Manager data.
module Amazonka.SSMIncidents.DeleteReplicationSet
  ( -- * Creating a Request
    DeleteReplicationSet (..),
    newDeleteReplicationSet,

    -- * Request Lenses
    deleteReplicationSet_arn,

    -- * Destructuring the Response
    DeleteReplicationSetResponse (..),
    newDeleteReplicationSetResponse,

    -- * Response Lenses
    deleteReplicationSetResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SSMIncidents.Types

-- | /See:/ 'newDeleteReplicationSet' smart constructor.
data DeleteReplicationSet = DeleteReplicationSet'
  { -- | The Amazon Resource Name (ARN) of the replication set you\'re deleting.
    DeleteReplicationSet -> Text
arn :: Prelude.Text
  }
  deriving (DeleteReplicationSet -> DeleteReplicationSet -> Bool
(DeleteReplicationSet -> DeleteReplicationSet -> Bool)
-> (DeleteReplicationSet -> DeleteReplicationSet -> Bool)
-> Eq DeleteReplicationSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteReplicationSet -> DeleteReplicationSet -> Bool
$c/= :: DeleteReplicationSet -> DeleteReplicationSet -> Bool
== :: DeleteReplicationSet -> DeleteReplicationSet -> Bool
$c== :: DeleteReplicationSet -> DeleteReplicationSet -> Bool
Prelude.Eq, ReadPrec [DeleteReplicationSet]
ReadPrec DeleteReplicationSet
Int -> ReadS DeleteReplicationSet
ReadS [DeleteReplicationSet]
(Int -> ReadS DeleteReplicationSet)
-> ReadS [DeleteReplicationSet]
-> ReadPrec DeleteReplicationSet
-> ReadPrec [DeleteReplicationSet]
-> Read DeleteReplicationSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteReplicationSet]
$creadListPrec :: ReadPrec [DeleteReplicationSet]
readPrec :: ReadPrec DeleteReplicationSet
$creadPrec :: ReadPrec DeleteReplicationSet
readList :: ReadS [DeleteReplicationSet]
$creadList :: ReadS [DeleteReplicationSet]
readsPrec :: Int -> ReadS DeleteReplicationSet
$creadsPrec :: Int -> ReadS DeleteReplicationSet
Prelude.Read, Int -> DeleteReplicationSet -> ShowS
[DeleteReplicationSet] -> ShowS
DeleteReplicationSet -> String
(Int -> DeleteReplicationSet -> ShowS)
-> (DeleteReplicationSet -> String)
-> ([DeleteReplicationSet] -> ShowS)
-> Show DeleteReplicationSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteReplicationSet] -> ShowS
$cshowList :: [DeleteReplicationSet] -> ShowS
show :: DeleteReplicationSet -> String
$cshow :: DeleteReplicationSet -> String
showsPrec :: Int -> DeleteReplicationSet -> ShowS
$cshowsPrec :: Int -> DeleteReplicationSet -> ShowS
Prelude.Show, (forall x. DeleteReplicationSet -> Rep DeleteReplicationSet x)
-> (forall x. Rep DeleteReplicationSet x -> DeleteReplicationSet)
-> Generic DeleteReplicationSet
forall x. Rep DeleteReplicationSet x -> DeleteReplicationSet
forall x. DeleteReplicationSet -> Rep DeleteReplicationSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteReplicationSet x -> DeleteReplicationSet
$cfrom :: forall x. DeleteReplicationSet -> Rep DeleteReplicationSet x
Prelude.Generic)

-- |
-- Create a value of 'DeleteReplicationSet' 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:
--
-- 'arn', 'deleteReplicationSet_arn' - The Amazon Resource Name (ARN) of the replication set you\'re deleting.
newDeleteReplicationSet ::
  -- | 'arn'
  Prelude.Text ->
  DeleteReplicationSet
newDeleteReplicationSet :: Text -> DeleteReplicationSet
newDeleteReplicationSet Text
pArn_ =
  DeleteReplicationSet' :: Text -> DeleteReplicationSet
DeleteReplicationSet' {$sel:arn:DeleteReplicationSet' :: Text
arn = Text
pArn_}

-- | The Amazon Resource Name (ARN) of the replication set you\'re deleting.
deleteReplicationSet_arn :: Lens.Lens' DeleteReplicationSet Prelude.Text
deleteReplicationSet_arn :: (Text -> f Text) -> DeleteReplicationSet -> f DeleteReplicationSet
deleteReplicationSet_arn = (DeleteReplicationSet -> Text)
-> (DeleteReplicationSet -> Text -> DeleteReplicationSet)
-> Lens DeleteReplicationSet DeleteReplicationSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReplicationSet' {Text
arn :: Text
$sel:arn:DeleteReplicationSet' :: DeleteReplicationSet -> Text
arn} -> Text
arn) (\s :: DeleteReplicationSet
s@DeleteReplicationSet' {} Text
a -> DeleteReplicationSet
s {$sel:arn:DeleteReplicationSet' :: Text
arn = Text
a} :: DeleteReplicationSet)

instance Core.AWSRequest DeleteReplicationSet where
  type
    AWSResponse DeleteReplicationSet =
      DeleteReplicationSetResponse
  request :: DeleteReplicationSet -> Request DeleteReplicationSet
request = Service -> DeleteReplicationSet -> Request DeleteReplicationSet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteReplicationSet
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteReplicationSet)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteReplicationSet))
-> Logger
-> Service
-> Proxy DeleteReplicationSet
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteReplicationSet)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteReplicationSetResponse
DeleteReplicationSetResponse'
            (Int -> DeleteReplicationSetResponse)
-> Either String Int -> Either String DeleteReplicationSetResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DeleteReplicationSet

instance Prelude.NFData DeleteReplicationSet

instance Core.ToHeaders DeleteReplicationSet where
  toHeaders :: DeleteReplicationSet -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteReplicationSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DeleteReplicationSet where
  toJSON :: DeleteReplicationSet -> Value
toJSON = Value -> DeleteReplicationSet -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)

instance Core.ToPath DeleteReplicationSet where
  toPath :: DeleteReplicationSet -> ByteString
toPath = ByteString -> DeleteReplicationSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/deleteReplicationSet"

instance Core.ToQuery DeleteReplicationSet where
  toQuery :: DeleteReplicationSet -> QueryString
toQuery DeleteReplicationSet' {Text
arn :: Text
$sel:arn:DeleteReplicationSet' :: DeleteReplicationSet -> Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"arn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
arn]

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

-- |
-- Create a value of 'DeleteReplicationSetResponse' 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:
--
-- 'httpStatus', 'deleteReplicationSetResponse_httpStatus' - The response's http status code.
newDeleteReplicationSetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteReplicationSetResponse
newDeleteReplicationSetResponse :: Int -> DeleteReplicationSetResponse
newDeleteReplicationSetResponse Int
pHttpStatus_ =
  DeleteReplicationSetResponse' :: Int -> DeleteReplicationSetResponse
DeleteReplicationSetResponse'
    { $sel:httpStatus:DeleteReplicationSetResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance Prelude.NFData DeleteReplicationSetResponse