{-# 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 #-}
module Amazonka.IoTFleetHub.DeleteApplication
(
DeleteApplication (..),
newDeleteApplication,
deleteApplication_clientToken,
deleteApplication_applicationId,
DeleteApplicationResponse (..),
newDeleteApplicationResponse,
deleteApplicationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoTFleetHub.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteApplication = DeleteApplication'
{
DeleteApplication -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
DeleteApplication -> Text
applicationId :: Prelude.Text
}
deriving (DeleteApplication -> DeleteApplication -> Bool
(DeleteApplication -> DeleteApplication -> Bool)
-> (DeleteApplication -> DeleteApplication -> Bool)
-> Eq DeleteApplication
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteApplication -> DeleteApplication -> Bool
$c/= :: DeleteApplication -> DeleteApplication -> Bool
== :: DeleteApplication -> DeleteApplication -> Bool
$c== :: DeleteApplication -> DeleteApplication -> Bool
Prelude.Eq, ReadPrec [DeleteApplication]
ReadPrec DeleteApplication
Int -> ReadS DeleteApplication
ReadS [DeleteApplication]
(Int -> ReadS DeleteApplication)
-> ReadS [DeleteApplication]
-> ReadPrec DeleteApplication
-> ReadPrec [DeleteApplication]
-> Read DeleteApplication
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteApplication]
$creadListPrec :: ReadPrec [DeleteApplication]
readPrec :: ReadPrec DeleteApplication
$creadPrec :: ReadPrec DeleteApplication
readList :: ReadS [DeleteApplication]
$creadList :: ReadS [DeleteApplication]
readsPrec :: Int -> ReadS DeleteApplication
$creadsPrec :: Int -> ReadS DeleteApplication
Prelude.Read, Int -> DeleteApplication -> ShowS
[DeleteApplication] -> ShowS
DeleteApplication -> String
(Int -> DeleteApplication -> ShowS)
-> (DeleteApplication -> String)
-> ([DeleteApplication] -> ShowS)
-> Show DeleteApplication
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteApplication] -> ShowS
$cshowList :: [DeleteApplication] -> ShowS
show :: DeleteApplication -> String
$cshow :: DeleteApplication -> String
showsPrec :: Int -> DeleteApplication -> ShowS
$cshowsPrec :: Int -> DeleteApplication -> ShowS
Prelude.Show, (forall x. DeleteApplication -> Rep DeleteApplication x)
-> (forall x. Rep DeleteApplication x -> DeleteApplication)
-> Generic DeleteApplication
forall x. Rep DeleteApplication x -> DeleteApplication
forall x. DeleteApplication -> Rep DeleteApplication x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteApplication x -> DeleteApplication
$cfrom :: forall x. DeleteApplication -> Rep DeleteApplication x
Prelude.Generic)
newDeleteApplication ::
Prelude.Text ->
DeleteApplication
newDeleteApplication :: Text -> DeleteApplication
newDeleteApplication Text
pApplicationId_ =
DeleteApplication' :: Maybe Text -> Text -> DeleteApplication
DeleteApplication'
{ $sel:clientToken:DeleteApplication' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:applicationId:DeleteApplication' :: Text
applicationId = Text
pApplicationId_
}
deleteApplication_clientToken :: Lens.Lens' DeleteApplication (Prelude.Maybe Prelude.Text)
deleteApplication_clientToken :: (Maybe Text -> f (Maybe Text))
-> DeleteApplication -> f DeleteApplication
deleteApplication_clientToken = (DeleteApplication -> Maybe Text)
-> (DeleteApplication -> Maybe Text -> DeleteApplication)
-> Lens
DeleteApplication DeleteApplication (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteApplication' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:DeleteApplication' :: DeleteApplication -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: DeleteApplication
s@DeleteApplication' {} Maybe Text
a -> DeleteApplication
s {$sel:clientToken:DeleteApplication' :: Maybe Text
clientToken = Maybe Text
a} :: DeleteApplication)
deleteApplication_applicationId :: Lens.Lens' DeleteApplication Prelude.Text
deleteApplication_applicationId :: (Text -> f Text) -> DeleteApplication -> f DeleteApplication
deleteApplication_applicationId = (DeleteApplication -> Text)
-> (DeleteApplication -> Text -> DeleteApplication)
-> Lens DeleteApplication DeleteApplication Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteApplication' {Text
applicationId :: Text
$sel:applicationId:DeleteApplication' :: DeleteApplication -> Text
applicationId} -> Text
applicationId) (\s :: DeleteApplication
s@DeleteApplication' {} Text
a -> DeleteApplication
s {$sel:applicationId:DeleteApplication' :: Text
applicationId = Text
a} :: DeleteApplication)
instance Core.AWSRequest DeleteApplication where
type
AWSResponse DeleteApplication =
DeleteApplicationResponse
request :: DeleteApplication -> Request DeleteApplication
request = Service -> DeleteApplication -> Request DeleteApplication
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteApplication
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteApplication)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteApplication))
-> Logger
-> Service
-> Proxy DeleteApplication
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteApplication)))
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 -> DeleteApplicationResponse
DeleteApplicationResponse'
(Int -> DeleteApplicationResponse)
-> Either String Int -> Either String DeleteApplicationResponse
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 DeleteApplication
instance Prelude.NFData DeleteApplication
instance Core.ToHeaders DeleteApplication where
toHeaders :: DeleteApplication -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteApplication -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath DeleteApplication where
toPath :: DeleteApplication -> ByteString
toPath DeleteApplication' {Maybe Text
Text
applicationId :: Text
clientToken :: Maybe Text
$sel:applicationId:DeleteApplication' :: DeleteApplication -> Text
$sel:clientToken:DeleteApplication' :: DeleteApplication -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/applications/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
applicationId]
instance Core.ToQuery DeleteApplication where
toQuery :: DeleteApplication -> QueryString
toQuery DeleteApplication' {Maybe Text
Text
applicationId :: Text
clientToken :: Maybe Text
$sel:applicationId:DeleteApplication' :: DeleteApplication -> Text
$sel:clientToken:DeleteApplication' :: DeleteApplication -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"clientToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
clientToken]
data DeleteApplicationResponse = DeleteApplicationResponse'
{
DeleteApplicationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteApplicationResponse -> DeleteApplicationResponse -> Bool
(DeleteApplicationResponse -> DeleteApplicationResponse -> Bool)
-> (DeleteApplicationResponse -> DeleteApplicationResponse -> Bool)
-> Eq DeleteApplicationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteApplicationResponse -> DeleteApplicationResponse -> Bool
$c/= :: DeleteApplicationResponse -> DeleteApplicationResponse -> Bool
== :: DeleteApplicationResponse -> DeleteApplicationResponse -> Bool
$c== :: DeleteApplicationResponse -> DeleteApplicationResponse -> Bool
Prelude.Eq, ReadPrec [DeleteApplicationResponse]
ReadPrec DeleteApplicationResponse
Int -> ReadS DeleteApplicationResponse
ReadS [DeleteApplicationResponse]
(Int -> ReadS DeleteApplicationResponse)
-> ReadS [DeleteApplicationResponse]
-> ReadPrec DeleteApplicationResponse
-> ReadPrec [DeleteApplicationResponse]
-> Read DeleteApplicationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteApplicationResponse]
$creadListPrec :: ReadPrec [DeleteApplicationResponse]
readPrec :: ReadPrec DeleteApplicationResponse
$creadPrec :: ReadPrec DeleteApplicationResponse
readList :: ReadS [DeleteApplicationResponse]
$creadList :: ReadS [DeleteApplicationResponse]
readsPrec :: Int -> ReadS DeleteApplicationResponse
$creadsPrec :: Int -> ReadS DeleteApplicationResponse
Prelude.Read, Int -> DeleteApplicationResponse -> ShowS
[DeleteApplicationResponse] -> ShowS
DeleteApplicationResponse -> String
(Int -> DeleteApplicationResponse -> ShowS)
-> (DeleteApplicationResponse -> String)
-> ([DeleteApplicationResponse] -> ShowS)
-> Show DeleteApplicationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteApplicationResponse] -> ShowS
$cshowList :: [DeleteApplicationResponse] -> ShowS
show :: DeleteApplicationResponse -> String
$cshow :: DeleteApplicationResponse -> String
showsPrec :: Int -> DeleteApplicationResponse -> ShowS
$cshowsPrec :: Int -> DeleteApplicationResponse -> ShowS
Prelude.Show, (forall x.
DeleteApplicationResponse -> Rep DeleteApplicationResponse x)
-> (forall x.
Rep DeleteApplicationResponse x -> DeleteApplicationResponse)
-> Generic DeleteApplicationResponse
forall x.
Rep DeleteApplicationResponse x -> DeleteApplicationResponse
forall x.
DeleteApplicationResponse -> Rep DeleteApplicationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteApplicationResponse x -> DeleteApplicationResponse
$cfrom :: forall x.
DeleteApplicationResponse -> Rep DeleteApplicationResponse x
Prelude.Generic)
newDeleteApplicationResponse ::
Prelude.Int ->
DeleteApplicationResponse
newDeleteApplicationResponse :: Int -> DeleteApplicationResponse
newDeleteApplicationResponse Int
pHttpStatus_ =
DeleteApplicationResponse' :: Int -> DeleteApplicationResponse
DeleteApplicationResponse'
{ $sel:httpStatus:DeleteApplicationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteApplicationResponse_httpStatus :: Lens.Lens' DeleteApplicationResponse Prelude.Int
deleteApplicationResponse_httpStatus :: (Int -> f Int)
-> DeleteApplicationResponse -> f DeleteApplicationResponse
deleteApplicationResponse_httpStatus = (DeleteApplicationResponse -> Int)
-> (DeleteApplicationResponse -> Int -> DeleteApplicationResponse)
-> Lens DeleteApplicationResponse DeleteApplicationResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteApplicationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteApplicationResponse' :: DeleteApplicationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteApplicationResponse
s@DeleteApplicationResponse' {} Int
a -> DeleteApplicationResponse
s {$sel:httpStatus:DeleteApplicationResponse' :: Int
httpStatus = Int
a} :: DeleteApplicationResponse)
instance Prelude.NFData DeleteApplicationResponse