{-# 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.AlexaBusiness.SendInvitation
(
SendInvitation (..),
newSendInvitation,
sendInvitation_userArn,
SendInvitationResponse (..),
newSendInvitationResponse,
sendInvitationResponse_httpStatus,
)
where
import Amazonka.AlexaBusiness.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 SendInvitation = SendInvitation'
{
SendInvitation -> Maybe Text
userArn :: Prelude.Maybe Prelude.Text
}
deriving (SendInvitation -> SendInvitation -> Bool
(SendInvitation -> SendInvitation -> Bool)
-> (SendInvitation -> SendInvitation -> Bool) -> Eq SendInvitation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendInvitation -> SendInvitation -> Bool
$c/= :: SendInvitation -> SendInvitation -> Bool
== :: SendInvitation -> SendInvitation -> Bool
$c== :: SendInvitation -> SendInvitation -> Bool
Prelude.Eq, ReadPrec [SendInvitation]
ReadPrec SendInvitation
Int -> ReadS SendInvitation
ReadS [SendInvitation]
(Int -> ReadS SendInvitation)
-> ReadS [SendInvitation]
-> ReadPrec SendInvitation
-> ReadPrec [SendInvitation]
-> Read SendInvitation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendInvitation]
$creadListPrec :: ReadPrec [SendInvitation]
readPrec :: ReadPrec SendInvitation
$creadPrec :: ReadPrec SendInvitation
readList :: ReadS [SendInvitation]
$creadList :: ReadS [SendInvitation]
readsPrec :: Int -> ReadS SendInvitation
$creadsPrec :: Int -> ReadS SendInvitation
Prelude.Read, Int -> SendInvitation -> ShowS
[SendInvitation] -> ShowS
SendInvitation -> String
(Int -> SendInvitation -> ShowS)
-> (SendInvitation -> String)
-> ([SendInvitation] -> ShowS)
-> Show SendInvitation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendInvitation] -> ShowS
$cshowList :: [SendInvitation] -> ShowS
show :: SendInvitation -> String
$cshow :: SendInvitation -> String
showsPrec :: Int -> SendInvitation -> ShowS
$cshowsPrec :: Int -> SendInvitation -> ShowS
Prelude.Show, (forall x. SendInvitation -> Rep SendInvitation x)
-> (forall x. Rep SendInvitation x -> SendInvitation)
-> Generic SendInvitation
forall x. Rep SendInvitation x -> SendInvitation
forall x. SendInvitation -> Rep SendInvitation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendInvitation x -> SendInvitation
$cfrom :: forall x. SendInvitation -> Rep SendInvitation x
Prelude.Generic)
newSendInvitation ::
SendInvitation
newSendInvitation :: SendInvitation
newSendInvitation =
SendInvitation' :: Maybe Text -> SendInvitation
SendInvitation' {$sel:userArn:SendInvitation' :: Maybe Text
userArn = Maybe Text
forall a. Maybe a
Prelude.Nothing}
sendInvitation_userArn :: Lens.Lens' SendInvitation (Prelude.Maybe Prelude.Text)
sendInvitation_userArn :: (Maybe Text -> f (Maybe Text))
-> SendInvitation -> f SendInvitation
sendInvitation_userArn = (SendInvitation -> Maybe Text)
-> (SendInvitation -> Maybe Text -> SendInvitation)
-> Lens SendInvitation SendInvitation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendInvitation' {Maybe Text
userArn :: Maybe Text
$sel:userArn:SendInvitation' :: SendInvitation -> Maybe Text
userArn} -> Maybe Text
userArn) (\s :: SendInvitation
s@SendInvitation' {} Maybe Text
a -> SendInvitation
s {$sel:userArn:SendInvitation' :: Maybe Text
userArn = Maybe Text
a} :: SendInvitation)
instance Core.AWSRequest SendInvitation where
type
AWSResponse SendInvitation =
SendInvitationResponse
request :: SendInvitation -> Request SendInvitation
request = Service -> SendInvitation -> Request SendInvitation
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SendInvitation
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendInvitation)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse SendInvitation))
-> Logger
-> Service
-> Proxy SendInvitation
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendInvitation)))
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 -> SendInvitationResponse
SendInvitationResponse'
(Int -> SendInvitationResponse)
-> Either String Int -> Either String SendInvitationResponse
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 SendInvitation
instance Prelude.NFData SendInvitation
instance Core.ToHeaders SendInvitation where
toHeaders :: SendInvitation -> ResponseHeaders
toHeaders =
ResponseHeaders -> SendInvitation -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AlexaForBusiness.SendInvitation" ::
Prelude.ByteString
),
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 SendInvitation where
toJSON :: SendInvitation -> Value
toJSON SendInvitation' {Maybe Text
userArn :: Maybe Text
$sel:userArn:SendInvitation' :: SendInvitation -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"UserArn" 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
userArn]
)
instance Core.ToPath SendInvitation where
toPath :: SendInvitation -> ByteString
toPath = ByteString -> SendInvitation -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SendInvitation where
toQuery :: SendInvitation -> QueryString
toQuery = QueryString -> SendInvitation -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SendInvitationResponse = SendInvitationResponse'
{
SendInvitationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SendInvitationResponse -> SendInvitationResponse -> Bool
(SendInvitationResponse -> SendInvitationResponse -> Bool)
-> (SendInvitationResponse -> SendInvitationResponse -> Bool)
-> Eq SendInvitationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendInvitationResponse -> SendInvitationResponse -> Bool
$c/= :: SendInvitationResponse -> SendInvitationResponse -> Bool
== :: SendInvitationResponse -> SendInvitationResponse -> Bool
$c== :: SendInvitationResponse -> SendInvitationResponse -> Bool
Prelude.Eq, ReadPrec [SendInvitationResponse]
ReadPrec SendInvitationResponse
Int -> ReadS SendInvitationResponse
ReadS [SendInvitationResponse]
(Int -> ReadS SendInvitationResponse)
-> ReadS [SendInvitationResponse]
-> ReadPrec SendInvitationResponse
-> ReadPrec [SendInvitationResponse]
-> Read SendInvitationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendInvitationResponse]
$creadListPrec :: ReadPrec [SendInvitationResponse]
readPrec :: ReadPrec SendInvitationResponse
$creadPrec :: ReadPrec SendInvitationResponse
readList :: ReadS [SendInvitationResponse]
$creadList :: ReadS [SendInvitationResponse]
readsPrec :: Int -> ReadS SendInvitationResponse
$creadsPrec :: Int -> ReadS SendInvitationResponse
Prelude.Read, Int -> SendInvitationResponse -> ShowS
[SendInvitationResponse] -> ShowS
SendInvitationResponse -> String
(Int -> SendInvitationResponse -> ShowS)
-> (SendInvitationResponse -> String)
-> ([SendInvitationResponse] -> ShowS)
-> Show SendInvitationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendInvitationResponse] -> ShowS
$cshowList :: [SendInvitationResponse] -> ShowS
show :: SendInvitationResponse -> String
$cshow :: SendInvitationResponse -> String
showsPrec :: Int -> SendInvitationResponse -> ShowS
$cshowsPrec :: Int -> SendInvitationResponse -> ShowS
Prelude.Show, (forall x. SendInvitationResponse -> Rep SendInvitationResponse x)
-> (forall x.
Rep SendInvitationResponse x -> SendInvitationResponse)
-> Generic SendInvitationResponse
forall x. Rep SendInvitationResponse x -> SendInvitationResponse
forall x. SendInvitationResponse -> Rep SendInvitationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendInvitationResponse x -> SendInvitationResponse
$cfrom :: forall x. SendInvitationResponse -> Rep SendInvitationResponse x
Prelude.Generic)
newSendInvitationResponse ::
Prelude.Int ->
SendInvitationResponse
newSendInvitationResponse :: Int -> SendInvitationResponse
newSendInvitationResponse Int
pHttpStatus_ =
SendInvitationResponse' :: Int -> SendInvitationResponse
SendInvitationResponse' {$sel:httpStatus:SendInvitationResponse' :: Int
httpStatus = Int
pHttpStatus_}
sendInvitationResponse_httpStatus :: Lens.Lens' SendInvitationResponse Prelude.Int
sendInvitationResponse_httpStatus :: (Int -> f Int)
-> SendInvitationResponse -> f SendInvitationResponse
sendInvitationResponse_httpStatus = (SendInvitationResponse -> Int)
-> (SendInvitationResponse -> Int -> SendInvitationResponse)
-> Lens SendInvitationResponse SendInvitationResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendInvitationResponse' {Int
httpStatus :: Int
$sel:httpStatus:SendInvitationResponse' :: SendInvitationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SendInvitationResponse
s@SendInvitationResponse' {} Int
a -> SendInvitationResponse
s {$sel:httpStatus:SendInvitationResponse' :: Int
httpStatus = Int
a} :: SendInvitationResponse)
instance Prelude.NFData SendInvitationResponse