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