{-# 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.AmplifyBackend.RemoveBackendConfig
(
RemoveBackendConfig (..),
newRemoveBackendConfig,
removeBackendConfig_appId,
RemoveBackendConfigResponse (..),
newRemoveBackendConfigResponse,
removeBackendConfigResponse_error,
removeBackendConfigResponse_httpStatus,
)
where
import Amazonka.AmplifyBackend.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 RemoveBackendConfig = RemoveBackendConfig'
{
RemoveBackendConfig -> Text
appId :: Prelude.Text
}
deriving (RemoveBackendConfig -> RemoveBackendConfig -> Bool
(RemoveBackendConfig -> RemoveBackendConfig -> Bool)
-> (RemoveBackendConfig -> RemoveBackendConfig -> Bool)
-> Eq RemoveBackendConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveBackendConfig -> RemoveBackendConfig -> Bool
$c/= :: RemoveBackendConfig -> RemoveBackendConfig -> Bool
== :: RemoveBackendConfig -> RemoveBackendConfig -> Bool
$c== :: RemoveBackendConfig -> RemoveBackendConfig -> Bool
Prelude.Eq, ReadPrec [RemoveBackendConfig]
ReadPrec RemoveBackendConfig
Int -> ReadS RemoveBackendConfig
ReadS [RemoveBackendConfig]
(Int -> ReadS RemoveBackendConfig)
-> ReadS [RemoveBackendConfig]
-> ReadPrec RemoveBackendConfig
-> ReadPrec [RemoveBackendConfig]
-> Read RemoveBackendConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveBackendConfig]
$creadListPrec :: ReadPrec [RemoveBackendConfig]
readPrec :: ReadPrec RemoveBackendConfig
$creadPrec :: ReadPrec RemoveBackendConfig
readList :: ReadS [RemoveBackendConfig]
$creadList :: ReadS [RemoveBackendConfig]
readsPrec :: Int -> ReadS RemoveBackendConfig
$creadsPrec :: Int -> ReadS RemoveBackendConfig
Prelude.Read, Int -> RemoveBackendConfig -> ShowS
[RemoveBackendConfig] -> ShowS
RemoveBackendConfig -> String
(Int -> RemoveBackendConfig -> ShowS)
-> (RemoveBackendConfig -> String)
-> ([RemoveBackendConfig] -> ShowS)
-> Show RemoveBackendConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveBackendConfig] -> ShowS
$cshowList :: [RemoveBackendConfig] -> ShowS
show :: RemoveBackendConfig -> String
$cshow :: RemoveBackendConfig -> String
showsPrec :: Int -> RemoveBackendConfig -> ShowS
$cshowsPrec :: Int -> RemoveBackendConfig -> ShowS
Prelude.Show, (forall x. RemoveBackendConfig -> Rep RemoveBackendConfig x)
-> (forall x. Rep RemoveBackendConfig x -> RemoveBackendConfig)
-> Generic RemoveBackendConfig
forall x. Rep RemoveBackendConfig x -> RemoveBackendConfig
forall x. RemoveBackendConfig -> Rep RemoveBackendConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RemoveBackendConfig x -> RemoveBackendConfig
$cfrom :: forall x. RemoveBackendConfig -> Rep RemoveBackendConfig x
Prelude.Generic)
newRemoveBackendConfig ::
Prelude.Text ->
RemoveBackendConfig
newRemoveBackendConfig :: Text -> RemoveBackendConfig
newRemoveBackendConfig Text
pAppId_ =
RemoveBackendConfig' :: Text -> RemoveBackendConfig
RemoveBackendConfig' {$sel:appId:RemoveBackendConfig' :: Text
appId = Text
pAppId_}
removeBackendConfig_appId :: Lens.Lens' RemoveBackendConfig Prelude.Text
removeBackendConfig_appId :: (Text -> f Text) -> RemoveBackendConfig -> f RemoveBackendConfig
removeBackendConfig_appId = (RemoveBackendConfig -> Text)
-> (RemoveBackendConfig -> Text -> RemoveBackendConfig)
-> Lens RemoveBackendConfig RemoveBackendConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveBackendConfig' {Text
appId :: Text
$sel:appId:RemoveBackendConfig' :: RemoveBackendConfig -> Text
appId} -> Text
appId) (\s :: RemoveBackendConfig
s@RemoveBackendConfig' {} Text
a -> RemoveBackendConfig
s {$sel:appId:RemoveBackendConfig' :: Text
appId = Text
a} :: RemoveBackendConfig)
instance Core.AWSRequest RemoveBackendConfig where
type
AWSResponse RemoveBackendConfig =
RemoveBackendConfigResponse
request :: RemoveBackendConfig -> Request RemoveBackendConfig
request = Service -> RemoveBackendConfig -> Request RemoveBackendConfig
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RemoveBackendConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RemoveBackendConfig)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RemoveBackendConfig))
-> Logger
-> Service
-> Proxy RemoveBackendConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RemoveBackendConfig)))
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 ->
Maybe Text -> Int -> RemoveBackendConfigResponse
RemoveBackendConfigResponse'
(Maybe Text -> Int -> RemoveBackendConfigResponse)
-> Either String (Maybe Text)
-> Either String (Int -> RemoveBackendConfigResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"error")
Either String (Int -> RemoveBackendConfigResponse)
-> Either String Int -> Either String RemoveBackendConfigResponse
forall (f :: * -> *) a b. Applicative f => 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 RemoveBackendConfig
instance Prelude.NFData RemoveBackendConfig
instance Core.ToHeaders RemoveBackendConfig where
toHeaders :: RemoveBackendConfig -> ResponseHeaders
toHeaders =
ResponseHeaders -> RemoveBackendConfig -> 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.ToJSON RemoveBackendConfig where
toJSON :: RemoveBackendConfig -> Value
toJSON = Value -> RemoveBackendConfig -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath RemoveBackendConfig where
toPath :: RemoveBackendConfig -> ByteString
toPath RemoveBackendConfig' {Text
appId :: Text
$sel:appId:RemoveBackendConfig' :: RemoveBackendConfig -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/backend/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
appId, ByteString
"/config/remove"]
instance Core.ToQuery RemoveBackendConfig where
toQuery :: RemoveBackendConfig -> QueryString
toQuery = QueryString -> RemoveBackendConfig -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RemoveBackendConfigResponse = RemoveBackendConfigResponse'
{
RemoveBackendConfigResponse -> Maybe Text
error :: Prelude.Maybe Prelude.Text,
RemoveBackendConfigResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RemoveBackendConfigResponse -> RemoveBackendConfigResponse -> Bool
(RemoveBackendConfigResponse
-> RemoveBackendConfigResponse -> Bool)
-> (RemoveBackendConfigResponse
-> RemoveBackendConfigResponse -> Bool)
-> Eq RemoveBackendConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveBackendConfigResponse -> RemoveBackendConfigResponse -> Bool
$c/= :: RemoveBackendConfigResponse -> RemoveBackendConfigResponse -> Bool
== :: RemoveBackendConfigResponse -> RemoveBackendConfigResponse -> Bool
$c== :: RemoveBackendConfigResponse -> RemoveBackendConfigResponse -> Bool
Prelude.Eq, ReadPrec [RemoveBackendConfigResponse]
ReadPrec RemoveBackendConfigResponse
Int -> ReadS RemoveBackendConfigResponse
ReadS [RemoveBackendConfigResponse]
(Int -> ReadS RemoveBackendConfigResponse)
-> ReadS [RemoveBackendConfigResponse]
-> ReadPrec RemoveBackendConfigResponse
-> ReadPrec [RemoveBackendConfigResponse]
-> Read RemoveBackendConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveBackendConfigResponse]
$creadListPrec :: ReadPrec [RemoveBackendConfigResponse]
readPrec :: ReadPrec RemoveBackendConfigResponse
$creadPrec :: ReadPrec RemoveBackendConfigResponse
readList :: ReadS [RemoveBackendConfigResponse]
$creadList :: ReadS [RemoveBackendConfigResponse]
readsPrec :: Int -> ReadS RemoveBackendConfigResponse
$creadsPrec :: Int -> ReadS RemoveBackendConfigResponse
Prelude.Read, Int -> RemoveBackendConfigResponse -> ShowS
[RemoveBackendConfigResponse] -> ShowS
RemoveBackendConfigResponse -> String
(Int -> RemoveBackendConfigResponse -> ShowS)
-> (RemoveBackendConfigResponse -> String)
-> ([RemoveBackendConfigResponse] -> ShowS)
-> Show RemoveBackendConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveBackendConfigResponse] -> ShowS
$cshowList :: [RemoveBackendConfigResponse] -> ShowS
show :: RemoveBackendConfigResponse -> String
$cshow :: RemoveBackendConfigResponse -> String
showsPrec :: Int -> RemoveBackendConfigResponse -> ShowS
$cshowsPrec :: Int -> RemoveBackendConfigResponse -> ShowS
Prelude.Show, (forall x.
RemoveBackendConfigResponse -> Rep RemoveBackendConfigResponse x)
-> (forall x.
Rep RemoveBackendConfigResponse x -> RemoveBackendConfigResponse)
-> Generic RemoveBackendConfigResponse
forall x.
Rep RemoveBackendConfigResponse x -> RemoveBackendConfigResponse
forall x.
RemoveBackendConfigResponse -> Rep RemoveBackendConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemoveBackendConfigResponse x -> RemoveBackendConfigResponse
$cfrom :: forall x.
RemoveBackendConfigResponse -> Rep RemoveBackendConfigResponse x
Prelude.Generic)
newRemoveBackendConfigResponse ::
Prelude.Int ->
RemoveBackendConfigResponse
newRemoveBackendConfigResponse :: Int -> RemoveBackendConfigResponse
newRemoveBackendConfigResponse Int
pHttpStatus_ =
RemoveBackendConfigResponse' :: Maybe Text -> Int -> RemoveBackendConfigResponse
RemoveBackendConfigResponse'
{ $sel:error:RemoveBackendConfigResponse' :: Maybe Text
error =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RemoveBackendConfigResponse' :: Int
httpStatus = Int
pHttpStatus_
}
removeBackendConfigResponse_error :: Lens.Lens' RemoveBackendConfigResponse (Prelude.Maybe Prelude.Text)
removeBackendConfigResponse_error :: (Maybe Text -> f (Maybe Text))
-> RemoveBackendConfigResponse -> f RemoveBackendConfigResponse
removeBackendConfigResponse_error = (RemoveBackendConfigResponse -> Maybe Text)
-> (RemoveBackendConfigResponse
-> Maybe Text -> RemoveBackendConfigResponse)
-> Lens
RemoveBackendConfigResponse
RemoveBackendConfigResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveBackendConfigResponse' {Maybe Text
error :: Maybe Text
$sel:error:RemoveBackendConfigResponse' :: RemoveBackendConfigResponse -> Maybe Text
error} -> Maybe Text
error) (\s :: RemoveBackendConfigResponse
s@RemoveBackendConfigResponse' {} Maybe Text
a -> RemoveBackendConfigResponse
s {$sel:error:RemoveBackendConfigResponse' :: Maybe Text
error = Maybe Text
a} :: RemoveBackendConfigResponse)
removeBackendConfigResponse_httpStatus :: Lens.Lens' RemoveBackendConfigResponse Prelude.Int
removeBackendConfigResponse_httpStatus :: (Int -> f Int)
-> RemoveBackendConfigResponse -> f RemoveBackendConfigResponse
removeBackendConfigResponse_httpStatus = (RemoveBackendConfigResponse -> Int)
-> (RemoveBackendConfigResponse
-> Int -> RemoveBackendConfigResponse)
-> Lens
RemoveBackendConfigResponse RemoveBackendConfigResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveBackendConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:RemoveBackendConfigResponse' :: RemoveBackendConfigResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RemoveBackendConfigResponse
s@RemoveBackendConfigResponse' {} Int
a -> RemoveBackendConfigResponse
s {$sel:httpStatus:RemoveBackendConfigResponse' :: Int
httpStatus = Int
a} :: RemoveBackendConfigResponse)
instance Prelude.NFData RemoveBackendConfigResponse