{-# 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.AppSync.DeleteResolver
(
DeleteResolver (..),
newDeleteResolver,
deleteResolver_apiId,
deleteResolver_typeName,
deleteResolver_fieldName,
DeleteResolverResponse (..),
newDeleteResolverResponse,
deleteResolverResponse_httpStatus,
)
where
import Amazonka.AppSync.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 DeleteResolver = DeleteResolver'
{
DeleteResolver -> Text
apiId :: Prelude.Text,
DeleteResolver -> Text
typeName :: Prelude.Text,
DeleteResolver -> Text
fieldName :: Prelude.Text
}
deriving (DeleteResolver -> DeleteResolver -> Bool
(DeleteResolver -> DeleteResolver -> Bool)
-> (DeleteResolver -> DeleteResolver -> Bool) -> Eq DeleteResolver
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteResolver -> DeleteResolver -> Bool
$c/= :: DeleteResolver -> DeleteResolver -> Bool
== :: DeleteResolver -> DeleteResolver -> Bool
$c== :: DeleteResolver -> DeleteResolver -> Bool
Prelude.Eq, ReadPrec [DeleteResolver]
ReadPrec DeleteResolver
Int -> ReadS DeleteResolver
ReadS [DeleteResolver]
(Int -> ReadS DeleteResolver)
-> ReadS [DeleteResolver]
-> ReadPrec DeleteResolver
-> ReadPrec [DeleteResolver]
-> Read DeleteResolver
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteResolver]
$creadListPrec :: ReadPrec [DeleteResolver]
readPrec :: ReadPrec DeleteResolver
$creadPrec :: ReadPrec DeleteResolver
readList :: ReadS [DeleteResolver]
$creadList :: ReadS [DeleteResolver]
readsPrec :: Int -> ReadS DeleteResolver
$creadsPrec :: Int -> ReadS DeleteResolver
Prelude.Read, Int -> DeleteResolver -> ShowS
[DeleteResolver] -> ShowS
DeleteResolver -> String
(Int -> DeleteResolver -> ShowS)
-> (DeleteResolver -> String)
-> ([DeleteResolver] -> ShowS)
-> Show DeleteResolver
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteResolver] -> ShowS
$cshowList :: [DeleteResolver] -> ShowS
show :: DeleteResolver -> String
$cshow :: DeleteResolver -> String
showsPrec :: Int -> DeleteResolver -> ShowS
$cshowsPrec :: Int -> DeleteResolver -> ShowS
Prelude.Show, (forall x. DeleteResolver -> Rep DeleteResolver x)
-> (forall x. Rep DeleteResolver x -> DeleteResolver)
-> Generic DeleteResolver
forall x. Rep DeleteResolver x -> DeleteResolver
forall x. DeleteResolver -> Rep DeleteResolver x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteResolver x -> DeleteResolver
$cfrom :: forall x. DeleteResolver -> Rep DeleteResolver x
Prelude.Generic)
newDeleteResolver ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DeleteResolver
newDeleteResolver :: Text -> Text -> Text -> DeleteResolver
newDeleteResolver Text
pApiId_ Text
pTypeName_ Text
pFieldName_ =
DeleteResolver' :: Text -> Text -> Text -> DeleteResolver
DeleteResolver'
{ $sel:apiId:DeleteResolver' :: Text
apiId = Text
pApiId_,
$sel:typeName:DeleteResolver' :: Text
typeName = Text
pTypeName_,
$sel:fieldName:DeleteResolver' :: Text
fieldName = Text
pFieldName_
}
deleteResolver_apiId :: Lens.Lens' DeleteResolver Prelude.Text
deleteResolver_apiId :: (Text -> f Text) -> DeleteResolver -> f DeleteResolver
deleteResolver_apiId = (DeleteResolver -> Text)
-> (DeleteResolver -> Text -> DeleteResolver)
-> Lens DeleteResolver DeleteResolver Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteResolver' {Text
apiId :: Text
$sel:apiId:DeleteResolver' :: DeleteResolver -> Text
apiId} -> Text
apiId) (\s :: DeleteResolver
s@DeleteResolver' {} Text
a -> DeleteResolver
s {$sel:apiId:DeleteResolver' :: Text
apiId = Text
a} :: DeleteResolver)
deleteResolver_typeName :: Lens.Lens' DeleteResolver Prelude.Text
deleteResolver_typeName :: (Text -> f Text) -> DeleteResolver -> f DeleteResolver
deleteResolver_typeName = (DeleteResolver -> Text)
-> (DeleteResolver -> Text -> DeleteResolver)
-> Lens DeleteResolver DeleteResolver Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteResolver' {Text
typeName :: Text
$sel:typeName:DeleteResolver' :: DeleteResolver -> Text
typeName} -> Text
typeName) (\s :: DeleteResolver
s@DeleteResolver' {} Text
a -> DeleteResolver
s {$sel:typeName:DeleteResolver' :: Text
typeName = Text
a} :: DeleteResolver)
deleteResolver_fieldName :: Lens.Lens' DeleteResolver Prelude.Text
deleteResolver_fieldName :: (Text -> f Text) -> DeleteResolver -> f DeleteResolver
deleteResolver_fieldName = (DeleteResolver -> Text)
-> (DeleteResolver -> Text -> DeleteResolver)
-> Lens DeleteResolver DeleteResolver Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteResolver' {Text
fieldName :: Text
$sel:fieldName:DeleteResolver' :: DeleteResolver -> Text
fieldName} -> Text
fieldName) (\s :: DeleteResolver
s@DeleteResolver' {} Text
a -> DeleteResolver
s {$sel:fieldName:DeleteResolver' :: Text
fieldName = Text
a} :: DeleteResolver)
instance Core.AWSRequest DeleteResolver where
type
AWSResponse DeleteResolver =
DeleteResolverResponse
request :: DeleteResolver -> Request DeleteResolver
request = Service -> DeleteResolver -> Request DeleteResolver
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteResolver
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteResolver)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteResolver))
-> Logger
-> Service
-> Proxy DeleteResolver
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteResolver)))
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 -> DeleteResolverResponse
DeleteResolverResponse'
(Int -> DeleteResolverResponse)
-> Either String Int -> Either String DeleteResolverResponse
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 DeleteResolver
instance Prelude.NFData DeleteResolver
instance Core.ToHeaders DeleteResolver where
toHeaders :: DeleteResolver -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteResolver -> 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 DeleteResolver where
toPath :: DeleteResolver -> ByteString
toPath DeleteResolver' {Text
fieldName :: Text
typeName :: Text
apiId :: Text
$sel:fieldName:DeleteResolver' :: DeleteResolver -> Text
$sel:typeName:DeleteResolver' :: DeleteResolver -> Text
$sel:apiId:DeleteResolver' :: DeleteResolver -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v1/apis/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiId,
ByteString
"/types/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
typeName,
ByteString
"/resolvers/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
fieldName
]
instance Core.ToQuery DeleteResolver where
toQuery :: DeleteResolver -> QueryString
toQuery = QueryString -> DeleteResolver -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteResolverResponse = DeleteResolverResponse'
{
DeleteResolverResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteResolverResponse -> DeleteResolverResponse -> Bool
(DeleteResolverResponse -> DeleteResolverResponse -> Bool)
-> (DeleteResolverResponse -> DeleteResolverResponse -> Bool)
-> Eq DeleteResolverResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteResolverResponse -> DeleteResolverResponse -> Bool
$c/= :: DeleteResolverResponse -> DeleteResolverResponse -> Bool
== :: DeleteResolverResponse -> DeleteResolverResponse -> Bool
$c== :: DeleteResolverResponse -> DeleteResolverResponse -> Bool
Prelude.Eq, ReadPrec [DeleteResolverResponse]
ReadPrec DeleteResolverResponse
Int -> ReadS DeleteResolverResponse
ReadS [DeleteResolverResponse]
(Int -> ReadS DeleteResolverResponse)
-> ReadS [DeleteResolverResponse]
-> ReadPrec DeleteResolverResponse
-> ReadPrec [DeleteResolverResponse]
-> Read DeleteResolverResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteResolverResponse]
$creadListPrec :: ReadPrec [DeleteResolverResponse]
readPrec :: ReadPrec DeleteResolverResponse
$creadPrec :: ReadPrec DeleteResolverResponse
readList :: ReadS [DeleteResolverResponse]
$creadList :: ReadS [DeleteResolverResponse]
readsPrec :: Int -> ReadS DeleteResolverResponse
$creadsPrec :: Int -> ReadS DeleteResolverResponse
Prelude.Read, Int -> DeleteResolverResponse -> ShowS
[DeleteResolverResponse] -> ShowS
DeleteResolverResponse -> String
(Int -> DeleteResolverResponse -> ShowS)
-> (DeleteResolverResponse -> String)
-> ([DeleteResolverResponse] -> ShowS)
-> Show DeleteResolverResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteResolverResponse] -> ShowS
$cshowList :: [DeleteResolverResponse] -> ShowS
show :: DeleteResolverResponse -> String
$cshow :: DeleteResolverResponse -> String
showsPrec :: Int -> DeleteResolverResponse -> ShowS
$cshowsPrec :: Int -> DeleteResolverResponse -> ShowS
Prelude.Show, (forall x. DeleteResolverResponse -> Rep DeleteResolverResponse x)
-> (forall x.
Rep DeleteResolverResponse x -> DeleteResolverResponse)
-> Generic DeleteResolverResponse
forall x. Rep DeleteResolverResponse x -> DeleteResolverResponse
forall x. DeleteResolverResponse -> Rep DeleteResolverResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteResolverResponse x -> DeleteResolverResponse
$cfrom :: forall x. DeleteResolverResponse -> Rep DeleteResolverResponse x
Prelude.Generic)
newDeleteResolverResponse ::
Prelude.Int ->
DeleteResolverResponse
newDeleteResolverResponse :: Int -> DeleteResolverResponse
newDeleteResolverResponse Int
pHttpStatus_ =
DeleteResolverResponse' :: Int -> DeleteResolverResponse
DeleteResolverResponse' {$sel:httpStatus:DeleteResolverResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteResolverResponse_httpStatus :: Lens.Lens' DeleteResolverResponse Prelude.Int
deleteResolverResponse_httpStatus :: (Int -> f Int)
-> DeleteResolverResponse -> f DeleteResolverResponse
deleteResolverResponse_httpStatus = (DeleteResolverResponse -> Int)
-> (DeleteResolverResponse -> Int -> DeleteResolverResponse)
-> Lens DeleteResolverResponse DeleteResolverResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteResolverResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteResolverResponse' :: DeleteResolverResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteResolverResponse
s@DeleteResolverResponse' {} Int
a -> DeleteResolverResponse
s {$sel:httpStatus:DeleteResolverResponse' :: Int
httpStatus = Int
a} :: DeleteResolverResponse)
instance Prelude.NFData DeleteResolverResponse