{-# 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.ListChannelBans
(
ListChannelBans (..),
newListChannelBans,
listChannelBans_chimeBearer,
listChannelBans_maxResults,
listChannelBans_nextToken,
listChannelBans_channelArn,
ListChannelBansResponse (..),
newListChannelBansResponse,
listChannelBansResponse_channelArn,
listChannelBansResponse_channelBans,
listChannelBansResponse_nextToken,
listChannelBansResponse_httpStatus,
)
where
import Amazonka.Chime.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListChannelBans = ListChannelBans'
{
ListChannelBans -> Maybe Text
chimeBearer :: Prelude.Maybe Prelude.Text,
ListChannelBans -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListChannelBans -> Maybe (Sensitive Text)
nextToken :: Prelude.Maybe (Data.Sensitive Prelude.Text),
ListChannelBans -> Text
channelArn :: Prelude.Text
}
deriving (ListChannelBans -> ListChannelBans -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListChannelBans -> ListChannelBans -> Bool
$c/= :: ListChannelBans -> ListChannelBans -> Bool
== :: ListChannelBans -> ListChannelBans -> Bool
$c== :: ListChannelBans -> ListChannelBans -> Bool
Prelude.Eq, Int -> ListChannelBans -> ShowS
[ListChannelBans] -> ShowS
ListChannelBans -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListChannelBans] -> ShowS
$cshowList :: [ListChannelBans] -> ShowS
show :: ListChannelBans -> String
$cshow :: ListChannelBans -> String
showsPrec :: Int -> ListChannelBans -> ShowS
$cshowsPrec :: Int -> ListChannelBans -> ShowS
Prelude.Show, forall x. Rep ListChannelBans x -> ListChannelBans
forall x. ListChannelBans -> Rep ListChannelBans x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListChannelBans x -> ListChannelBans
$cfrom :: forall x. ListChannelBans -> Rep ListChannelBans x
Prelude.Generic)
newListChannelBans ::
Prelude.Text ->
ListChannelBans
newListChannelBans :: Text -> ListChannelBans
newListChannelBans Text
pChannelArn_ =
ListChannelBans'
{ $sel:chimeBearer:ListChannelBans' :: Maybe Text
chimeBearer = forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListChannelBans' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListChannelBans' :: Maybe (Sensitive Text)
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:channelArn:ListChannelBans' :: Text
channelArn = Text
pChannelArn_
}
listChannelBans_chimeBearer :: Lens.Lens' ListChannelBans (Prelude.Maybe Prelude.Text)
listChannelBans_chimeBearer :: Lens' ListChannelBans (Maybe Text)
listChannelBans_chimeBearer = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelBans' {Maybe Text
chimeBearer :: Maybe Text
$sel:chimeBearer:ListChannelBans' :: ListChannelBans -> Maybe Text
chimeBearer} -> Maybe Text
chimeBearer) (\s :: ListChannelBans
s@ListChannelBans' {} Maybe Text
a -> ListChannelBans
s {$sel:chimeBearer:ListChannelBans' :: Maybe Text
chimeBearer = Maybe Text
a} :: ListChannelBans)
listChannelBans_maxResults :: Lens.Lens' ListChannelBans (Prelude.Maybe Prelude.Natural)
listChannelBans_maxResults :: Lens' ListChannelBans (Maybe Natural)
listChannelBans_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelBans' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListChannelBans' :: ListChannelBans -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListChannelBans
s@ListChannelBans' {} Maybe Natural
a -> ListChannelBans
s {$sel:maxResults:ListChannelBans' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListChannelBans)
listChannelBans_nextToken :: Lens.Lens' ListChannelBans (Prelude.Maybe Prelude.Text)
listChannelBans_nextToken :: Lens' ListChannelBans (Maybe Text)
listChannelBans_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelBans' {Maybe (Sensitive Text)
nextToken :: Maybe (Sensitive Text)
$sel:nextToken:ListChannelBans' :: ListChannelBans -> Maybe (Sensitive Text)
nextToken} -> Maybe (Sensitive Text)
nextToken) (\s :: ListChannelBans
s@ListChannelBans' {} Maybe (Sensitive Text)
a -> ListChannelBans
s {$sel:nextToken:ListChannelBans' :: Maybe (Sensitive Text)
nextToken = Maybe (Sensitive Text)
a} :: ListChannelBans) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive
listChannelBans_channelArn :: Lens.Lens' ListChannelBans Prelude.Text
listChannelBans_channelArn :: Lens' ListChannelBans Text
listChannelBans_channelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelBans' {Text
channelArn :: Text
$sel:channelArn:ListChannelBans' :: ListChannelBans -> Text
channelArn} -> Text
channelArn) (\s :: ListChannelBans
s@ListChannelBans' {} Text
a -> ListChannelBans
s {$sel:channelArn:ListChannelBans' :: Text
channelArn = Text
a} :: ListChannelBans)
instance Core.AWSRequest ListChannelBans where
type
AWSResponse ListChannelBans =
ListChannelBansResponse
request :: (Service -> Service) -> ListChannelBans -> Request ListChannelBans
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListChannelBans
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListChannelBans)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe [ChannelBanSummary]
-> Maybe (Sensitive Text)
-> Int
-> ListChannelBansResponse
ListChannelBansResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ChannelArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ChannelBans" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListChannelBans where
hashWithSalt :: Int -> ListChannelBans -> Int
hashWithSalt Int
_salt ListChannelBans' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Text
channelArn :: Text
nextToken :: Maybe (Sensitive Text)
maxResults :: Maybe Natural
chimeBearer :: Maybe Text
$sel:channelArn:ListChannelBans' :: ListChannelBans -> Text
$sel:nextToken:ListChannelBans' :: ListChannelBans -> Maybe (Sensitive Text)
$sel:maxResults:ListChannelBans' :: ListChannelBans -> Maybe Natural
$sel:chimeBearer:ListChannelBans' :: ListChannelBans -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
chimeBearer
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
channelArn
instance Prelude.NFData ListChannelBans where
rnf :: ListChannelBans -> ()
rnf ListChannelBans' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Text
channelArn :: Text
nextToken :: Maybe (Sensitive Text)
maxResults :: Maybe Natural
chimeBearer :: Maybe Text
$sel:channelArn:ListChannelBans' :: ListChannelBans -> Text
$sel:nextToken:ListChannelBans' :: ListChannelBans -> Maybe (Sensitive Text)
$sel:maxResults:ListChannelBans' :: ListChannelBans -> Maybe Natural
$sel:chimeBearer:ListChannelBans' :: ListChannelBans -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
chimeBearer
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
channelArn
instance Data.ToHeaders ListChannelBans where
toHeaders :: ListChannelBans -> ResponseHeaders
toHeaders ListChannelBans' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Text
channelArn :: Text
nextToken :: Maybe (Sensitive Text)
maxResults :: Maybe Natural
chimeBearer :: Maybe Text
$sel:channelArn:ListChannelBans' :: ListChannelBans -> Text
$sel:nextToken:ListChannelBans' :: ListChannelBans -> Maybe (Sensitive Text)
$sel:maxResults:ListChannelBans' :: ListChannelBans -> Maybe Natural
$sel:chimeBearer:ListChannelBans' :: ListChannelBans -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[HeaderName
"x-amz-chime-bearer" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
chimeBearer]
instance Data.ToPath ListChannelBans where
toPath :: ListChannelBans -> ByteString
toPath ListChannelBans' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Text
channelArn :: Text
nextToken :: Maybe (Sensitive Text)
maxResults :: Maybe Natural
chimeBearer :: Maybe Text
$sel:channelArn:ListChannelBans' :: ListChannelBans -> Text
$sel:nextToken:ListChannelBans' :: ListChannelBans -> Maybe (Sensitive Text)
$sel:maxResults:ListChannelBans' :: ListChannelBans -> Maybe Natural
$sel:chimeBearer:ListChannelBans' :: ListChannelBans -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/channels/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
channelArn, ByteString
"/bans"]
instance Data.ToQuery ListChannelBans where
toQuery :: ListChannelBans -> QueryString
toQuery ListChannelBans' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Text
channelArn :: Text
nextToken :: Maybe (Sensitive Text)
maxResults :: Maybe Natural
chimeBearer :: Maybe Text
$sel:channelArn:ListChannelBans' :: ListChannelBans -> Text
$sel:nextToken:ListChannelBans' :: ListChannelBans -> Maybe (Sensitive Text)
$sel:maxResults:ListChannelBans' :: ListChannelBans -> Maybe Natural
$sel:chimeBearer:ListChannelBans' :: ListChannelBans -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"max-results" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"next-token" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe (Sensitive Text)
nextToken
]
data ListChannelBansResponse = ListChannelBansResponse'
{
ListChannelBansResponse -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
ListChannelBansResponse -> Maybe [ChannelBanSummary]
channelBans :: Prelude.Maybe [ChannelBanSummary],
ListChannelBansResponse -> Maybe (Sensitive Text)
nextToken :: Prelude.Maybe (Data.Sensitive Prelude.Text),
ListChannelBansResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListChannelBansResponse -> ListChannelBansResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListChannelBansResponse -> ListChannelBansResponse -> Bool
$c/= :: ListChannelBansResponse -> ListChannelBansResponse -> Bool
== :: ListChannelBansResponse -> ListChannelBansResponse -> Bool
$c== :: ListChannelBansResponse -> ListChannelBansResponse -> Bool
Prelude.Eq, Int -> ListChannelBansResponse -> ShowS
[ListChannelBansResponse] -> ShowS
ListChannelBansResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListChannelBansResponse] -> ShowS
$cshowList :: [ListChannelBansResponse] -> ShowS
show :: ListChannelBansResponse -> String
$cshow :: ListChannelBansResponse -> String
showsPrec :: Int -> ListChannelBansResponse -> ShowS
$cshowsPrec :: Int -> ListChannelBansResponse -> ShowS
Prelude.Show, forall x. Rep ListChannelBansResponse x -> ListChannelBansResponse
forall x. ListChannelBansResponse -> Rep ListChannelBansResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListChannelBansResponse x -> ListChannelBansResponse
$cfrom :: forall x. ListChannelBansResponse -> Rep ListChannelBansResponse x
Prelude.Generic)
newListChannelBansResponse ::
Prelude.Int ->
ListChannelBansResponse
newListChannelBansResponse :: Int -> ListChannelBansResponse
newListChannelBansResponse Int
pHttpStatus_ =
ListChannelBansResponse'
{ $sel:channelArn:ListChannelBansResponse' :: Maybe Text
channelArn =
forall a. Maybe a
Prelude.Nothing,
$sel:channelBans:ListChannelBansResponse' :: Maybe [ChannelBanSummary]
channelBans = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListChannelBansResponse' :: Maybe (Sensitive Text)
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListChannelBansResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listChannelBansResponse_channelArn :: Lens.Lens' ListChannelBansResponse (Prelude.Maybe Prelude.Text)
listChannelBansResponse_channelArn :: Lens' ListChannelBansResponse (Maybe Text)
listChannelBansResponse_channelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelBansResponse' {Maybe Text
channelArn :: Maybe Text
$sel:channelArn:ListChannelBansResponse' :: ListChannelBansResponse -> Maybe Text
channelArn} -> Maybe Text
channelArn) (\s :: ListChannelBansResponse
s@ListChannelBansResponse' {} Maybe Text
a -> ListChannelBansResponse
s {$sel:channelArn:ListChannelBansResponse' :: Maybe Text
channelArn = Maybe Text
a} :: ListChannelBansResponse)
listChannelBansResponse_channelBans :: Lens.Lens' ListChannelBansResponse (Prelude.Maybe [ChannelBanSummary])
listChannelBansResponse_channelBans :: Lens' ListChannelBansResponse (Maybe [ChannelBanSummary])
listChannelBansResponse_channelBans = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelBansResponse' {Maybe [ChannelBanSummary]
channelBans :: Maybe [ChannelBanSummary]
$sel:channelBans:ListChannelBansResponse' :: ListChannelBansResponse -> Maybe [ChannelBanSummary]
channelBans} -> Maybe [ChannelBanSummary]
channelBans) (\s :: ListChannelBansResponse
s@ListChannelBansResponse' {} Maybe [ChannelBanSummary]
a -> ListChannelBansResponse
s {$sel:channelBans:ListChannelBansResponse' :: Maybe [ChannelBanSummary]
channelBans = Maybe [ChannelBanSummary]
a} :: ListChannelBansResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listChannelBansResponse_nextToken :: Lens.Lens' ListChannelBansResponse (Prelude.Maybe Prelude.Text)
listChannelBansResponse_nextToken :: Lens' ListChannelBansResponse (Maybe Text)
listChannelBansResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelBansResponse' {Maybe (Sensitive Text)
nextToken :: Maybe (Sensitive Text)
$sel:nextToken:ListChannelBansResponse' :: ListChannelBansResponse -> Maybe (Sensitive Text)
nextToken} -> Maybe (Sensitive Text)
nextToken) (\s :: ListChannelBansResponse
s@ListChannelBansResponse' {} Maybe (Sensitive Text)
a -> ListChannelBansResponse
s {$sel:nextToken:ListChannelBansResponse' :: Maybe (Sensitive Text)
nextToken = Maybe (Sensitive Text)
a} :: ListChannelBansResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive
listChannelBansResponse_httpStatus :: Lens.Lens' ListChannelBansResponse Prelude.Int
listChannelBansResponse_httpStatus :: Lens' ListChannelBansResponse Int
listChannelBansResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelBansResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListChannelBansResponse' :: ListChannelBansResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListChannelBansResponse
s@ListChannelBansResponse' {} Int
a -> ListChannelBansResponse
s {$sel:httpStatus:ListChannelBansResponse' :: Int
httpStatus = Int
a} :: ListChannelBansResponse)
instance Prelude.NFData ListChannelBansResponse where
rnf :: ListChannelBansResponse -> ()
rnf ListChannelBansResponse' {Int
Maybe [ChannelBanSummary]
Maybe Text
Maybe (Sensitive Text)
httpStatus :: Int
nextToken :: Maybe (Sensitive Text)
channelBans :: Maybe [ChannelBanSummary]
channelArn :: Maybe Text
$sel:httpStatus:ListChannelBansResponse' :: ListChannelBansResponse -> Int
$sel:nextToken:ListChannelBansResponse' :: ListChannelBansResponse -> Maybe (Sensitive Text)
$sel:channelBans:ListChannelBansResponse' :: ListChannelBansResponse -> Maybe [ChannelBanSummary]
$sel:channelArn:ListChannelBansResponse' :: ListChannelBansResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
channelArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ChannelBanSummary]
channelBans
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus