{-# 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.SMS.DeleteAppReplicationConfiguration
-- 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 the replication configuration for the specified application.
module Amazonka.SMS.DeleteAppReplicationConfiguration
  ( -- * Creating a Request
    DeleteAppReplicationConfiguration (..),
    newDeleteAppReplicationConfiguration,

    -- * Request Lenses
    deleteAppReplicationConfiguration_appId,

    -- * Destructuring the Response
    DeleteAppReplicationConfigurationResponse (..),
    newDeleteAppReplicationConfigurationResponse,

    -- * Response Lenses
    deleteAppReplicationConfigurationResponse_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.SMS.Types

-- | /See:/ 'newDeleteAppReplicationConfiguration' smart constructor.
data DeleteAppReplicationConfiguration = DeleteAppReplicationConfiguration'
  { -- | The ID of the application.
    DeleteAppReplicationConfiguration -> Maybe Text
appId :: Prelude.Maybe Prelude.Text
  }
  deriving (DeleteAppReplicationConfiguration
-> DeleteAppReplicationConfiguration -> Bool
(DeleteAppReplicationConfiguration
 -> DeleteAppReplicationConfiguration -> Bool)
-> (DeleteAppReplicationConfiguration
    -> DeleteAppReplicationConfiguration -> Bool)
-> Eq DeleteAppReplicationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAppReplicationConfiguration
-> DeleteAppReplicationConfiguration -> Bool
$c/= :: DeleteAppReplicationConfiguration
-> DeleteAppReplicationConfiguration -> Bool
== :: DeleteAppReplicationConfiguration
-> DeleteAppReplicationConfiguration -> Bool
$c== :: DeleteAppReplicationConfiguration
-> DeleteAppReplicationConfiguration -> Bool
Prelude.Eq, ReadPrec [DeleteAppReplicationConfiguration]
ReadPrec DeleteAppReplicationConfiguration
Int -> ReadS DeleteAppReplicationConfiguration
ReadS [DeleteAppReplicationConfiguration]
(Int -> ReadS DeleteAppReplicationConfiguration)
-> ReadS [DeleteAppReplicationConfiguration]
-> ReadPrec DeleteAppReplicationConfiguration
-> ReadPrec [DeleteAppReplicationConfiguration]
-> Read DeleteAppReplicationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAppReplicationConfiguration]
$creadListPrec :: ReadPrec [DeleteAppReplicationConfiguration]
readPrec :: ReadPrec DeleteAppReplicationConfiguration
$creadPrec :: ReadPrec DeleteAppReplicationConfiguration
readList :: ReadS [DeleteAppReplicationConfiguration]
$creadList :: ReadS [DeleteAppReplicationConfiguration]
readsPrec :: Int -> ReadS DeleteAppReplicationConfiguration
$creadsPrec :: Int -> ReadS DeleteAppReplicationConfiguration
Prelude.Read, Int -> DeleteAppReplicationConfiguration -> ShowS
[DeleteAppReplicationConfiguration] -> ShowS
DeleteAppReplicationConfiguration -> String
(Int -> DeleteAppReplicationConfiguration -> ShowS)
-> (DeleteAppReplicationConfiguration -> String)
-> ([DeleteAppReplicationConfiguration] -> ShowS)
-> Show DeleteAppReplicationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAppReplicationConfiguration] -> ShowS
$cshowList :: [DeleteAppReplicationConfiguration] -> ShowS
show :: DeleteAppReplicationConfiguration -> String
$cshow :: DeleteAppReplicationConfiguration -> String
showsPrec :: Int -> DeleteAppReplicationConfiguration -> ShowS
$cshowsPrec :: Int -> DeleteAppReplicationConfiguration -> ShowS
Prelude.Show, (forall x.
 DeleteAppReplicationConfiguration
 -> Rep DeleteAppReplicationConfiguration x)
-> (forall x.
    Rep DeleteAppReplicationConfiguration x
    -> DeleteAppReplicationConfiguration)
-> Generic DeleteAppReplicationConfiguration
forall x.
Rep DeleteAppReplicationConfiguration x
-> DeleteAppReplicationConfiguration
forall x.
DeleteAppReplicationConfiguration
-> Rep DeleteAppReplicationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteAppReplicationConfiguration x
-> DeleteAppReplicationConfiguration
$cfrom :: forall x.
DeleteAppReplicationConfiguration
-> Rep DeleteAppReplicationConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAppReplicationConfiguration' 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:
--
-- 'appId', 'deleteAppReplicationConfiguration_appId' - The ID of the application.
newDeleteAppReplicationConfiguration ::
  DeleteAppReplicationConfiguration
newDeleteAppReplicationConfiguration :: DeleteAppReplicationConfiguration
newDeleteAppReplicationConfiguration =
  DeleteAppReplicationConfiguration' :: Maybe Text -> DeleteAppReplicationConfiguration
DeleteAppReplicationConfiguration'
    { $sel:appId:DeleteAppReplicationConfiguration' :: Maybe Text
appId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the application.
deleteAppReplicationConfiguration_appId :: Lens.Lens' DeleteAppReplicationConfiguration (Prelude.Maybe Prelude.Text)
deleteAppReplicationConfiguration_appId :: (Maybe Text -> f (Maybe Text))
-> DeleteAppReplicationConfiguration
-> f DeleteAppReplicationConfiguration
deleteAppReplicationConfiguration_appId = (DeleteAppReplicationConfiguration -> Maybe Text)
-> (DeleteAppReplicationConfiguration
    -> Maybe Text -> DeleteAppReplicationConfiguration)
-> Lens
     DeleteAppReplicationConfiguration
     DeleteAppReplicationConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAppReplicationConfiguration' {Maybe Text
appId :: Maybe Text
$sel:appId:DeleteAppReplicationConfiguration' :: DeleteAppReplicationConfiguration -> Maybe Text
appId} -> Maybe Text
appId) (\s :: DeleteAppReplicationConfiguration
s@DeleteAppReplicationConfiguration' {} Maybe Text
a -> DeleteAppReplicationConfiguration
s {$sel:appId:DeleteAppReplicationConfiguration' :: Maybe Text
appId = Maybe Text
a} :: DeleteAppReplicationConfiguration)

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

instance
  Prelude.NFData
    DeleteAppReplicationConfiguration

instance
  Core.ToHeaders
    DeleteAppReplicationConfiguration
  where
  toHeaders :: DeleteAppReplicationConfiguration -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> DeleteAppReplicationConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSServerMigrationService_V2016_10_24.DeleteAppReplicationConfiguration" ::
                          Prelude.ByteString
                      ),
            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
    DeleteAppReplicationConfiguration
  where
  toJSON :: DeleteAppReplicationConfiguration -> Value
toJSON DeleteAppReplicationConfiguration' {Maybe Text
appId :: Maybe Text
$sel:appId:DeleteAppReplicationConfiguration' :: DeleteAppReplicationConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"appId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
appId]
      )

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

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

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

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

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

instance
  Prelude.NFData
    DeleteAppReplicationConfigurationResponse