{-# 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.Amplify.DeleteApp
(
DeleteApp (..),
newDeleteApp,
deleteApp_appId,
DeleteAppResponse (..),
newDeleteAppResponse,
deleteAppResponse_httpStatus,
deleteAppResponse_app,
)
where
import Amazonka.Amplify.Types
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
data DeleteApp = DeleteApp'
{
DeleteApp -> Text
appId :: Prelude.Text
}
deriving (DeleteApp -> DeleteApp -> Bool
(DeleteApp -> DeleteApp -> Bool)
-> (DeleteApp -> DeleteApp -> Bool) -> Eq DeleteApp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteApp -> DeleteApp -> Bool
$c/= :: DeleteApp -> DeleteApp -> Bool
== :: DeleteApp -> DeleteApp -> Bool
$c== :: DeleteApp -> DeleteApp -> Bool
Prelude.Eq, ReadPrec [DeleteApp]
ReadPrec DeleteApp
Int -> ReadS DeleteApp
ReadS [DeleteApp]
(Int -> ReadS DeleteApp)
-> ReadS [DeleteApp]
-> ReadPrec DeleteApp
-> ReadPrec [DeleteApp]
-> Read DeleteApp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteApp]
$creadListPrec :: ReadPrec [DeleteApp]
readPrec :: ReadPrec DeleteApp
$creadPrec :: ReadPrec DeleteApp
readList :: ReadS [DeleteApp]
$creadList :: ReadS [DeleteApp]
readsPrec :: Int -> ReadS DeleteApp
$creadsPrec :: Int -> ReadS DeleteApp
Prelude.Read, Int -> DeleteApp -> ShowS
[DeleteApp] -> ShowS
DeleteApp -> String
(Int -> DeleteApp -> ShowS)
-> (DeleteApp -> String)
-> ([DeleteApp] -> ShowS)
-> Show DeleteApp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteApp] -> ShowS
$cshowList :: [DeleteApp] -> ShowS
show :: DeleteApp -> String
$cshow :: DeleteApp -> String
showsPrec :: Int -> DeleteApp -> ShowS
$cshowsPrec :: Int -> DeleteApp -> ShowS
Prelude.Show, (forall x. DeleteApp -> Rep DeleteApp x)
-> (forall x. Rep DeleteApp x -> DeleteApp) -> Generic DeleteApp
forall x. Rep DeleteApp x -> DeleteApp
forall x. DeleteApp -> Rep DeleteApp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteApp x -> DeleteApp
$cfrom :: forall x. DeleteApp -> Rep DeleteApp x
Prelude.Generic)
newDeleteApp ::
Prelude.Text ->
DeleteApp
newDeleteApp :: Text -> DeleteApp
newDeleteApp Text
pAppId_ = DeleteApp' :: Text -> DeleteApp
DeleteApp' {$sel:appId:DeleteApp' :: Text
appId = Text
pAppId_}
deleteApp_appId :: Lens.Lens' DeleteApp Prelude.Text
deleteApp_appId :: (Text -> f Text) -> DeleteApp -> f DeleteApp
deleteApp_appId = (DeleteApp -> Text)
-> (DeleteApp -> Text -> DeleteApp)
-> Lens DeleteApp DeleteApp Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteApp' {Text
appId :: Text
$sel:appId:DeleteApp' :: DeleteApp -> Text
appId} -> Text
appId) (\s :: DeleteApp
s@DeleteApp' {} Text
a -> DeleteApp
s {$sel:appId:DeleteApp' :: Text
appId = Text
a} :: DeleteApp)
instance Core.AWSRequest DeleteApp where
type AWSResponse DeleteApp = DeleteAppResponse
request :: DeleteApp -> Request DeleteApp
request = Service -> DeleteApp -> Request DeleteApp
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteApp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteApp)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteApp))
-> Logger
-> Service
-> Proxy DeleteApp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteApp)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> App -> DeleteAppResponse
DeleteAppResponse'
(Int -> App -> DeleteAppResponse)
-> Either String Int -> Either String (App -> DeleteAppResponse)
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))
Either String (App -> DeleteAppResponse)
-> Either String App -> Either String DeleteAppResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String App
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"app")
)
instance Prelude.Hashable DeleteApp
instance Prelude.NFData DeleteApp
instance Core.ToHeaders DeleteApp where
toHeaders :: DeleteApp -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteApp -> 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 DeleteApp where
toPath :: DeleteApp -> ByteString
toPath DeleteApp' {Text
appId :: Text
$sel:appId:DeleteApp' :: DeleteApp -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/apps/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
appId]
instance Core.ToQuery DeleteApp where
toQuery :: DeleteApp -> QueryString
toQuery = QueryString -> DeleteApp -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteAppResponse = DeleteAppResponse'
{
DeleteAppResponse -> Int
httpStatus :: Prelude.Int,
DeleteAppResponse -> App
app :: App
}
deriving (DeleteAppResponse -> DeleteAppResponse -> Bool
(DeleteAppResponse -> DeleteAppResponse -> Bool)
-> (DeleteAppResponse -> DeleteAppResponse -> Bool)
-> Eq DeleteAppResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAppResponse -> DeleteAppResponse -> Bool
$c/= :: DeleteAppResponse -> DeleteAppResponse -> Bool
== :: DeleteAppResponse -> DeleteAppResponse -> Bool
$c== :: DeleteAppResponse -> DeleteAppResponse -> Bool
Prelude.Eq, Int -> DeleteAppResponse -> ShowS
[DeleteAppResponse] -> ShowS
DeleteAppResponse -> String
(Int -> DeleteAppResponse -> ShowS)
-> (DeleteAppResponse -> String)
-> ([DeleteAppResponse] -> ShowS)
-> Show DeleteAppResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAppResponse] -> ShowS
$cshowList :: [DeleteAppResponse] -> ShowS
show :: DeleteAppResponse -> String
$cshow :: DeleteAppResponse -> String
showsPrec :: Int -> DeleteAppResponse -> ShowS
$cshowsPrec :: Int -> DeleteAppResponse -> ShowS
Prelude.Show, (forall x. DeleteAppResponse -> Rep DeleteAppResponse x)
-> (forall x. Rep DeleteAppResponse x -> DeleteAppResponse)
-> Generic DeleteAppResponse
forall x. Rep DeleteAppResponse x -> DeleteAppResponse
forall x. DeleteAppResponse -> Rep DeleteAppResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAppResponse x -> DeleteAppResponse
$cfrom :: forall x. DeleteAppResponse -> Rep DeleteAppResponse x
Prelude.Generic)
newDeleteAppResponse ::
Prelude.Int ->
App ->
DeleteAppResponse
newDeleteAppResponse :: Int -> App -> DeleteAppResponse
newDeleteAppResponse Int
pHttpStatus_ App
pApp_ =
DeleteAppResponse' :: Int -> App -> DeleteAppResponse
DeleteAppResponse'
{ $sel:httpStatus:DeleteAppResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:app:DeleteAppResponse' :: App
app = App
pApp_
}
deleteAppResponse_httpStatus :: Lens.Lens' DeleteAppResponse Prelude.Int
deleteAppResponse_httpStatus :: (Int -> f Int) -> DeleteAppResponse -> f DeleteAppResponse
deleteAppResponse_httpStatus = (DeleteAppResponse -> Int)
-> (DeleteAppResponse -> Int -> DeleteAppResponse)
-> Lens DeleteAppResponse DeleteAppResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAppResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteAppResponse' :: DeleteAppResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteAppResponse
s@DeleteAppResponse' {} Int
a -> DeleteAppResponse
s {$sel:httpStatus:DeleteAppResponse' :: Int
httpStatus = Int
a} :: DeleteAppResponse)
deleteAppResponse_app :: Lens.Lens' DeleteAppResponse App
deleteAppResponse_app :: (App -> f App) -> DeleteAppResponse -> f DeleteAppResponse
deleteAppResponse_app = (DeleteAppResponse -> App)
-> (DeleteAppResponse -> App -> DeleteAppResponse)
-> Lens DeleteAppResponse DeleteAppResponse App App
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAppResponse' {App
app :: App
$sel:app:DeleteAppResponse' :: DeleteAppResponse -> App
app} -> App
app) (\s :: DeleteAppResponse
s@DeleteAppResponse' {} App
a -> DeleteAppResponse
s {$sel:app:DeleteAppResponse' :: App
app = App
a} :: DeleteAppResponse)
instance Prelude.NFData DeleteAppResponse