{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
    { $sel:appId:DeleteAppReplicationConfiguration' :: Maybe Text
appId =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the application.
deleteAppReplicationConfiguration_appId :: Lens.Lens' DeleteAppReplicationConfiguration (Prelude.Maybe Prelude.Text)
deleteAppReplicationConfiguration_appId :: Lens' DeleteAppReplicationConfiguration (Maybe Text)
deleteAppReplicationConfiguration_appId = 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 :: (Service -> Service)
-> DeleteAppReplicationConfiguration
-> Request DeleteAppReplicationConfiguration
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteAppReplicationConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteAppReplicationConfiguration)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteAppReplicationConfigurationResponse
DeleteAppReplicationConfigurationResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    DeleteAppReplicationConfiguration
  where
  hashWithSalt :: Int -> DeleteAppReplicationConfiguration -> Int
hashWithSalt
    Int
_salt
    DeleteAppReplicationConfiguration' {Maybe Text
appId :: Maybe Text
$sel:appId:DeleteAppReplicationConfiguration' :: DeleteAppReplicationConfiguration -> Maybe Text
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
appId

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

instance
  Data.ToHeaders
    DeleteAppReplicationConfiguration
  where
  toHeaders :: DeleteAppReplicationConfiguration -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSServerMigrationService_V2016_10_24.DeleteAppReplicationConfiguration" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Data.ToJSON
    DeleteAppReplicationConfiguration
  where
  toJSON :: DeleteAppReplicationConfiguration -> Value
toJSON DeleteAppReplicationConfiguration' {Maybe Text
appId :: Maybe Text
$sel:appId:DeleteAppReplicationConfiguration' :: DeleteAppReplicationConfiguration -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"appId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
appId]
      )

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

instance
  Data.ToQuery
    DeleteAppReplicationConfiguration
  where
  toQuery :: DeleteAppReplicationConfiguration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
      { $sel:httpStatus:DeleteAppReplicationConfigurationResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | The response's http status code.
deleteAppReplicationConfigurationResponse_httpStatus :: Lens.Lens' DeleteAppReplicationConfigurationResponse Prelude.Int
deleteAppReplicationConfigurationResponse_httpStatus :: Lens' DeleteAppReplicationConfigurationResponse Int
deleteAppReplicationConfigurationResponse_httpStatus = 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
  where
  rnf :: DeleteAppReplicationConfigurationResponse -> ()
rnf DeleteAppReplicationConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteAppReplicationConfigurationResponse' :: DeleteAppReplicationConfigurationResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus