{-# 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.Detective.AcceptInvitation
(
AcceptInvitation (..),
newAcceptInvitation,
acceptInvitation_graphArn,
AcceptInvitationResponse (..),
newAcceptInvitationResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Detective.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AcceptInvitation = AcceptInvitation'
{
AcceptInvitation -> Text
graphArn :: Prelude.Text
}
deriving (AcceptInvitation -> AcceptInvitation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AcceptInvitation -> AcceptInvitation -> Bool
$c/= :: AcceptInvitation -> AcceptInvitation -> Bool
== :: AcceptInvitation -> AcceptInvitation -> Bool
$c== :: AcceptInvitation -> AcceptInvitation -> Bool
Prelude.Eq, ReadPrec [AcceptInvitation]
ReadPrec AcceptInvitation
Int -> ReadS AcceptInvitation
ReadS [AcceptInvitation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AcceptInvitation]
$creadListPrec :: ReadPrec [AcceptInvitation]
readPrec :: ReadPrec AcceptInvitation
$creadPrec :: ReadPrec AcceptInvitation
readList :: ReadS [AcceptInvitation]
$creadList :: ReadS [AcceptInvitation]
readsPrec :: Int -> ReadS AcceptInvitation
$creadsPrec :: Int -> ReadS AcceptInvitation
Prelude.Read, Int -> AcceptInvitation -> ShowS
[AcceptInvitation] -> ShowS
AcceptInvitation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AcceptInvitation] -> ShowS
$cshowList :: [AcceptInvitation] -> ShowS
show :: AcceptInvitation -> String
$cshow :: AcceptInvitation -> String
showsPrec :: Int -> AcceptInvitation -> ShowS
$cshowsPrec :: Int -> AcceptInvitation -> ShowS
Prelude.Show, forall x. Rep AcceptInvitation x -> AcceptInvitation
forall x. AcceptInvitation -> Rep AcceptInvitation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AcceptInvitation x -> AcceptInvitation
$cfrom :: forall x. AcceptInvitation -> Rep AcceptInvitation x
Prelude.Generic)
newAcceptInvitation ::
Prelude.Text ->
AcceptInvitation
newAcceptInvitation :: Text -> AcceptInvitation
newAcceptInvitation Text
pGraphArn_ =
AcceptInvitation' {$sel:graphArn:AcceptInvitation' :: Text
graphArn = Text
pGraphArn_}
acceptInvitation_graphArn :: Lens.Lens' AcceptInvitation Prelude.Text
acceptInvitation_graphArn :: Lens' AcceptInvitation Text
acceptInvitation_graphArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AcceptInvitation' {Text
graphArn :: Text
$sel:graphArn:AcceptInvitation' :: AcceptInvitation -> Text
graphArn} -> Text
graphArn) (\s :: AcceptInvitation
s@AcceptInvitation' {} Text
a -> AcceptInvitation
s {$sel:graphArn:AcceptInvitation' :: Text
graphArn = Text
a} :: AcceptInvitation)
instance Core.AWSRequest AcceptInvitation where
type
AWSResponse AcceptInvitation =
AcceptInvitationResponse
request :: (Service -> Service)
-> AcceptInvitation -> Request AcceptInvitation
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy AcceptInvitation
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse AcceptInvitation)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AcceptInvitationResponse
AcceptInvitationResponse'
instance Prelude.Hashable AcceptInvitation where
hashWithSalt :: Int -> AcceptInvitation -> Int
hashWithSalt Int
_salt AcceptInvitation' {Text
graphArn :: Text
$sel:graphArn:AcceptInvitation' :: AcceptInvitation -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
graphArn
instance Prelude.NFData AcceptInvitation where
rnf :: AcceptInvitation -> ()
rnf AcceptInvitation' {Text
graphArn :: Text
$sel:graphArn:AcceptInvitation' :: AcceptInvitation -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
graphArn
instance Data.ToHeaders AcceptInvitation where
toHeaders :: AcceptInvitation -> [Header]
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON AcceptInvitation where
toJSON :: AcceptInvitation -> Value
toJSON AcceptInvitation' {Text
graphArn :: Text
$sel:graphArn:AcceptInvitation' :: AcceptInvitation -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"GraphArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
graphArn)]
)
instance Data.ToPath AcceptInvitation where
toPath :: AcceptInvitation -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/invitation"
instance Data.ToQuery AcceptInvitation where
toQuery :: AcceptInvitation -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data AcceptInvitationResponse = AcceptInvitationResponse'
{
}
deriving (AcceptInvitationResponse -> AcceptInvitationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AcceptInvitationResponse -> AcceptInvitationResponse -> Bool
$c/= :: AcceptInvitationResponse -> AcceptInvitationResponse -> Bool
== :: AcceptInvitationResponse -> AcceptInvitationResponse -> Bool
$c== :: AcceptInvitationResponse -> AcceptInvitationResponse -> Bool
Prelude.Eq, ReadPrec [AcceptInvitationResponse]
ReadPrec AcceptInvitationResponse
Int -> ReadS AcceptInvitationResponse
ReadS [AcceptInvitationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AcceptInvitationResponse]
$creadListPrec :: ReadPrec [AcceptInvitationResponse]
readPrec :: ReadPrec AcceptInvitationResponse
$creadPrec :: ReadPrec AcceptInvitationResponse
readList :: ReadS [AcceptInvitationResponse]
$creadList :: ReadS [AcceptInvitationResponse]
readsPrec :: Int -> ReadS AcceptInvitationResponse
$creadsPrec :: Int -> ReadS AcceptInvitationResponse
Prelude.Read, Int -> AcceptInvitationResponse -> ShowS
[AcceptInvitationResponse] -> ShowS
AcceptInvitationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AcceptInvitationResponse] -> ShowS
$cshowList :: [AcceptInvitationResponse] -> ShowS
show :: AcceptInvitationResponse -> String
$cshow :: AcceptInvitationResponse -> String
showsPrec :: Int -> AcceptInvitationResponse -> ShowS
$cshowsPrec :: Int -> AcceptInvitationResponse -> ShowS
Prelude.Show, forall x.
Rep AcceptInvitationResponse x -> AcceptInvitationResponse
forall x.
AcceptInvitationResponse -> Rep AcceptInvitationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AcceptInvitationResponse x -> AcceptInvitationResponse
$cfrom :: forall x.
AcceptInvitationResponse -> Rep AcceptInvitationResponse x
Prelude.Generic)
newAcceptInvitationResponse ::
AcceptInvitationResponse
newAcceptInvitationResponse :: AcceptInvitationResponse
newAcceptInvitationResponse =
AcceptInvitationResponse
AcceptInvitationResponse'
instance Prelude.NFData AcceptInvitationResponse where
rnf :: AcceptInvitationResponse -> ()
rnf AcceptInvitationResponse
_ = ()