{-# 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.ChimeSDKMessaging.DescribeChannelModerator
(
DescribeChannelModerator (..),
newDescribeChannelModerator,
describeChannelModerator_channelArn,
describeChannelModerator_channelModeratorArn,
describeChannelModerator_chimeBearer,
DescribeChannelModeratorResponse (..),
newDescribeChannelModeratorResponse,
describeChannelModeratorResponse_channelModerator,
describeChannelModeratorResponse_httpStatus,
)
where
import Amazonka.ChimeSDKMessaging.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 DescribeChannelModerator = DescribeChannelModerator'
{
DescribeChannelModerator -> Text
channelArn :: Prelude.Text,
DescribeChannelModerator -> Text
channelModeratorArn :: Prelude.Text,
DescribeChannelModerator -> Text
chimeBearer :: Prelude.Text
}
deriving (DescribeChannelModerator -> DescribeChannelModerator -> Bool
(DescribeChannelModerator -> DescribeChannelModerator -> Bool)
-> (DescribeChannelModerator -> DescribeChannelModerator -> Bool)
-> Eq DescribeChannelModerator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeChannelModerator -> DescribeChannelModerator -> Bool
$c/= :: DescribeChannelModerator -> DescribeChannelModerator -> Bool
== :: DescribeChannelModerator -> DescribeChannelModerator -> Bool
$c== :: DescribeChannelModerator -> DescribeChannelModerator -> Bool
Prelude.Eq, ReadPrec [DescribeChannelModerator]
ReadPrec DescribeChannelModerator
Int -> ReadS DescribeChannelModerator
ReadS [DescribeChannelModerator]
(Int -> ReadS DescribeChannelModerator)
-> ReadS [DescribeChannelModerator]
-> ReadPrec DescribeChannelModerator
-> ReadPrec [DescribeChannelModerator]
-> Read DescribeChannelModerator
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeChannelModerator]
$creadListPrec :: ReadPrec [DescribeChannelModerator]
readPrec :: ReadPrec DescribeChannelModerator
$creadPrec :: ReadPrec DescribeChannelModerator
readList :: ReadS [DescribeChannelModerator]
$creadList :: ReadS [DescribeChannelModerator]
readsPrec :: Int -> ReadS DescribeChannelModerator
$creadsPrec :: Int -> ReadS DescribeChannelModerator
Prelude.Read, Int -> DescribeChannelModerator -> ShowS
[DescribeChannelModerator] -> ShowS
DescribeChannelModerator -> String
(Int -> DescribeChannelModerator -> ShowS)
-> (DescribeChannelModerator -> String)
-> ([DescribeChannelModerator] -> ShowS)
-> Show DescribeChannelModerator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeChannelModerator] -> ShowS
$cshowList :: [DescribeChannelModerator] -> ShowS
show :: DescribeChannelModerator -> String
$cshow :: DescribeChannelModerator -> String
showsPrec :: Int -> DescribeChannelModerator -> ShowS
$cshowsPrec :: Int -> DescribeChannelModerator -> ShowS
Prelude.Show, (forall x.
DescribeChannelModerator -> Rep DescribeChannelModerator x)
-> (forall x.
Rep DescribeChannelModerator x -> DescribeChannelModerator)
-> Generic DescribeChannelModerator
forall x.
Rep DescribeChannelModerator x -> DescribeChannelModerator
forall x.
DescribeChannelModerator -> Rep DescribeChannelModerator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeChannelModerator x -> DescribeChannelModerator
$cfrom :: forall x.
DescribeChannelModerator -> Rep DescribeChannelModerator x
Prelude.Generic)
newDescribeChannelModerator ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DescribeChannelModerator
newDescribeChannelModerator :: Text -> Text -> Text -> DescribeChannelModerator
newDescribeChannelModerator
Text
pChannelArn_
Text
pChannelModeratorArn_
Text
pChimeBearer_ =
DescribeChannelModerator' :: Text -> Text -> Text -> DescribeChannelModerator
DescribeChannelModerator'
{ $sel:channelArn:DescribeChannelModerator' :: Text
channelArn =
Text
pChannelArn_,
$sel:channelModeratorArn:DescribeChannelModerator' :: Text
channelModeratorArn = Text
pChannelModeratorArn_,
$sel:chimeBearer:DescribeChannelModerator' :: Text
chimeBearer = Text
pChimeBearer_
}
describeChannelModerator_channelArn :: Lens.Lens' DescribeChannelModerator Prelude.Text
describeChannelModerator_channelArn :: (Text -> f Text)
-> DescribeChannelModerator -> f DescribeChannelModerator
describeChannelModerator_channelArn = (DescribeChannelModerator -> Text)
-> (DescribeChannelModerator -> Text -> DescribeChannelModerator)
-> Lens DescribeChannelModerator DescribeChannelModerator Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelModerator' {Text
channelArn :: Text
$sel:channelArn:DescribeChannelModerator' :: DescribeChannelModerator -> Text
channelArn} -> Text
channelArn) (\s :: DescribeChannelModerator
s@DescribeChannelModerator' {} Text
a -> DescribeChannelModerator
s {$sel:channelArn:DescribeChannelModerator' :: Text
channelArn = Text
a} :: DescribeChannelModerator)
describeChannelModerator_channelModeratorArn :: Lens.Lens' DescribeChannelModerator Prelude.Text
describeChannelModerator_channelModeratorArn :: (Text -> f Text)
-> DescribeChannelModerator -> f DescribeChannelModerator
describeChannelModerator_channelModeratorArn = (DescribeChannelModerator -> Text)
-> (DescribeChannelModerator -> Text -> DescribeChannelModerator)
-> Lens DescribeChannelModerator DescribeChannelModerator Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelModerator' {Text
channelModeratorArn :: Text
$sel:channelModeratorArn:DescribeChannelModerator' :: DescribeChannelModerator -> Text
channelModeratorArn} -> Text
channelModeratorArn) (\s :: DescribeChannelModerator
s@DescribeChannelModerator' {} Text
a -> DescribeChannelModerator
s {$sel:channelModeratorArn:DescribeChannelModerator' :: Text
channelModeratorArn = Text
a} :: DescribeChannelModerator)
describeChannelModerator_chimeBearer :: Lens.Lens' DescribeChannelModerator Prelude.Text
describeChannelModerator_chimeBearer :: (Text -> f Text)
-> DescribeChannelModerator -> f DescribeChannelModerator
describeChannelModerator_chimeBearer = (DescribeChannelModerator -> Text)
-> (DescribeChannelModerator -> Text -> DescribeChannelModerator)
-> Lens DescribeChannelModerator DescribeChannelModerator Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelModerator' {Text
chimeBearer :: Text
$sel:chimeBearer:DescribeChannelModerator' :: DescribeChannelModerator -> Text
chimeBearer} -> Text
chimeBearer) (\s :: DescribeChannelModerator
s@DescribeChannelModerator' {} Text
a -> DescribeChannelModerator
s {$sel:chimeBearer:DescribeChannelModerator' :: Text
chimeBearer = Text
a} :: DescribeChannelModerator)
instance Core.AWSRequest DescribeChannelModerator where
type
AWSResponse DescribeChannelModerator =
DescribeChannelModeratorResponse
request :: DescribeChannelModerator -> Request DescribeChannelModerator
request = Service
-> DescribeChannelModerator -> Request DescribeChannelModerator
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeChannelModerator
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeChannelModerator)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeChannelModerator))
-> Logger
-> Service
-> Proxy DescribeChannelModerator
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeChannelModerator)))
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 ChannelModerator -> Int -> DescribeChannelModeratorResponse
DescribeChannelModeratorResponse'
(Maybe ChannelModerator -> Int -> DescribeChannelModeratorResponse)
-> Either String (Maybe ChannelModerator)
-> Either String (Int -> DescribeChannelModeratorResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ChannelModerator)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ChannelModerator")
Either String (Int -> DescribeChannelModeratorResponse)
-> Either String Int
-> Either String DescribeChannelModeratorResponse
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 DescribeChannelModerator
instance Prelude.NFData DescribeChannelModerator
instance Core.ToHeaders DescribeChannelModerator where
toHeaders :: DescribeChannelModerator -> ResponseHeaders
toHeaders DescribeChannelModerator' {Text
chimeBearer :: Text
channelModeratorArn :: Text
channelArn :: Text
$sel:chimeBearer:DescribeChannelModerator' :: DescribeChannelModerator -> Text
$sel:channelModeratorArn:DescribeChannelModerator' :: DescribeChannelModerator -> Text
$sel:channelArn:DescribeChannelModerator' :: DescribeChannelModerator -> Text
..} =
[ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[HeaderName
"x-amz-chime-bearer" HeaderName -> Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Text
chimeBearer]
instance Core.ToPath DescribeChannelModerator where
toPath :: DescribeChannelModerator -> ByteString
toPath DescribeChannelModerator' {Text
chimeBearer :: Text
channelModeratorArn :: Text
channelArn :: Text
$sel:chimeBearer:DescribeChannelModerator' :: DescribeChannelModerator -> Text
$sel:channelModeratorArn:DescribeChannelModerator' :: DescribeChannelModerator -> Text
$sel:channelArn:DescribeChannelModerator' :: DescribeChannelModerator -> 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
"/moderators/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
channelModeratorArn
]
instance Core.ToQuery DescribeChannelModerator where
toQuery :: DescribeChannelModerator -> QueryString
toQuery = QueryString -> DescribeChannelModerator -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeChannelModeratorResponse = DescribeChannelModeratorResponse'
{
DescribeChannelModeratorResponse -> Maybe ChannelModerator
channelModerator :: Prelude.Maybe ChannelModerator,
DescribeChannelModeratorResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeChannelModeratorResponse
-> DescribeChannelModeratorResponse -> Bool
(DescribeChannelModeratorResponse
-> DescribeChannelModeratorResponse -> Bool)
-> (DescribeChannelModeratorResponse
-> DescribeChannelModeratorResponse -> Bool)
-> Eq DescribeChannelModeratorResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeChannelModeratorResponse
-> DescribeChannelModeratorResponse -> Bool
$c/= :: DescribeChannelModeratorResponse
-> DescribeChannelModeratorResponse -> Bool
== :: DescribeChannelModeratorResponse
-> DescribeChannelModeratorResponse -> Bool
$c== :: DescribeChannelModeratorResponse
-> DescribeChannelModeratorResponse -> Bool
Prelude.Eq, Int -> DescribeChannelModeratorResponse -> ShowS
[DescribeChannelModeratorResponse] -> ShowS
DescribeChannelModeratorResponse -> String
(Int -> DescribeChannelModeratorResponse -> ShowS)
-> (DescribeChannelModeratorResponse -> String)
-> ([DescribeChannelModeratorResponse] -> ShowS)
-> Show DescribeChannelModeratorResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeChannelModeratorResponse] -> ShowS
$cshowList :: [DescribeChannelModeratorResponse] -> ShowS
show :: DescribeChannelModeratorResponse -> String
$cshow :: DescribeChannelModeratorResponse -> String
showsPrec :: Int -> DescribeChannelModeratorResponse -> ShowS
$cshowsPrec :: Int -> DescribeChannelModeratorResponse -> ShowS
Prelude.Show, (forall x.
DescribeChannelModeratorResponse
-> Rep DescribeChannelModeratorResponse x)
-> (forall x.
Rep DescribeChannelModeratorResponse x
-> DescribeChannelModeratorResponse)
-> Generic DescribeChannelModeratorResponse
forall x.
Rep DescribeChannelModeratorResponse x
-> DescribeChannelModeratorResponse
forall x.
DescribeChannelModeratorResponse
-> Rep DescribeChannelModeratorResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeChannelModeratorResponse x
-> DescribeChannelModeratorResponse
$cfrom :: forall x.
DescribeChannelModeratorResponse
-> Rep DescribeChannelModeratorResponse x
Prelude.Generic)
newDescribeChannelModeratorResponse ::
Prelude.Int ->
DescribeChannelModeratorResponse
newDescribeChannelModeratorResponse :: Int -> DescribeChannelModeratorResponse
newDescribeChannelModeratorResponse Int
pHttpStatus_ =
DescribeChannelModeratorResponse' :: Maybe ChannelModerator -> Int -> DescribeChannelModeratorResponse
DescribeChannelModeratorResponse'
{ $sel:channelModerator:DescribeChannelModeratorResponse' :: Maybe ChannelModerator
channelModerator =
Maybe ChannelModerator
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeChannelModeratorResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeChannelModeratorResponse_channelModerator :: Lens.Lens' DescribeChannelModeratorResponse (Prelude.Maybe ChannelModerator)
describeChannelModeratorResponse_channelModerator :: (Maybe ChannelModerator -> f (Maybe ChannelModerator))
-> DescribeChannelModeratorResponse
-> f DescribeChannelModeratorResponse
describeChannelModeratorResponse_channelModerator = (DescribeChannelModeratorResponse -> Maybe ChannelModerator)
-> (DescribeChannelModeratorResponse
-> Maybe ChannelModerator -> DescribeChannelModeratorResponse)
-> Lens
DescribeChannelModeratorResponse
DescribeChannelModeratorResponse
(Maybe ChannelModerator)
(Maybe ChannelModerator)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelModeratorResponse' {Maybe ChannelModerator
channelModerator :: Maybe ChannelModerator
$sel:channelModerator:DescribeChannelModeratorResponse' :: DescribeChannelModeratorResponse -> Maybe ChannelModerator
channelModerator} -> Maybe ChannelModerator
channelModerator) (\s :: DescribeChannelModeratorResponse
s@DescribeChannelModeratorResponse' {} Maybe ChannelModerator
a -> DescribeChannelModeratorResponse
s {$sel:channelModerator:DescribeChannelModeratorResponse' :: Maybe ChannelModerator
channelModerator = Maybe ChannelModerator
a} :: DescribeChannelModeratorResponse)
describeChannelModeratorResponse_httpStatus :: Lens.Lens' DescribeChannelModeratorResponse Prelude.Int
describeChannelModeratorResponse_httpStatus :: (Int -> f Int)
-> DescribeChannelModeratorResponse
-> f DescribeChannelModeratorResponse
describeChannelModeratorResponse_httpStatus = (DescribeChannelModeratorResponse -> Int)
-> (DescribeChannelModeratorResponse
-> Int -> DescribeChannelModeratorResponse)
-> Lens
DescribeChannelModeratorResponse
DescribeChannelModeratorResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelModeratorResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeChannelModeratorResponse' :: DescribeChannelModeratorResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeChannelModeratorResponse
s@DescribeChannelModeratorResponse' {} Int
a -> DescribeChannelModeratorResponse
s {$sel:httpStatus:DescribeChannelModeratorResponse' :: Int
httpStatus = Int
a} :: DescribeChannelModeratorResponse)
instance
Prelude.NFData
DescribeChannelModeratorResponse