{-# 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.DescribeChannelMembership
(
DescribeChannelMembership (..),
newDescribeChannelMembership,
describeChannelMembership_chimeBearer,
describeChannelMembership_channelArn,
describeChannelMembership_memberArn,
DescribeChannelMembershipResponse (..),
newDescribeChannelMembershipResponse,
describeChannelMembershipResponse_channelMembership,
describeChannelMembershipResponse_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 DescribeChannelMembership = DescribeChannelMembership'
{
DescribeChannelMembership -> Maybe Text
chimeBearer :: Prelude.Maybe Prelude.Text,
DescribeChannelMembership -> Text
channelArn :: Prelude.Text,
DescribeChannelMembership -> Text
memberArn :: Prelude.Text
}
deriving (DescribeChannelMembership -> DescribeChannelMembership -> Bool
(DescribeChannelMembership -> DescribeChannelMembership -> Bool)
-> (DescribeChannelMembership -> DescribeChannelMembership -> Bool)
-> Eq DescribeChannelMembership
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeChannelMembership -> DescribeChannelMembership -> Bool
$c/= :: DescribeChannelMembership -> DescribeChannelMembership -> Bool
== :: DescribeChannelMembership -> DescribeChannelMembership -> Bool
$c== :: DescribeChannelMembership -> DescribeChannelMembership -> Bool
Prelude.Eq, ReadPrec [DescribeChannelMembership]
ReadPrec DescribeChannelMembership
Int -> ReadS DescribeChannelMembership
ReadS [DescribeChannelMembership]
(Int -> ReadS DescribeChannelMembership)
-> ReadS [DescribeChannelMembership]
-> ReadPrec DescribeChannelMembership
-> ReadPrec [DescribeChannelMembership]
-> Read DescribeChannelMembership
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeChannelMembership]
$creadListPrec :: ReadPrec [DescribeChannelMembership]
readPrec :: ReadPrec DescribeChannelMembership
$creadPrec :: ReadPrec DescribeChannelMembership
readList :: ReadS [DescribeChannelMembership]
$creadList :: ReadS [DescribeChannelMembership]
readsPrec :: Int -> ReadS DescribeChannelMembership
$creadsPrec :: Int -> ReadS DescribeChannelMembership
Prelude.Read, Int -> DescribeChannelMembership -> ShowS
[DescribeChannelMembership] -> ShowS
DescribeChannelMembership -> String
(Int -> DescribeChannelMembership -> ShowS)
-> (DescribeChannelMembership -> String)
-> ([DescribeChannelMembership] -> ShowS)
-> Show DescribeChannelMembership
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeChannelMembership] -> ShowS
$cshowList :: [DescribeChannelMembership] -> ShowS
show :: DescribeChannelMembership -> String
$cshow :: DescribeChannelMembership -> String
showsPrec :: Int -> DescribeChannelMembership -> ShowS
$cshowsPrec :: Int -> DescribeChannelMembership -> ShowS
Prelude.Show, (forall x.
DescribeChannelMembership -> Rep DescribeChannelMembership x)
-> (forall x.
Rep DescribeChannelMembership x -> DescribeChannelMembership)
-> Generic DescribeChannelMembership
forall x.
Rep DescribeChannelMembership x -> DescribeChannelMembership
forall x.
DescribeChannelMembership -> Rep DescribeChannelMembership x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeChannelMembership x -> DescribeChannelMembership
$cfrom :: forall x.
DescribeChannelMembership -> Rep DescribeChannelMembership x
Prelude.Generic)
newDescribeChannelMembership ::
Prelude.Text ->
Prelude.Text ->
DescribeChannelMembership
newDescribeChannelMembership :: Text -> Text -> DescribeChannelMembership
newDescribeChannelMembership Text
pChannelArn_ Text
pMemberArn_ =
DescribeChannelMembership' :: Maybe Text -> Text -> Text -> DescribeChannelMembership
DescribeChannelMembership'
{ $sel:chimeBearer:DescribeChannelMembership' :: Maybe Text
chimeBearer =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:channelArn:DescribeChannelMembership' :: Text
channelArn = Text
pChannelArn_,
$sel:memberArn:DescribeChannelMembership' :: Text
memberArn = Text
pMemberArn_
}
describeChannelMembership_chimeBearer :: Lens.Lens' DescribeChannelMembership (Prelude.Maybe Prelude.Text)
describeChannelMembership_chimeBearer :: (Maybe Text -> f (Maybe Text))
-> DescribeChannelMembership -> f DescribeChannelMembership
describeChannelMembership_chimeBearer = (DescribeChannelMembership -> Maybe Text)
-> (DescribeChannelMembership
-> Maybe Text -> DescribeChannelMembership)
-> Lens
DescribeChannelMembership
DescribeChannelMembership
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelMembership' {Maybe Text
chimeBearer :: Maybe Text
$sel:chimeBearer:DescribeChannelMembership' :: DescribeChannelMembership -> Maybe Text
chimeBearer} -> Maybe Text
chimeBearer) (\s :: DescribeChannelMembership
s@DescribeChannelMembership' {} Maybe Text
a -> DescribeChannelMembership
s {$sel:chimeBearer:DescribeChannelMembership' :: Maybe Text
chimeBearer = Maybe Text
a} :: DescribeChannelMembership)
describeChannelMembership_channelArn :: Lens.Lens' DescribeChannelMembership Prelude.Text
describeChannelMembership_channelArn :: (Text -> f Text)
-> DescribeChannelMembership -> f DescribeChannelMembership
describeChannelMembership_channelArn = (DescribeChannelMembership -> Text)
-> (DescribeChannelMembership -> Text -> DescribeChannelMembership)
-> Lens
DescribeChannelMembership DescribeChannelMembership Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelMembership' {Text
channelArn :: Text
$sel:channelArn:DescribeChannelMembership' :: DescribeChannelMembership -> Text
channelArn} -> Text
channelArn) (\s :: DescribeChannelMembership
s@DescribeChannelMembership' {} Text
a -> DescribeChannelMembership
s {$sel:channelArn:DescribeChannelMembership' :: Text
channelArn = Text
a} :: DescribeChannelMembership)
describeChannelMembership_memberArn :: Lens.Lens' DescribeChannelMembership Prelude.Text
describeChannelMembership_memberArn :: (Text -> f Text)
-> DescribeChannelMembership -> f DescribeChannelMembership
describeChannelMembership_memberArn = (DescribeChannelMembership -> Text)
-> (DescribeChannelMembership -> Text -> DescribeChannelMembership)
-> Lens
DescribeChannelMembership DescribeChannelMembership Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelMembership' {Text
memberArn :: Text
$sel:memberArn:DescribeChannelMembership' :: DescribeChannelMembership -> Text
memberArn} -> Text
memberArn) (\s :: DescribeChannelMembership
s@DescribeChannelMembership' {} Text
a -> DescribeChannelMembership
s {$sel:memberArn:DescribeChannelMembership' :: Text
memberArn = Text
a} :: DescribeChannelMembership)
instance Core.AWSRequest DescribeChannelMembership where
type
AWSResponse DescribeChannelMembership =
DescribeChannelMembershipResponse
request :: DescribeChannelMembership -> Request DescribeChannelMembership
request = Service
-> DescribeChannelMembership -> Request DescribeChannelMembership
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeChannelMembership
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeChannelMembership)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeChannelMembership))
-> Logger
-> Service
-> Proxy DescribeChannelMembership
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeChannelMembership)))
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 ChannelMembership -> Int -> DescribeChannelMembershipResponse
DescribeChannelMembershipResponse'
(Maybe ChannelMembership
-> Int -> DescribeChannelMembershipResponse)
-> Either String (Maybe ChannelMembership)
-> Either String (Int -> DescribeChannelMembershipResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ChannelMembership)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ChannelMembership")
Either String (Int -> DescribeChannelMembershipResponse)
-> Either String Int
-> Either String DescribeChannelMembershipResponse
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 DescribeChannelMembership
instance Prelude.NFData DescribeChannelMembership
instance Core.ToHeaders DescribeChannelMembership where
toHeaders :: DescribeChannelMembership -> ResponseHeaders
toHeaders DescribeChannelMembership' {Maybe Text
Text
memberArn :: Text
channelArn :: Text
chimeBearer :: Maybe Text
$sel:memberArn:DescribeChannelMembership' :: DescribeChannelMembership -> Text
$sel:channelArn:DescribeChannelMembership' :: DescribeChannelMembership -> Text
$sel:chimeBearer:DescribeChannelMembership' :: DescribeChannelMembership -> Maybe Text
..} =
[ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[HeaderName
"x-amz-chime-bearer" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
chimeBearer]
instance Core.ToPath DescribeChannelMembership where
toPath :: DescribeChannelMembership -> ByteString
toPath DescribeChannelMembership' {Maybe Text
Text
memberArn :: Text
channelArn :: Text
chimeBearer :: Maybe Text
$sel:memberArn:DescribeChannelMembership' :: DescribeChannelMembership -> Text
$sel:channelArn:DescribeChannelMembership' :: DescribeChannelMembership -> Text
$sel:chimeBearer:DescribeChannelMembership' :: DescribeChannelMembership -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/channels/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
channelArn,
ByteString
"/memberships/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
memberArn
]
instance Core.ToQuery DescribeChannelMembership where
toQuery :: DescribeChannelMembership -> QueryString
toQuery = QueryString -> DescribeChannelMembership -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeChannelMembershipResponse = DescribeChannelMembershipResponse'
{
DescribeChannelMembershipResponse -> Maybe ChannelMembership
channelMembership :: Prelude.Maybe ChannelMembership,
DescribeChannelMembershipResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeChannelMembershipResponse
-> DescribeChannelMembershipResponse -> Bool
(DescribeChannelMembershipResponse
-> DescribeChannelMembershipResponse -> Bool)
-> (DescribeChannelMembershipResponse
-> DescribeChannelMembershipResponse -> Bool)
-> Eq DescribeChannelMembershipResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeChannelMembershipResponse
-> DescribeChannelMembershipResponse -> Bool
$c/= :: DescribeChannelMembershipResponse
-> DescribeChannelMembershipResponse -> Bool
== :: DescribeChannelMembershipResponse
-> DescribeChannelMembershipResponse -> Bool
$c== :: DescribeChannelMembershipResponse
-> DescribeChannelMembershipResponse -> Bool
Prelude.Eq, Int -> DescribeChannelMembershipResponse -> ShowS
[DescribeChannelMembershipResponse] -> ShowS
DescribeChannelMembershipResponse -> String
(Int -> DescribeChannelMembershipResponse -> ShowS)
-> (DescribeChannelMembershipResponse -> String)
-> ([DescribeChannelMembershipResponse] -> ShowS)
-> Show DescribeChannelMembershipResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeChannelMembershipResponse] -> ShowS
$cshowList :: [DescribeChannelMembershipResponse] -> ShowS
show :: DescribeChannelMembershipResponse -> String
$cshow :: DescribeChannelMembershipResponse -> String
showsPrec :: Int -> DescribeChannelMembershipResponse -> ShowS
$cshowsPrec :: Int -> DescribeChannelMembershipResponse -> ShowS
Prelude.Show, (forall x.
DescribeChannelMembershipResponse
-> Rep DescribeChannelMembershipResponse x)
-> (forall x.
Rep DescribeChannelMembershipResponse x
-> DescribeChannelMembershipResponse)
-> Generic DescribeChannelMembershipResponse
forall x.
Rep DescribeChannelMembershipResponse x
-> DescribeChannelMembershipResponse
forall x.
DescribeChannelMembershipResponse
-> Rep DescribeChannelMembershipResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeChannelMembershipResponse x
-> DescribeChannelMembershipResponse
$cfrom :: forall x.
DescribeChannelMembershipResponse
-> Rep DescribeChannelMembershipResponse x
Prelude.Generic)
newDescribeChannelMembershipResponse ::
Prelude.Int ->
DescribeChannelMembershipResponse
newDescribeChannelMembershipResponse :: Int -> DescribeChannelMembershipResponse
newDescribeChannelMembershipResponse Int
pHttpStatus_ =
DescribeChannelMembershipResponse' :: Maybe ChannelMembership -> Int -> DescribeChannelMembershipResponse
DescribeChannelMembershipResponse'
{ $sel:channelMembership:DescribeChannelMembershipResponse' :: Maybe ChannelMembership
channelMembership =
Maybe ChannelMembership
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeChannelMembershipResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeChannelMembershipResponse_channelMembership :: Lens.Lens' DescribeChannelMembershipResponse (Prelude.Maybe ChannelMembership)
describeChannelMembershipResponse_channelMembership :: (Maybe ChannelMembership -> f (Maybe ChannelMembership))
-> DescribeChannelMembershipResponse
-> f DescribeChannelMembershipResponse
describeChannelMembershipResponse_channelMembership = (DescribeChannelMembershipResponse -> Maybe ChannelMembership)
-> (DescribeChannelMembershipResponse
-> Maybe ChannelMembership -> DescribeChannelMembershipResponse)
-> Lens
DescribeChannelMembershipResponse
DescribeChannelMembershipResponse
(Maybe ChannelMembership)
(Maybe ChannelMembership)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelMembershipResponse' {Maybe ChannelMembership
channelMembership :: Maybe ChannelMembership
$sel:channelMembership:DescribeChannelMembershipResponse' :: DescribeChannelMembershipResponse -> Maybe ChannelMembership
channelMembership} -> Maybe ChannelMembership
channelMembership) (\s :: DescribeChannelMembershipResponse
s@DescribeChannelMembershipResponse' {} Maybe ChannelMembership
a -> DescribeChannelMembershipResponse
s {$sel:channelMembership:DescribeChannelMembershipResponse' :: Maybe ChannelMembership
channelMembership = Maybe ChannelMembership
a} :: DescribeChannelMembershipResponse)
describeChannelMembershipResponse_httpStatus :: Lens.Lens' DescribeChannelMembershipResponse Prelude.Int
describeChannelMembershipResponse_httpStatus :: (Int -> f Int)
-> DescribeChannelMembershipResponse
-> f DescribeChannelMembershipResponse
describeChannelMembershipResponse_httpStatus = (DescribeChannelMembershipResponse -> Int)
-> (DescribeChannelMembershipResponse
-> Int -> DescribeChannelMembershipResponse)
-> Lens
DescribeChannelMembershipResponse
DescribeChannelMembershipResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelMembershipResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeChannelMembershipResponse' :: DescribeChannelMembershipResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeChannelMembershipResponse
s@DescribeChannelMembershipResponse' {} Int
a -> DescribeChannelMembershipResponse
s {$sel:httpStatus:DescribeChannelMembershipResponse' :: Int
httpStatus = Int
a} :: DescribeChannelMembershipResponse)
instance
Prelude.NFData
DescribeChannelMembershipResponse