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

    -- * Request Lenses
    deleteAppValidationConfiguration_appId,

    -- * Destructuring the Response
    DeleteAppValidationConfigurationResponse (..),
    newDeleteAppValidationConfigurationResponse,

    -- * Response Lenses
    deleteAppValidationConfigurationResponse_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:/ 'newDeleteAppValidationConfiguration' smart constructor.
data DeleteAppValidationConfiguration = DeleteAppValidationConfiguration'
  { -- | The ID of the application.
    DeleteAppValidationConfiguration -> Text
appId :: Prelude.Text
  }
  deriving (DeleteAppValidationConfiguration
-> DeleteAppValidationConfiguration -> Bool
(DeleteAppValidationConfiguration
 -> DeleteAppValidationConfiguration -> Bool)
-> (DeleteAppValidationConfiguration
    -> DeleteAppValidationConfiguration -> Bool)
-> Eq DeleteAppValidationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAppValidationConfiguration
-> DeleteAppValidationConfiguration -> Bool
$c/= :: DeleteAppValidationConfiguration
-> DeleteAppValidationConfiguration -> Bool
== :: DeleteAppValidationConfiguration
-> DeleteAppValidationConfiguration -> Bool
$c== :: DeleteAppValidationConfiguration
-> DeleteAppValidationConfiguration -> Bool
Prelude.Eq, ReadPrec [DeleteAppValidationConfiguration]
ReadPrec DeleteAppValidationConfiguration
Int -> ReadS DeleteAppValidationConfiguration
ReadS [DeleteAppValidationConfiguration]
(Int -> ReadS DeleteAppValidationConfiguration)
-> ReadS [DeleteAppValidationConfiguration]
-> ReadPrec DeleteAppValidationConfiguration
-> ReadPrec [DeleteAppValidationConfiguration]
-> Read DeleteAppValidationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAppValidationConfiguration]
$creadListPrec :: ReadPrec [DeleteAppValidationConfiguration]
readPrec :: ReadPrec DeleteAppValidationConfiguration
$creadPrec :: ReadPrec DeleteAppValidationConfiguration
readList :: ReadS [DeleteAppValidationConfiguration]
$creadList :: ReadS [DeleteAppValidationConfiguration]
readsPrec :: Int -> ReadS DeleteAppValidationConfiguration
$creadsPrec :: Int -> ReadS DeleteAppValidationConfiguration
Prelude.Read, Int -> DeleteAppValidationConfiguration -> ShowS
[DeleteAppValidationConfiguration] -> ShowS
DeleteAppValidationConfiguration -> String
(Int -> DeleteAppValidationConfiguration -> ShowS)
-> (DeleteAppValidationConfiguration -> String)
-> ([DeleteAppValidationConfiguration] -> ShowS)
-> Show DeleteAppValidationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAppValidationConfiguration] -> ShowS
$cshowList :: [DeleteAppValidationConfiguration] -> ShowS
show :: DeleteAppValidationConfiguration -> String
$cshow :: DeleteAppValidationConfiguration -> String
showsPrec :: Int -> DeleteAppValidationConfiguration -> ShowS
$cshowsPrec :: Int -> DeleteAppValidationConfiguration -> ShowS
Prelude.Show, (forall x.
 DeleteAppValidationConfiguration
 -> Rep DeleteAppValidationConfiguration x)
-> (forall x.
    Rep DeleteAppValidationConfiguration x
    -> DeleteAppValidationConfiguration)
-> Generic DeleteAppValidationConfiguration
forall x.
Rep DeleteAppValidationConfiguration x
-> DeleteAppValidationConfiguration
forall x.
DeleteAppValidationConfiguration
-> Rep DeleteAppValidationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteAppValidationConfiguration x
-> DeleteAppValidationConfiguration
$cfrom :: forall x.
DeleteAppValidationConfiguration
-> Rep DeleteAppValidationConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DeleteAppValidationConfiguration' 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', 'deleteAppValidationConfiguration_appId' - The ID of the application.
newDeleteAppValidationConfiguration ::
  -- | 'appId'
  Prelude.Text ->
  DeleteAppValidationConfiguration
newDeleteAppValidationConfiguration :: Text -> DeleteAppValidationConfiguration
newDeleteAppValidationConfiguration Text
pAppId_ =
  DeleteAppValidationConfiguration' :: Text -> DeleteAppValidationConfiguration
DeleteAppValidationConfiguration' {$sel:appId:DeleteAppValidationConfiguration' :: Text
appId = Text
pAppId_}

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

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

instance
  Prelude.NFData
    DeleteAppValidationConfiguration

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

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

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

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

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

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

instance
  Prelude.NFData
    DeleteAppValidationConfigurationResponse