{-# 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.MGN.DeleteReplicationConfigurationTemplate
-- 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 a single Replication Configuration Template by ID
module Amazonka.MGN.DeleteReplicationConfigurationTemplate
  ( -- * Creating a Request
    DeleteReplicationConfigurationTemplate (..),
    newDeleteReplicationConfigurationTemplate,

    -- * Request Lenses
    deleteReplicationConfigurationTemplate_replicationConfigurationTemplateID,

    -- * Destructuring the Response
    DeleteReplicationConfigurationTemplateResponse (..),
    newDeleteReplicationConfigurationTemplateResponse,

    -- * Response Lenses
    deleteReplicationConfigurationTemplateResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDeleteReplicationConfigurationTemplate' smart constructor.
data DeleteReplicationConfigurationTemplate = DeleteReplicationConfigurationTemplate'
  { -- | Request to delete Replication Configuration Template from service by
    -- Replication Configuration Template ID.
    DeleteReplicationConfigurationTemplate -> Text
replicationConfigurationTemplateID :: Prelude.Text
  }
  deriving (DeleteReplicationConfigurationTemplate
-> DeleteReplicationConfigurationTemplate -> Bool
(DeleteReplicationConfigurationTemplate
 -> DeleteReplicationConfigurationTemplate -> Bool)
-> (DeleteReplicationConfigurationTemplate
    -> DeleteReplicationConfigurationTemplate -> Bool)
-> Eq DeleteReplicationConfigurationTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteReplicationConfigurationTemplate
-> DeleteReplicationConfigurationTemplate -> Bool
$c/= :: DeleteReplicationConfigurationTemplate
-> DeleteReplicationConfigurationTemplate -> Bool
== :: DeleteReplicationConfigurationTemplate
-> DeleteReplicationConfigurationTemplate -> Bool
$c== :: DeleteReplicationConfigurationTemplate
-> DeleteReplicationConfigurationTemplate -> Bool
Prelude.Eq, ReadPrec [DeleteReplicationConfigurationTemplate]
ReadPrec DeleteReplicationConfigurationTemplate
Int -> ReadS DeleteReplicationConfigurationTemplate
ReadS [DeleteReplicationConfigurationTemplate]
(Int -> ReadS DeleteReplicationConfigurationTemplate)
-> ReadS [DeleteReplicationConfigurationTemplate]
-> ReadPrec DeleteReplicationConfigurationTemplate
-> ReadPrec [DeleteReplicationConfigurationTemplate]
-> Read DeleteReplicationConfigurationTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteReplicationConfigurationTemplate]
$creadListPrec :: ReadPrec [DeleteReplicationConfigurationTemplate]
readPrec :: ReadPrec DeleteReplicationConfigurationTemplate
$creadPrec :: ReadPrec DeleteReplicationConfigurationTemplate
readList :: ReadS [DeleteReplicationConfigurationTemplate]
$creadList :: ReadS [DeleteReplicationConfigurationTemplate]
readsPrec :: Int -> ReadS DeleteReplicationConfigurationTemplate
$creadsPrec :: Int -> ReadS DeleteReplicationConfigurationTemplate
Prelude.Read, Int -> DeleteReplicationConfigurationTemplate -> ShowS
[DeleteReplicationConfigurationTemplate] -> ShowS
DeleteReplicationConfigurationTemplate -> String
(Int -> DeleteReplicationConfigurationTemplate -> ShowS)
-> (DeleteReplicationConfigurationTemplate -> String)
-> ([DeleteReplicationConfigurationTemplate] -> ShowS)
-> Show DeleteReplicationConfigurationTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteReplicationConfigurationTemplate] -> ShowS
$cshowList :: [DeleteReplicationConfigurationTemplate] -> ShowS
show :: DeleteReplicationConfigurationTemplate -> String
$cshow :: DeleteReplicationConfigurationTemplate -> String
showsPrec :: Int -> DeleteReplicationConfigurationTemplate -> ShowS
$cshowsPrec :: Int -> DeleteReplicationConfigurationTemplate -> ShowS
Prelude.Show, (forall x.
 DeleteReplicationConfigurationTemplate
 -> Rep DeleteReplicationConfigurationTemplate x)
-> (forall x.
    Rep DeleteReplicationConfigurationTemplate x
    -> DeleteReplicationConfigurationTemplate)
-> Generic DeleteReplicationConfigurationTemplate
forall x.
Rep DeleteReplicationConfigurationTemplate x
-> DeleteReplicationConfigurationTemplate
forall x.
DeleteReplicationConfigurationTemplate
-> Rep DeleteReplicationConfigurationTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteReplicationConfigurationTemplate x
-> DeleteReplicationConfigurationTemplate
$cfrom :: forall x.
DeleteReplicationConfigurationTemplate
-> Rep DeleteReplicationConfigurationTemplate x
Prelude.Generic)

-- |
-- Create a value of 'DeleteReplicationConfigurationTemplate' 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:
--
-- 'replicationConfigurationTemplateID', 'deleteReplicationConfigurationTemplate_replicationConfigurationTemplateID' - Request to delete Replication Configuration Template from service by
-- Replication Configuration Template ID.
newDeleteReplicationConfigurationTemplate ::
  -- | 'replicationConfigurationTemplateID'
  Prelude.Text ->
  DeleteReplicationConfigurationTemplate
newDeleteReplicationConfigurationTemplate :: Text -> DeleteReplicationConfigurationTemplate
newDeleteReplicationConfigurationTemplate
  Text
pReplicationConfigurationTemplateID_ =
    DeleteReplicationConfigurationTemplate' :: Text -> DeleteReplicationConfigurationTemplate
DeleteReplicationConfigurationTemplate'
      { $sel:replicationConfigurationTemplateID:DeleteReplicationConfigurationTemplate' :: Text
replicationConfigurationTemplateID =
          Text
pReplicationConfigurationTemplateID_
      }

-- | Request to delete Replication Configuration Template from service by
-- Replication Configuration Template ID.
deleteReplicationConfigurationTemplate_replicationConfigurationTemplateID :: Lens.Lens' DeleteReplicationConfigurationTemplate Prelude.Text
deleteReplicationConfigurationTemplate_replicationConfigurationTemplateID :: (Text -> f Text)
-> DeleteReplicationConfigurationTemplate
-> f DeleteReplicationConfigurationTemplate
deleteReplicationConfigurationTemplate_replicationConfigurationTemplateID = (DeleteReplicationConfigurationTemplate -> Text)
-> (DeleteReplicationConfigurationTemplate
    -> Text -> DeleteReplicationConfigurationTemplate)
-> Lens
     DeleteReplicationConfigurationTemplate
     DeleteReplicationConfigurationTemplate
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReplicationConfigurationTemplate' {Text
replicationConfigurationTemplateID :: Text
$sel:replicationConfigurationTemplateID:DeleteReplicationConfigurationTemplate' :: DeleteReplicationConfigurationTemplate -> Text
replicationConfigurationTemplateID} -> Text
replicationConfigurationTemplateID) (\s :: DeleteReplicationConfigurationTemplate
s@DeleteReplicationConfigurationTemplate' {} Text
a -> DeleteReplicationConfigurationTemplate
s {$sel:replicationConfigurationTemplateID:DeleteReplicationConfigurationTemplate' :: Text
replicationConfigurationTemplateID = Text
a} :: DeleteReplicationConfigurationTemplate)

instance
  Core.AWSRequest
    DeleteReplicationConfigurationTemplate
  where
  type
    AWSResponse
      DeleteReplicationConfigurationTemplate =
      DeleteReplicationConfigurationTemplateResponse
  request :: DeleteReplicationConfigurationTemplate
-> Request DeleteReplicationConfigurationTemplate
request = Service
-> DeleteReplicationConfigurationTemplate
-> Request DeleteReplicationConfigurationTemplate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteReplicationConfigurationTemplate
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DeleteReplicationConfigurationTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either
      String (AWSResponse DeleteReplicationConfigurationTemplate))
-> Logger
-> Service
-> Proxy DeleteReplicationConfigurationTemplate
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DeleteReplicationConfigurationTemplate)))
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 -> DeleteReplicationConfigurationTemplateResponse
DeleteReplicationConfigurationTemplateResponse'
            (Int -> DeleteReplicationConfigurationTemplateResponse)
-> Either String Int
-> Either String DeleteReplicationConfigurationTemplateResponse
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
    DeleteReplicationConfigurationTemplate

instance
  Prelude.NFData
    DeleteReplicationConfigurationTemplate

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

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

instance
  Core.ToQuery
    DeleteReplicationConfigurationTemplate
  where
  toQuery :: DeleteReplicationConfigurationTemplate -> QueryString
toQuery = QueryString
-> DeleteReplicationConfigurationTemplate -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

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

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

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

instance
  Prelude.NFData
    DeleteReplicationConfigurationTemplateResponse