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

    -- * Request Lenses
    deleteAppLaunchConfiguration_appId,

    -- * Destructuring the Response
    DeleteAppLaunchConfigurationResponse (..),
    newDeleteAppLaunchConfigurationResponse,

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

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

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

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

instance Prelude.NFData DeleteAppLaunchConfiguration

instance Core.ToHeaders DeleteAppLaunchConfiguration where
  toHeaders :: DeleteAppLaunchConfiguration -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteAppLaunchConfiguration -> 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.DeleteAppLaunchConfiguration" ::
                          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 DeleteAppLaunchConfiguration where
  toJSON :: DeleteAppLaunchConfiguration -> Value
toJSON DeleteAppLaunchConfiguration' {Maybe Text
appId :: Maybe Text
$sel:appId:DeleteAppLaunchConfiguration' :: DeleteAppLaunchConfiguration -> 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 DeleteAppLaunchConfiguration where
  toPath :: DeleteAppLaunchConfiguration -> ByteString
toPath = ByteString -> DeleteAppLaunchConfiguration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

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

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

instance
  Prelude.NFData
    DeleteAppLaunchConfigurationResponse