{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.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:/ 'newDeleteAppLaunchConfiguration' smart constructor.
data DeleteAppLaunchConfiguration = DeleteAppLaunchConfiguration'
  { -- | The ID of the application.
    DeleteAppLaunchConfiguration -> Maybe Text
appId :: Prelude.Maybe Prelude.Text
  }
  deriving (DeleteAppLaunchConfiguration
-> DeleteAppLaunchConfiguration -> Bool
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]
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
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.
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'
    { $sel:appId:DeleteAppLaunchConfiguration' :: Maybe Text
appId =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the application.
deleteAppLaunchConfiguration_appId :: Lens.Lens' DeleteAppLaunchConfiguration (Prelude.Maybe Prelude.Text)
deleteAppLaunchConfiguration_appId :: Lens' DeleteAppLaunchConfiguration (Maybe Text)
deleteAppLaunchConfiguration_appId = 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 :: (Service -> Service)
-> DeleteAppLaunchConfiguration
-> Request DeleteAppLaunchConfiguration
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 DeleteAppLaunchConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteAppLaunchConfiguration)))
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 -> DeleteAppLaunchConfigurationResponse
DeleteAppLaunchConfigurationResponse'
            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
    DeleteAppLaunchConfiguration
  where
  hashWithSalt :: Int -> DeleteAppLaunchConfiguration -> Int
hashWithSalt Int
_salt DeleteAppLaunchConfiguration' {Maybe Text
appId :: Maybe Text
$sel:appId:DeleteAppLaunchConfiguration' :: DeleteAppLaunchConfiguration -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
appId

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

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

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

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