{-# 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.DescribeChannelBan
(
DescribeChannelBan (..),
newDescribeChannelBan,
describeChannelBan_chimeBearer,
describeChannelBan_channelArn,
describeChannelBan_memberArn,
DescribeChannelBanResponse (..),
newDescribeChannelBanResponse,
describeChannelBanResponse_channelBan,
describeChannelBanResponse_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 DescribeChannelBan = DescribeChannelBan'
{
DescribeChannelBan -> Maybe Text
chimeBearer :: Prelude.Maybe Prelude.Text,
DescribeChannelBan -> Text
channelArn :: Prelude.Text,
DescribeChannelBan -> Text
memberArn :: Prelude.Text
}
deriving (DescribeChannelBan -> DescribeChannelBan -> Bool
(DescribeChannelBan -> DescribeChannelBan -> Bool)
-> (DescribeChannelBan -> DescribeChannelBan -> Bool)
-> Eq DescribeChannelBan
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeChannelBan -> DescribeChannelBan -> Bool
$c/= :: DescribeChannelBan -> DescribeChannelBan -> Bool
== :: DescribeChannelBan -> DescribeChannelBan -> Bool
$c== :: DescribeChannelBan -> DescribeChannelBan -> Bool
Prelude.Eq, ReadPrec [DescribeChannelBan]
ReadPrec DescribeChannelBan
Int -> ReadS DescribeChannelBan
ReadS [DescribeChannelBan]
(Int -> ReadS DescribeChannelBan)
-> ReadS [DescribeChannelBan]
-> ReadPrec DescribeChannelBan
-> ReadPrec [DescribeChannelBan]
-> Read DescribeChannelBan
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeChannelBan]
$creadListPrec :: ReadPrec [DescribeChannelBan]
readPrec :: ReadPrec DescribeChannelBan
$creadPrec :: ReadPrec DescribeChannelBan
readList :: ReadS [DescribeChannelBan]
$creadList :: ReadS [DescribeChannelBan]
readsPrec :: Int -> ReadS DescribeChannelBan
$creadsPrec :: Int -> ReadS DescribeChannelBan
Prelude.Read, Int -> DescribeChannelBan -> ShowS
[DescribeChannelBan] -> ShowS
DescribeChannelBan -> String
(Int -> DescribeChannelBan -> ShowS)
-> (DescribeChannelBan -> String)
-> ([DescribeChannelBan] -> ShowS)
-> Show DescribeChannelBan
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeChannelBan] -> ShowS
$cshowList :: [DescribeChannelBan] -> ShowS
show :: DescribeChannelBan -> String
$cshow :: DescribeChannelBan -> String
showsPrec :: Int -> DescribeChannelBan -> ShowS
$cshowsPrec :: Int -> DescribeChannelBan -> ShowS
Prelude.Show, (forall x. DescribeChannelBan -> Rep DescribeChannelBan x)
-> (forall x. Rep DescribeChannelBan x -> DescribeChannelBan)
-> Generic DescribeChannelBan
forall x. Rep DescribeChannelBan x -> DescribeChannelBan
forall x. DescribeChannelBan -> Rep DescribeChannelBan x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeChannelBan x -> DescribeChannelBan
$cfrom :: forall x. DescribeChannelBan -> Rep DescribeChannelBan x
Prelude.Generic)
newDescribeChannelBan ::
Prelude.Text ->
Prelude.Text ->
DescribeChannelBan
newDescribeChannelBan :: Text -> Text -> DescribeChannelBan
newDescribeChannelBan Text
pChannelArn_ Text
pMemberArn_ =
DescribeChannelBan' :: Maybe Text -> Text -> Text -> DescribeChannelBan
DescribeChannelBan'
{ $sel:chimeBearer:DescribeChannelBan' :: Maybe Text
chimeBearer = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:channelArn:DescribeChannelBan' :: Text
channelArn = Text
pChannelArn_,
$sel:memberArn:DescribeChannelBan' :: Text
memberArn = Text
pMemberArn_
}
describeChannelBan_chimeBearer :: Lens.Lens' DescribeChannelBan (Prelude.Maybe Prelude.Text)
describeChannelBan_chimeBearer :: (Maybe Text -> f (Maybe Text))
-> DescribeChannelBan -> f DescribeChannelBan
describeChannelBan_chimeBearer = (DescribeChannelBan -> Maybe Text)
-> (DescribeChannelBan -> Maybe Text -> DescribeChannelBan)
-> Lens
DescribeChannelBan DescribeChannelBan (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelBan' {Maybe Text
chimeBearer :: Maybe Text
$sel:chimeBearer:DescribeChannelBan' :: DescribeChannelBan -> Maybe Text
chimeBearer} -> Maybe Text
chimeBearer) (\s :: DescribeChannelBan
s@DescribeChannelBan' {} Maybe Text
a -> DescribeChannelBan
s {$sel:chimeBearer:DescribeChannelBan' :: Maybe Text
chimeBearer = Maybe Text
a} :: DescribeChannelBan)
describeChannelBan_channelArn :: Lens.Lens' DescribeChannelBan Prelude.Text
describeChannelBan_channelArn :: (Text -> f Text) -> DescribeChannelBan -> f DescribeChannelBan
describeChannelBan_channelArn = (DescribeChannelBan -> Text)
-> (DescribeChannelBan -> Text -> DescribeChannelBan)
-> Lens DescribeChannelBan DescribeChannelBan Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelBan' {Text
channelArn :: Text
$sel:channelArn:DescribeChannelBan' :: DescribeChannelBan -> Text
channelArn} -> Text
channelArn) (\s :: DescribeChannelBan
s@DescribeChannelBan' {} Text
a -> DescribeChannelBan
s {$sel:channelArn:DescribeChannelBan' :: Text
channelArn = Text
a} :: DescribeChannelBan)
describeChannelBan_memberArn :: Lens.Lens' DescribeChannelBan Prelude.Text
describeChannelBan_memberArn :: (Text -> f Text) -> DescribeChannelBan -> f DescribeChannelBan
describeChannelBan_memberArn = (DescribeChannelBan -> Text)
-> (DescribeChannelBan -> Text -> DescribeChannelBan)
-> Lens DescribeChannelBan DescribeChannelBan Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelBan' {Text
memberArn :: Text
$sel:memberArn:DescribeChannelBan' :: DescribeChannelBan -> Text
memberArn} -> Text
memberArn) (\s :: DescribeChannelBan
s@DescribeChannelBan' {} Text
a -> DescribeChannelBan
s {$sel:memberArn:DescribeChannelBan' :: Text
memberArn = Text
a} :: DescribeChannelBan)
instance Core.AWSRequest DescribeChannelBan where
type
AWSResponse DescribeChannelBan =
DescribeChannelBanResponse
request :: DescribeChannelBan -> Request DescribeChannelBan
request = Service -> DescribeChannelBan -> Request DescribeChannelBan
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeChannelBan
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeChannelBan)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeChannelBan))
-> Logger
-> Service
-> Proxy DescribeChannelBan
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeChannelBan)))
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 ChannelBan -> Int -> DescribeChannelBanResponse
DescribeChannelBanResponse'
(Maybe ChannelBan -> Int -> DescribeChannelBanResponse)
-> Either String (Maybe ChannelBan)
-> Either String (Int -> DescribeChannelBanResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ChannelBan)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ChannelBan")
Either String (Int -> DescribeChannelBanResponse)
-> Either String Int -> Either String DescribeChannelBanResponse
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 DescribeChannelBan
instance Prelude.NFData DescribeChannelBan
instance Core.ToHeaders DescribeChannelBan where
toHeaders :: DescribeChannelBan -> ResponseHeaders
toHeaders DescribeChannelBan' {Maybe Text
Text
memberArn :: Text
channelArn :: Text
chimeBearer :: Maybe Text
$sel:memberArn:DescribeChannelBan' :: DescribeChannelBan -> Text
$sel:channelArn:DescribeChannelBan' :: DescribeChannelBan -> Text
$sel:chimeBearer:DescribeChannelBan' :: DescribeChannelBan -> 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 DescribeChannelBan where
toPath :: DescribeChannelBan -> ByteString
toPath DescribeChannelBan' {Maybe Text
Text
memberArn :: Text
channelArn :: Text
chimeBearer :: Maybe Text
$sel:memberArn:DescribeChannelBan' :: DescribeChannelBan -> Text
$sel:channelArn:DescribeChannelBan' :: DescribeChannelBan -> Text
$sel:chimeBearer:DescribeChannelBan' :: DescribeChannelBan -> 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
"/bans/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
memberArn
]
instance Core.ToQuery DescribeChannelBan where
toQuery :: DescribeChannelBan -> QueryString
toQuery = QueryString -> DescribeChannelBan -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeChannelBanResponse = DescribeChannelBanResponse'
{
DescribeChannelBanResponse -> Maybe ChannelBan
channelBan :: Prelude.Maybe ChannelBan,
DescribeChannelBanResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeChannelBanResponse -> DescribeChannelBanResponse -> Bool
(DescribeChannelBanResponse -> DescribeChannelBanResponse -> Bool)
-> (DescribeChannelBanResponse
-> DescribeChannelBanResponse -> Bool)
-> Eq DescribeChannelBanResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeChannelBanResponse -> DescribeChannelBanResponse -> Bool
$c/= :: DescribeChannelBanResponse -> DescribeChannelBanResponse -> Bool
== :: DescribeChannelBanResponse -> DescribeChannelBanResponse -> Bool
$c== :: DescribeChannelBanResponse -> DescribeChannelBanResponse -> Bool
Prelude.Eq, Int -> DescribeChannelBanResponse -> ShowS
[DescribeChannelBanResponse] -> ShowS
DescribeChannelBanResponse -> String
(Int -> DescribeChannelBanResponse -> ShowS)
-> (DescribeChannelBanResponse -> String)
-> ([DescribeChannelBanResponse] -> ShowS)
-> Show DescribeChannelBanResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeChannelBanResponse] -> ShowS
$cshowList :: [DescribeChannelBanResponse] -> ShowS
show :: DescribeChannelBanResponse -> String
$cshow :: DescribeChannelBanResponse -> String
showsPrec :: Int -> DescribeChannelBanResponse -> ShowS
$cshowsPrec :: Int -> DescribeChannelBanResponse -> ShowS
Prelude.Show, (forall x.
DescribeChannelBanResponse -> Rep DescribeChannelBanResponse x)
-> (forall x.
Rep DescribeChannelBanResponse x -> DescribeChannelBanResponse)
-> Generic DescribeChannelBanResponse
forall x.
Rep DescribeChannelBanResponse x -> DescribeChannelBanResponse
forall x.
DescribeChannelBanResponse -> Rep DescribeChannelBanResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeChannelBanResponse x -> DescribeChannelBanResponse
$cfrom :: forall x.
DescribeChannelBanResponse -> Rep DescribeChannelBanResponse x
Prelude.Generic)
newDescribeChannelBanResponse ::
Prelude.Int ->
DescribeChannelBanResponse
newDescribeChannelBanResponse :: Int -> DescribeChannelBanResponse
newDescribeChannelBanResponse Int
pHttpStatus_ =
DescribeChannelBanResponse' :: Maybe ChannelBan -> Int -> DescribeChannelBanResponse
DescribeChannelBanResponse'
{ $sel:channelBan:DescribeChannelBanResponse' :: Maybe ChannelBan
channelBan =
Maybe ChannelBan
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeChannelBanResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeChannelBanResponse_channelBan :: Lens.Lens' DescribeChannelBanResponse (Prelude.Maybe ChannelBan)
describeChannelBanResponse_channelBan :: (Maybe ChannelBan -> f (Maybe ChannelBan))
-> DescribeChannelBanResponse -> f DescribeChannelBanResponse
describeChannelBanResponse_channelBan = (DescribeChannelBanResponse -> Maybe ChannelBan)
-> (DescribeChannelBanResponse
-> Maybe ChannelBan -> DescribeChannelBanResponse)
-> Lens
DescribeChannelBanResponse
DescribeChannelBanResponse
(Maybe ChannelBan)
(Maybe ChannelBan)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelBanResponse' {Maybe ChannelBan
channelBan :: Maybe ChannelBan
$sel:channelBan:DescribeChannelBanResponse' :: DescribeChannelBanResponse -> Maybe ChannelBan
channelBan} -> Maybe ChannelBan
channelBan) (\s :: DescribeChannelBanResponse
s@DescribeChannelBanResponse' {} Maybe ChannelBan
a -> DescribeChannelBanResponse
s {$sel:channelBan:DescribeChannelBanResponse' :: Maybe ChannelBan
channelBan = Maybe ChannelBan
a} :: DescribeChannelBanResponse)
describeChannelBanResponse_httpStatus :: Lens.Lens' DescribeChannelBanResponse Prelude.Int
describeChannelBanResponse_httpStatus :: (Int -> f Int)
-> DescribeChannelBanResponse -> f DescribeChannelBanResponse
describeChannelBanResponse_httpStatus = (DescribeChannelBanResponse -> Int)
-> (DescribeChannelBanResponse
-> Int -> DescribeChannelBanResponse)
-> Lens
DescribeChannelBanResponse DescribeChannelBanResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelBanResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeChannelBanResponse' :: DescribeChannelBanResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeChannelBanResponse
s@DescribeChannelBanResponse' {} Int
a -> DescribeChannelBanResponse
s {$sel:httpStatus:DescribeChannelBanResponse' :: Int
httpStatus = Int
a} :: DescribeChannelBanResponse)
instance Prelude.NFData DescribeChannelBanResponse