{-# 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.RAM.RejectResourceShareInvitation
(
RejectResourceShareInvitation (..),
newRejectResourceShareInvitation,
rejectResourceShareInvitation_clientToken,
rejectResourceShareInvitation_resourceShareInvitationArn,
RejectResourceShareInvitationResponse (..),
newRejectResourceShareInvitationResponse,
rejectResourceShareInvitationResponse_clientToken,
rejectResourceShareInvitationResponse_resourceShareInvitation,
rejectResourceShareInvitationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RAM.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data RejectResourceShareInvitation = RejectResourceShareInvitation'
{
RejectResourceShareInvitation -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
RejectResourceShareInvitation -> Text
resourceShareInvitationArn :: Prelude.Text
}
deriving (RejectResourceShareInvitation
-> RejectResourceShareInvitation -> Bool
(RejectResourceShareInvitation
-> RejectResourceShareInvitation -> Bool)
-> (RejectResourceShareInvitation
-> RejectResourceShareInvitation -> Bool)
-> Eq RejectResourceShareInvitation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RejectResourceShareInvitation
-> RejectResourceShareInvitation -> Bool
$c/= :: RejectResourceShareInvitation
-> RejectResourceShareInvitation -> Bool
== :: RejectResourceShareInvitation
-> RejectResourceShareInvitation -> Bool
$c== :: RejectResourceShareInvitation
-> RejectResourceShareInvitation -> Bool
Prelude.Eq, ReadPrec [RejectResourceShareInvitation]
ReadPrec RejectResourceShareInvitation
Int -> ReadS RejectResourceShareInvitation
ReadS [RejectResourceShareInvitation]
(Int -> ReadS RejectResourceShareInvitation)
-> ReadS [RejectResourceShareInvitation]
-> ReadPrec RejectResourceShareInvitation
-> ReadPrec [RejectResourceShareInvitation]
-> Read RejectResourceShareInvitation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RejectResourceShareInvitation]
$creadListPrec :: ReadPrec [RejectResourceShareInvitation]
readPrec :: ReadPrec RejectResourceShareInvitation
$creadPrec :: ReadPrec RejectResourceShareInvitation
readList :: ReadS [RejectResourceShareInvitation]
$creadList :: ReadS [RejectResourceShareInvitation]
readsPrec :: Int -> ReadS RejectResourceShareInvitation
$creadsPrec :: Int -> ReadS RejectResourceShareInvitation
Prelude.Read, Int -> RejectResourceShareInvitation -> ShowS
[RejectResourceShareInvitation] -> ShowS
RejectResourceShareInvitation -> String
(Int -> RejectResourceShareInvitation -> ShowS)
-> (RejectResourceShareInvitation -> String)
-> ([RejectResourceShareInvitation] -> ShowS)
-> Show RejectResourceShareInvitation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RejectResourceShareInvitation] -> ShowS
$cshowList :: [RejectResourceShareInvitation] -> ShowS
show :: RejectResourceShareInvitation -> String
$cshow :: RejectResourceShareInvitation -> String
showsPrec :: Int -> RejectResourceShareInvitation -> ShowS
$cshowsPrec :: Int -> RejectResourceShareInvitation -> ShowS
Prelude.Show, (forall x.
RejectResourceShareInvitation
-> Rep RejectResourceShareInvitation x)
-> (forall x.
Rep RejectResourceShareInvitation x
-> RejectResourceShareInvitation)
-> Generic RejectResourceShareInvitation
forall x.
Rep RejectResourceShareInvitation x
-> RejectResourceShareInvitation
forall x.
RejectResourceShareInvitation
-> Rep RejectResourceShareInvitation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RejectResourceShareInvitation x
-> RejectResourceShareInvitation
$cfrom :: forall x.
RejectResourceShareInvitation
-> Rep RejectResourceShareInvitation x
Prelude.Generic)
newRejectResourceShareInvitation ::
Prelude.Text ->
RejectResourceShareInvitation
newRejectResourceShareInvitation :: Text -> RejectResourceShareInvitation
newRejectResourceShareInvitation
Text
pResourceShareInvitationArn_ =
RejectResourceShareInvitation' :: Maybe Text -> Text -> RejectResourceShareInvitation
RejectResourceShareInvitation'
{ $sel:clientToken:RejectResourceShareInvitation' :: Maybe Text
clientToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:resourceShareInvitationArn:RejectResourceShareInvitation' :: Text
resourceShareInvitationArn =
Text
pResourceShareInvitationArn_
}
rejectResourceShareInvitation_clientToken :: Lens.Lens' RejectResourceShareInvitation (Prelude.Maybe Prelude.Text)
rejectResourceShareInvitation_clientToken :: (Maybe Text -> f (Maybe Text))
-> RejectResourceShareInvitation -> f RejectResourceShareInvitation
rejectResourceShareInvitation_clientToken = (RejectResourceShareInvitation -> Maybe Text)
-> (RejectResourceShareInvitation
-> Maybe Text -> RejectResourceShareInvitation)
-> Lens
RejectResourceShareInvitation
RejectResourceShareInvitation
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectResourceShareInvitation' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:RejectResourceShareInvitation' :: RejectResourceShareInvitation -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: RejectResourceShareInvitation
s@RejectResourceShareInvitation' {} Maybe Text
a -> RejectResourceShareInvitation
s {$sel:clientToken:RejectResourceShareInvitation' :: Maybe Text
clientToken = Maybe Text
a} :: RejectResourceShareInvitation)
rejectResourceShareInvitation_resourceShareInvitationArn :: Lens.Lens' RejectResourceShareInvitation Prelude.Text
rejectResourceShareInvitation_resourceShareInvitationArn :: (Text -> f Text)
-> RejectResourceShareInvitation -> f RejectResourceShareInvitation
rejectResourceShareInvitation_resourceShareInvitationArn = (RejectResourceShareInvitation -> Text)
-> (RejectResourceShareInvitation
-> Text -> RejectResourceShareInvitation)
-> Lens
RejectResourceShareInvitation
RejectResourceShareInvitation
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectResourceShareInvitation' {Text
resourceShareInvitationArn :: Text
$sel:resourceShareInvitationArn:RejectResourceShareInvitation' :: RejectResourceShareInvitation -> Text
resourceShareInvitationArn} -> Text
resourceShareInvitationArn) (\s :: RejectResourceShareInvitation
s@RejectResourceShareInvitation' {} Text
a -> RejectResourceShareInvitation
s {$sel:resourceShareInvitationArn:RejectResourceShareInvitation' :: Text
resourceShareInvitationArn = Text
a} :: RejectResourceShareInvitation)
instance
Core.AWSRequest
RejectResourceShareInvitation
where
type
AWSResponse RejectResourceShareInvitation =
RejectResourceShareInvitationResponse
request :: RejectResourceShareInvitation
-> Request RejectResourceShareInvitation
request = Service
-> RejectResourceShareInvitation
-> Request RejectResourceShareInvitation
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RejectResourceShareInvitation
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RejectResourceShareInvitation)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RejectResourceShareInvitation))
-> Logger
-> Service
-> Proxy RejectResourceShareInvitation
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RejectResourceShareInvitation)))
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
-> Maybe ResourceShareInvitation
-> Int
-> RejectResourceShareInvitationResponse
RejectResourceShareInvitationResponse'
(Maybe Text
-> Maybe ResourceShareInvitation
-> Int
-> RejectResourceShareInvitationResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe ResourceShareInvitation
-> Int -> RejectResourceShareInvitationResponse)
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
"clientToken")
Either
String
(Maybe ResourceShareInvitation
-> Int -> RejectResourceShareInvitationResponse)
-> Either String (Maybe ResourceShareInvitation)
-> Either String (Int -> RejectResourceShareInvitationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ResourceShareInvitation)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"resourceShareInvitation")
Either String (Int -> RejectResourceShareInvitationResponse)
-> Either String Int
-> Either String RejectResourceShareInvitationResponse
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
RejectResourceShareInvitation
instance Prelude.NFData RejectResourceShareInvitation
instance Core.ToHeaders RejectResourceShareInvitation where
toHeaders :: RejectResourceShareInvitation -> ResponseHeaders
toHeaders =
ResponseHeaders -> RejectResourceShareInvitation -> 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 RejectResourceShareInvitation where
toJSON :: RejectResourceShareInvitation -> Value
toJSON RejectResourceShareInvitation' {Maybe Text
Text
resourceShareInvitationArn :: Text
clientToken :: Maybe Text
$sel:resourceShareInvitationArn:RejectResourceShareInvitation' :: RejectResourceShareInvitation -> Text
$sel:clientToken:RejectResourceShareInvitation' :: RejectResourceShareInvitation -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"clientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"resourceShareInvitationArn"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceShareInvitationArn
)
]
)
instance Core.ToPath RejectResourceShareInvitation where
toPath :: RejectResourceShareInvitation -> ByteString
toPath =
ByteString -> RejectResourceShareInvitation -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/rejectresourceshareinvitation"
instance Core.ToQuery RejectResourceShareInvitation where
toQuery :: RejectResourceShareInvitation -> QueryString
toQuery = QueryString -> RejectResourceShareInvitation -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RejectResourceShareInvitationResponse = RejectResourceShareInvitationResponse'
{
RejectResourceShareInvitationResponse -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
RejectResourceShareInvitationResponse
-> Maybe ResourceShareInvitation
resourceShareInvitation :: Prelude.Maybe ResourceShareInvitation,
RejectResourceShareInvitationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RejectResourceShareInvitationResponse
-> RejectResourceShareInvitationResponse -> Bool
(RejectResourceShareInvitationResponse
-> RejectResourceShareInvitationResponse -> Bool)
-> (RejectResourceShareInvitationResponse
-> RejectResourceShareInvitationResponse -> Bool)
-> Eq RejectResourceShareInvitationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RejectResourceShareInvitationResponse
-> RejectResourceShareInvitationResponse -> Bool
$c/= :: RejectResourceShareInvitationResponse
-> RejectResourceShareInvitationResponse -> Bool
== :: RejectResourceShareInvitationResponse
-> RejectResourceShareInvitationResponse -> Bool
$c== :: RejectResourceShareInvitationResponse
-> RejectResourceShareInvitationResponse -> Bool
Prelude.Eq, ReadPrec [RejectResourceShareInvitationResponse]
ReadPrec RejectResourceShareInvitationResponse
Int -> ReadS RejectResourceShareInvitationResponse
ReadS [RejectResourceShareInvitationResponse]
(Int -> ReadS RejectResourceShareInvitationResponse)
-> ReadS [RejectResourceShareInvitationResponse]
-> ReadPrec RejectResourceShareInvitationResponse
-> ReadPrec [RejectResourceShareInvitationResponse]
-> Read RejectResourceShareInvitationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RejectResourceShareInvitationResponse]
$creadListPrec :: ReadPrec [RejectResourceShareInvitationResponse]
readPrec :: ReadPrec RejectResourceShareInvitationResponse
$creadPrec :: ReadPrec RejectResourceShareInvitationResponse
readList :: ReadS [RejectResourceShareInvitationResponse]
$creadList :: ReadS [RejectResourceShareInvitationResponse]
readsPrec :: Int -> ReadS RejectResourceShareInvitationResponse
$creadsPrec :: Int -> ReadS RejectResourceShareInvitationResponse
Prelude.Read, Int -> RejectResourceShareInvitationResponse -> ShowS
[RejectResourceShareInvitationResponse] -> ShowS
RejectResourceShareInvitationResponse -> String
(Int -> RejectResourceShareInvitationResponse -> ShowS)
-> (RejectResourceShareInvitationResponse -> String)
-> ([RejectResourceShareInvitationResponse] -> ShowS)
-> Show RejectResourceShareInvitationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RejectResourceShareInvitationResponse] -> ShowS
$cshowList :: [RejectResourceShareInvitationResponse] -> ShowS
show :: RejectResourceShareInvitationResponse -> String
$cshow :: RejectResourceShareInvitationResponse -> String
showsPrec :: Int -> RejectResourceShareInvitationResponse -> ShowS
$cshowsPrec :: Int -> RejectResourceShareInvitationResponse -> ShowS
Prelude.Show, (forall x.
RejectResourceShareInvitationResponse
-> Rep RejectResourceShareInvitationResponse x)
-> (forall x.
Rep RejectResourceShareInvitationResponse x
-> RejectResourceShareInvitationResponse)
-> Generic RejectResourceShareInvitationResponse
forall x.
Rep RejectResourceShareInvitationResponse x
-> RejectResourceShareInvitationResponse
forall x.
RejectResourceShareInvitationResponse
-> Rep RejectResourceShareInvitationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RejectResourceShareInvitationResponse x
-> RejectResourceShareInvitationResponse
$cfrom :: forall x.
RejectResourceShareInvitationResponse
-> Rep RejectResourceShareInvitationResponse x
Prelude.Generic)
newRejectResourceShareInvitationResponse ::
Prelude.Int ->
RejectResourceShareInvitationResponse
newRejectResourceShareInvitationResponse :: Int -> RejectResourceShareInvitationResponse
newRejectResourceShareInvitationResponse Int
pHttpStatus_ =
RejectResourceShareInvitationResponse' :: Maybe Text
-> Maybe ResourceShareInvitation
-> Int
-> RejectResourceShareInvitationResponse
RejectResourceShareInvitationResponse'
{ $sel:clientToken:RejectResourceShareInvitationResponse' :: Maybe Text
clientToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:resourceShareInvitation:RejectResourceShareInvitationResponse' :: Maybe ResourceShareInvitation
resourceShareInvitation =
Maybe ResourceShareInvitation
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RejectResourceShareInvitationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
rejectResourceShareInvitationResponse_clientToken :: Lens.Lens' RejectResourceShareInvitationResponse (Prelude.Maybe Prelude.Text)
rejectResourceShareInvitationResponse_clientToken :: (Maybe Text -> f (Maybe Text))
-> RejectResourceShareInvitationResponse
-> f RejectResourceShareInvitationResponse
rejectResourceShareInvitationResponse_clientToken = (RejectResourceShareInvitationResponse -> Maybe Text)
-> (RejectResourceShareInvitationResponse
-> Maybe Text -> RejectResourceShareInvitationResponse)
-> Lens
RejectResourceShareInvitationResponse
RejectResourceShareInvitationResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectResourceShareInvitationResponse' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:RejectResourceShareInvitationResponse' :: RejectResourceShareInvitationResponse -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: RejectResourceShareInvitationResponse
s@RejectResourceShareInvitationResponse' {} Maybe Text
a -> RejectResourceShareInvitationResponse
s {$sel:clientToken:RejectResourceShareInvitationResponse' :: Maybe Text
clientToken = Maybe Text
a} :: RejectResourceShareInvitationResponse)
rejectResourceShareInvitationResponse_resourceShareInvitation :: Lens.Lens' RejectResourceShareInvitationResponse (Prelude.Maybe ResourceShareInvitation)
rejectResourceShareInvitationResponse_resourceShareInvitation :: (Maybe ResourceShareInvitation
-> f (Maybe ResourceShareInvitation))
-> RejectResourceShareInvitationResponse
-> f RejectResourceShareInvitationResponse
rejectResourceShareInvitationResponse_resourceShareInvitation = (RejectResourceShareInvitationResponse
-> Maybe ResourceShareInvitation)
-> (RejectResourceShareInvitationResponse
-> Maybe ResourceShareInvitation
-> RejectResourceShareInvitationResponse)
-> Lens
RejectResourceShareInvitationResponse
RejectResourceShareInvitationResponse
(Maybe ResourceShareInvitation)
(Maybe ResourceShareInvitation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectResourceShareInvitationResponse' {Maybe ResourceShareInvitation
resourceShareInvitation :: Maybe ResourceShareInvitation
$sel:resourceShareInvitation:RejectResourceShareInvitationResponse' :: RejectResourceShareInvitationResponse
-> Maybe ResourceShareInvitation
resourceShareInvitation} -> Maybe ResourceShareInvitation
resourceShareInvitation) (\s :: RejectResourceShareInvitationResponse
s@RejectResourceShareInvitationResponse' {} Maybe ResourceShareInvitation
a -> RejectResourceShareInvitationResponse
s {$sel:resourceShareInvitation:RejectResourceShareInvitationResponse' :: Maybe ResourceShareInvitation
resourceShareInvitation = Maybe ResourceShareInvitation
a} :: RejectResourceShareInvitationResponse)
rejectResourceShareInvitationResponse_httpStatus :: Lens.Lens' RejectResourceShareInvitationResponse Prelude.Int
rejectResourceShareInvitationResponse_httpStatus :: (Int -> f Int)
-> RejectResourceShareInvitationResponse
-> f RejectResourceShareInvitationResponse
rejectResourceShareInvitationResponse_httpStatus = (RejectResourceShareInvitationResponse -> Int)
-> (RejectResourceShareInvitationResponse
-> Int -> RejectResourceShareInvitationResponse)
-> Lens
RejectResourceShareInvitationResponse
RejectResourceShareInvitationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectResourceShareInvitationResponse' {Int
httpStatus :: Int
$sel:httpStatus:RejectResourceShareInvitationResponse' :: RejectResourceShareInvitationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RejectResourceShareInvitationResponse
s@RejectResourceShareInvitationResponse' {} Int
a -> RejectResourceShareInvitationResponse
s {$sel:httpStatus:RejectResourceShareInvitationResponse' :: Int
httpStatus = Int
a} :: RejectResourceShareInvitationResponse)
instance
Prelude.NFData
RejectResourceShareInvitationResponse