{-# 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.Chime.GetAttendee
(
GetAttendee (..),
newGetAttendee,
getAttendee_meetingId,
getAttendee_attendeeId,
GetAttendeeResponse (..),
newGetAttendeeResponse,
getAttendeeResponse_attendee,
getAttendeeResponse_httpStatus,
)
where
import Amazonka.Chime.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 GetAttendee = GetAttendee'
{
GetAttendee -> Text
meetingId :: Prelude.Text,
GetAttendee -> Text
attendeeId :: Prelude.Text
}
deriving (GetAttendee -> GetAttendee -> Bool
(GetAttendee -> GetAttendee -> Bool)
-> (GetAttendee -> GetAttendee -> Bool) -> Eq GetAttendee
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAttendee -> GetAttendee -> Bool
$c/= :: GetAttendee -> GetAttendee -> Bool
== :: GetAttendee -> GetAttendee -> Bool
$c== :: GetAttendee -> GetAttendee -> Bool
Prelude.Eq, ReadPrec [GetAttendee]
ReadPrec GetAttendee
Int -> ReadS GetAttendee
ReadS [GetAttendee]
(Int -> ReadS GetAttendee)
-> ReadS [GetAttendee]
-> ReadPrec GetAttendee
-> ReadPrec [GetAttendee]
-> Read GetAttendee
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAttendee]
$creadListPrec :: ReadPrec [GetAttendee]
readPrec :: ReadPrec GetAttendee
$creadPrec :: ReadPrec GetAttendee
readList :: ReadS [GetAttendee]
$creadList :: ReadS [GetAttendee]
readsPrec :: Int -> ReadS GetAttendee
$creadsPrec :: Int -> ReadS GetAttendee
Prelude.Read, Int -> GetAttendee -> ShowS
[GetAttendee] -> ShowS
GetAttendee -> String
(Int -> GetAttendee -> ShowS)
-> (GetAttendee -> String)
-> ([GetAttendee] -> ShowS)
-> Show GetAttendee
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAttendee] -> ShowS
$cshowList :: [GetAttendee] -> ShowS
show :: GetAttendee -> String
$cshow :: GetAttendee -> String
showsPrec :: Int -> GetAttendee -> ShowS
$cshowsPrec :: Int -> GetAttendee -> ShowS
Prelude.Show, (forall x. GetAttendee -> Rep GetAttendee x)
-> (forall x. Rep GetAttendee x -> GetAttendee)
-> Generic GetAttendee
forall x. Rep GetAttendee x -> GetAttendee
forall x. GetAttendee -> Rep GetAttendee x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAttendee x -> GetAttendee
$cfrom :: forall x. GetAttendee -> Rep GetAttendee x
Prelude.Generic)
newGetAttendee ::
Prelude.Text ->
Prelude.Text ->
GetAttendee
newGetAttendee :: Text -> Text -> GetAttendee
newGetAttendee Text
pMeetingId_ Text
pAttendeeId_ =
GetAttendee' :: Text -> Text -> GetAttendee
GetAttendee'
{ $sel:meetingId:GetAttendee' :: Text
meetingId = Text
pMeetingId_,
$sel:attendeeId:GetAttendee' :: Text
attendeeId = Text
pAttendeeId_
}
getAttendee_meetingId :: Lens.Lens' GetAttendee Prelude.Text
getAttendee_meetingId :: (Text -> f Text) -> GetAttendee -> f GetAttendee
getAttendee_meetingId = (GetAttendee -> Text)
-> (GetAttendee -> Text -> GetAttendee)
-> Lens GetAttendee GetAttendee Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAttendee' {Text
meetingId :: Text
$sel:meetingId:GetAttendee' :: GetAttendee -> Text
meetingId} -> Text
meetingId) (\s :: GetAttendee
s@GetAttendee' {} Text
a -> GetAttendee
s {$sel:meetingId:GetAttendee' :: Text
meetingId = Text
a} :: GetAttendee)
getAttendee_attendeeId :: Lens.Lens' GetAttendee Prelude.Text
getAttendee_attendeeId :: (Text -> f Text) -> GetAttendee -> f GetAttendee
getAttendee_attendeeId = (GetAttendee -> Text)
-> (GetAttendee -> Text -> GetAttendee)
-> Lens GetAttendee GetAttendee Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAttendee' {Text
attendeeId :: Text
$sel:attendeeId:GetAttendee' :: GetAttendee -> Text
attendeeId} -> Text
attendeeId) (\s :: GetAttendee
s@GetAttendee' {} Text
a -> GetAttendee
s {$sel:attendeeId:GetAttendee' :: Text
attendeeId = Text
a} :: GetAttendee)
instance Core.AWSRequest GetAttendee where
type AWSResponse GetAttendee = GetAttendeeResponse
request :: GetAttendee -> Request GetAttendee
request = Service -> GetAttendee -> Request GetAttendee
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetAttendee
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetAttendee)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetAttendee))
-> Logger
-> Service
-> Proxy GetAttendee
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetAttendee)))
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 Attendee -> Int -> GetAttendeeResponse
GetAttendeeResponse'
(Maybe Attendee -> Int -> GetAttendeeResponse)
-> Either String (Maybe Attendee)
-> Either String (Int -> GetAttendeeResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Attendee)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Attendee")
Either String (Int -> GetAttendeeResponse)
-> Either String Int -> Either String GetAttendeeResponse
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 GetAttendee
instance Prelude.NFData GetAttendee
instance Core.ToHeaders GetAttendee where
toHeaders :: GetAttendee -> ResponseHeaders
toHeaders = ResponseHeaders -> GetAttendee -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetAttendee where
toPath :: GetAttendee -> ByteString
toPath GetAttendee' {Text
attendeeId :: Text
meetingId :: Text
$sel:attendeeId:GetAttendee' :: GetAttendee -> Text
$sel:meetingId:GetAttendee' :: GetAttendee -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/meetings/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
meetingId,
ByteString
"/attendees/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
attendeeId
]
instance Core.ToQuery GetAttendee where
toQuery :: GetAttendee -> QueryString
toQuery = QueryString -> GetAttendee -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetAttendeeResponse = GetAttendeeResponse'
{
GetAttendeeResponse -> Maybe Attendee
attendee :: Prelude.Maybe Attendee,
GetAttendeeResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetAttendeeResponse -> GetAttendeeResponse -> Bool
(GetAttendeeResponse -> GetAttendeeResponse -> Bool)
-> (GetAttendeeResponse -> GetAttendeeResponse -> Bool)
-> Eq GetAttendeeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAttendeeResponse -> GetAttendeeResponse -> Bool
$c/= :: GetAttendeeResponse -> GetAttendeeResponse -> Bool
== :: GetAttendeeResponse -> GetAttendeeResponse -> Bool
$c== :: GetAttendeeResponse -> GetAttendeeResponse -> Bool
Prelude.Eq, Int -> GetAttendeeResponse -> ShowS
[GetAttendeeResponse] -> ShowS
GetAttendeeResponse -> String
(Int -> GetAttendeeResponse -> ShowS)
-> (GetAttendeeResponse -> String)
-> ([GetAttendeeResponse] -> ShowS)
-> Show GetAttendeeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAttendeeResponse] -> ShowS
$cshowList :: [GetAttendeeResponse] -> ShowS
show :: GetAttendeeResponse -> String
$cshow :: GetAttendeeResponse -> String
showsPrec :: Int -> GetAttendeeResponse -> ShowS
$cshowsPrec :: Int -> GetAttendeeResponse -> ShowS
Prelude.Show, (forall x. GetAttendeeResponse -> Rep GetAttendeeResponse x)
-> (forall x. Rep GetAttendeeResponse x -> GetAttendeeResponse)
-> Generic GetAttendeeResponse
forall x. Rep GetAttendeeResponse x -> GetAttendeeResponse
forall x. GetAttendeeResponse -> Rep GetAttendeeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAttendeeResponse x -> GetAttendeeResponse
$cfrom :: forall x. GetAttendeeResponse -> Rep GetAttendeeResponse x
Prelude.Generic)
newGetAttendeeResponse ::
Prelude.Int ->
GetAttendeeResponse
newGetAttendeeResponse :: Int -> GetAttendeeResponse
newGetAttendeeResponse Int
pHttpStatus_ =
GetAttendeeResponse' :: Maybe Attendee -> Int -> GetAttendeeResponse
GetAttendeeResponse'
{ $sel:attendee:GetAttendeeResponse' :: Maybe Attendee
attendee = Maybe Attendee
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetAttendeeResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getAttendeeResponse_attendee :: Lens.Lens' GetAttendeeResponse (Prelude.Maybe Attendee)
getAttendeeResponse_attendee :: (Maybe Attendee -> f (Maybe Attendee))
-> GetAttendeeResponse -> f GetAttendeeResponse
getAttendeeResponse_attendee = (GetAttendeeResponse -> Maybe Attendee)
-> (GetAttendeeResponse -> Maybe Attendee -> GetAttendeeResponse)
-> Lens
GetAttendeeResponse
GetAttendeeResponse
(Maybe Attendee)
(Maybe Attendee)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAttendeeResponse' {Maybe Attendee
attendee :: Maybe Attendee
$sel:attendee:GetAttendeeResponse' :: GetAttendeeResponse -> Maybe Attendee
attendee} -> Maybe Attendee
attendee) (\s :: GetAttendeeResponse
s@GetAttendeeResponse' {} Maybe Attendee
a -> GetAttendeeResponse
s {$sel:attendee:GetAttendeeResponse' :: Maybe Attendee
attendee = Maybe Attendee
a} :: GetAttendeeResponse)
getAttendeeResponse_httpStatus :: Lens.Lens' GetAttendeeResponse Prelude.Int
getAttendeeResponse_httpStatus :: (Int -> f Int) -> GetAttendeeResponse -> f GetAttendeeResponse
getAttendeeResponse_httpStatus = (GetAttendeeResponse -> Int)
-> (GetAttendeeResponse -> Int -> GetAttendeeResponse)
-> Lens GetAttendeeResponse GetAttendeeResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAttendeeResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAttendeeResponse' :: GetAttendeeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAttendeeResponse
s@GetAttendeeResponse' {} Int
a -> GetAttendeeResponse
s {$sel:httpStatus:GetAttendeeResponse' :: Int
httpStatus = Int
a} :: GetAttendeeResponse)
instance Prelude.NFData GetAttendeeResponse