{-# 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.ListChannels
(
ListChannels (..),
newListChannels,
listChannels_maxResults,
listChannels_nextToken,
listChannels_privacy,
listChannels_appInstanceArn,
listChannels_chimeBearer,
ListChannelsResponse (..),
newListChannelsResponse,
listChannelsResponse_channels,
listChannelsResponse_nextToken,
listChannelsResponse_httpStatus,
)
where
import Amazonka.ChimeSDKMessaging.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 ListChannels = ListChannels'
{
ListChannels -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListChannels -> Maybe (Sensitive Text)
nextToken :: Prelude.Maybe (Data.Sensitive Prelude.Text),
ListChannels -> Maybe ChannelPrivacy
privacy :: Prelude.Maybe ChannelPrivacy,
ListChannels -> Text
appInstanceArn :: Prelude.Text,
ListChannels -> Text
chimeBearer :: Prelude.Text
}
deriving (ListChannels -> ListChannels -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListChannels -> ListChannels -> Bool
$c/= :: ListChannels -> ListChannels -> Bool
== :: ListChannels -> ListChannels -> Bool
$c== :: ListChannels -> ListChannels -> Bool
Prelude.Eq, Int -> ListChannels -> ShowS
[ListChannels] -> ShowS
ListChannels -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListChannels] -> ShowS
$cshowList :: [ListChannels] -> ShowS
show :: ListChannels -> String
$cshow :: ListChannels -> String
showsPrec :: Int -> ListChannels -> ShowS
$cshowsPrec :: Int -> ListChannels -> ShowS
Prelude.Show, forall x. Rep ListChannels x -> ListChannels
forall x. ListChannels -> Rep ListChannels x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListChannels x -> ListChannels
$cfrom :: forall x. ListChannels -> Rep ListChannels x
Prelude.Generic)
newListChannels ::
Prelude.Text ->
Prelude.Text ->
ListChannels
newListChannels :: Text -> Text -> ListChannels
newListChannels Text
pAppInstanceArn_ Text
pChimeBearer_ =
ListChannels'
{ $sel:maxResults:ListChannels' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListChannels' :: Maybe (Sensitive Text)
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:privacy:ListChannels' :: Maybe ChannelPrivacy
privacy = forall a. Maybe a
Prelude.Nothing,
$sel:appInstanceArn:ListChannels' :: Text
appInstanceArn = Text
pAppInstanceArn_,
$sel:chimeBearer:ListChannels' :: Text
chimeBearer = Text
pChimeBearer_
}
listChannels_maxResults :: Lens.Lens' ListChannels (Prelude.Maybe Prelude.Natural)
listChannels_maxResults :: Lens' ListChannels (Maybe Natural)
listChannels_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannels' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListChannels' :: ListChannels -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListChannels
s@ListChannels' {} Maybe Natural
a -> ListChannels
s {$sel:maxResults:ListChannels' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListChannels)
listChannels_nextToken :: Lens.Lens' ListChannels (Prelude.Maybe Prelude.Text)
listChannels_nextToken :: Lens' ListChannels (Maybe Text)
listChannels_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannels' {Maybe (Sensitive Text)
nextToken :: Maybe (Sensitive Text)
$sel:nextToken:ListChannels' :: ListChannels -> Maybe (Sensitive Text)
nextToken} -> Maybe (Sensitive Text)
nextToken) (\s :: ListChannels
s@ListChannels' {} Maybe (Sensitive Text)
a -> ListChannels
s {$sel:nextToken:ListChannels' :: Maybe (Sensitive Text)
nextToken = Maybe (Sensitive Text)
a} :: ListChannels) 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
listChannels_privacy :: Lens.Lens' ListChannels (Prelude.Maybe ChannelPrivacy)
listChannels_privacy :: Lens' ListChannels (Maybe ChannelPrivacy)
listChannels_privacy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannels' {Maybe ChannelPrivacy
privacy :: Maybe ChannelPrivacy
$sel:privacy:ListChannels' :: ListChannels -> Maybe ChannelPrivacy
privacy} -> Maybe ChannelPrivacy
privacy) (\s :: ListChannels
s@ListChannels' {} Maybe ChannelPrivacy
a -> ListChannels
s {$sel:privacy:ListChannels' :: Maybe ChannelPrivacy
privacy = Maybe ChannelPrivacy
a} :: ListChannels)
listChannels_appInstanceArn :: Lens.Lens' ListChannels Prelude.Text
listChannels_appInstanceArn :: Lens' ListChannels Text
listChannels_appInstanceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannels' {Text
appInstanceArn :: Text
$sel:appInstanceArn:ListChannels' :: ListChannels -> Text
appInstanceArn} -> Text
appInstanceArn) (\s :: ListChannels
s@ListChannels' {} Text
a -> ListChannels
s {$sel:appInstanceArn:ListChannels' :: Text
appInstanceArn = Text
a} :: ListChannels)
listChannels_chimeBearer :: Lens.Lens' ListChannels Prelude.Text
listChannels_chimeBearer :: Lens' ListChannels Text
listChannels_chimeBearer = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannels' {Text
chimeBearer :: Text
$sel:chimeBearer:ListChannels' :: ListChannels -> Text
chimeBearer} -> Text
chimeBearer) (\s :: ListChannels
s@ListChannels' {} Text
a -> ListChannels
s {$sel:chimeBearer:ListChannels' :: Text
chimeBearer = Text
a} :: ListChannels)
instance Core.AWSRequest ListChannels where
type AWSResponse ListChannels = ListChannelsResponse
request :: (Service -> Service) -> ListChannels -> Request ListChannels
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 ListChannels
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListChannels)))
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 [ChannelSummary]
-> Maybe (Sensitive Text) -> Int -> ListChannelsResponse
ListChannelsResponse'
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
"Channels" 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 ListChannels where
hashWithSalt :: Int -> ListChannels -> Int
hashWithSalt Int
_salt ListChannels' {Maybe Natural
Maybe (Sensitive Text)
Maybe ChannelPrivacy
Text
chimeBearer :: Text
appInstanceArn :: Text
privacy :: Maybe ChannelPrivacy
nextToken :: Maybe (Sensitive Text)
maxResults :: Maybe Natural
$sel:chimeBearer:ListChannels' :: ListChannels -> Text
$sel:appInstanceArn:ListChannels' :: ListChannels -> Text
$sel:privacy:ListChannels' :: ListChannels -> Maybe ChannelPrivacy
$sel:nextToken:ListChannels' :: ListChannels -> Maybe (Sensitive Text)
$sel:maxResults:ListChannels' :: ListChannels -> Maybe Natural
..} =
Int
_salt
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` Maybe ChannelPrivacy
privacy
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
appInstanceArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
chimeBearer
instance Prelude.NFData ListChannels where
rnf :: ListChannels -> ()
rnf ListChannels' {Maybe Natural
Maybe (Sensitive Text)
Maybe ChannelPrivacy
Text
chimeBearer :: Text
appInstanceArn :: Text
privacy :: Maybe ChannelPrivacy
nextToken :: Maybe (Sensitive Text)
maxResults :: Maybe Natural
$sel:chimeBearer:ListChannels' :: ListChannels -> Text
$sel:appInstanceArn:ListChannels' :: ListChannels -> Text
$sel:privacy:ListChannels' :: ListChannels -> Maybe ChannelPrivacy
$sel:nextToken:ListChannels' :: ListChannels -> Maybe (Sensitive Text)
$sel:maxResults:ListChannels' :: ListChannels -> Maybe Natural
..} =
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 Maybe ChannelPrivacy
privacy
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
appInstanceArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
chimeBearer
instance Data.ToHeaders ListChannels where
toHeaders :: ListChannels -> ResponseHeaders
toHeaders ListChannels' {Maybe Natural
Maybe (Sensitive Text)
Maybe ChannelPrivacy
Text
chimeBearer :: Text
appInstanceArn :: Text
privacy :: Maybe ChannelPrivacy
nextToken :: Maybe (Sensitive Text)
maxResults :: Maybe Natural
$sel:chimeBearer:ListChannels' :: ListChannels -> Text
$sel:appInstanceArn:ListChannels' :: ListChannels -> Text
$sel:privacy:ListChannels' :: ListChannels -> Maybe ChannelPrivacy
$sel:nextToken:ListChannels' :: ListChannels -> Maybe (Sensitive Text)
$sel:maxResults:ListChannels' :: ListChannels -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[HeaderName
"x-amz-chime-bearer" forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Text
chimeBearer]
instance Data.ToPath ListChannels where
toPath :: ListChannels -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/channels"
instance Data.ToQuery ListChannels where
toQuery :: ListChannels -> QueryString
toQuery ListChannels' {Maybe Natural
Maybe (Sensitive Text)
Maybe ChannelPrivacy
Text
chimeBearer :: Text
appInstanceArn :: Text
privacy :: Maybe ChannelPrivacy
nextToken :: Maybe (Sensitive Text)
maxResults :: Maybe Natural
$sel:chimeBearer:ListChannels' :: ListChannels -> Text
$sel:appInstanceArn:ListChannels' :: ListChannels -> Text
$sel:privacy:ListChannels' :: ListChannels -> Maybe ChannelPrivacy
$sel:nextToken:ListChannels' :: ListChannels -> Maybe (Sensitive Text)
$sel:maxResults:ListChannels' :: ListChannels -> Maybe Natural
..} =
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,
ByteString
"privacy" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe ChannelPrivacy
privacy,
ByteString
"app-instance-arn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
appInstanceArn
]
data ListChannelsResponse = ListChannelsResponse'
{
ListChannelsResponse -> Maybe [ChannelSummary]
channels :: Prelude.Maybe [ChannelSummary],
ListChannelsResponse -> Maybe (Sensitive Text)
nextToken :: Prelude.Maybe (Data.Sensitive Prelude.Text),
ListChannelsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListChannelsResponse -> ListChannelsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListChannelsResponse -> ListChannelsResponse -> Bool
$c/= :: ListChannelsResponse -> ListChannelsResponse -> Bool
== :: ListChannelsResponse -> ListChannelsResponse -> Bool
$c== :: ListChannelsResponse -> ListChannelsResponse -> Bool
Prelude.Eq, Int -> ListChannelsResponse -> ShowS
[ListChannelsResponse] -> ShowS
ListChannelsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListChannelsResponse] -> ShowS
$cshowList :: [ListChannelsResponse] -> ShowS
show :: ListChannelsResponse -> String
$cshow :: ListChannelsResponse -> String
showsPrec :: Int -> ListChannelsResponse -> ShowS
$cshowsPrec :: Int -> ListChannelsResponse -> ShowS
Prelude.Show, forall x. Rep ListChannelsResponse x -> ListChannelsResponse
forall x. ListChannelsResponse -> Rep ListChannelsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListChannelsResponse x -> ListChannelsResponse
$cfrom :: forall x. ListChannelsResponse -> Rep ListChannelsResponse x
Prelude.Generic)
newListChannelsResponse ::
Prelude.Int ->
ListChannelsResponse
newListChannelsResponse :: Int -> ListChannelsResponse
newListChannelsResponse Int
pHttpStatus_ =
ListChannelsResponse'
{ $sel:channels:ListChannelsResponse' :: Maybe [ChannelSummary]
channels = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListChannelsResponse' :: Maybe (Sensitive Text)
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListChannelsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listChannelsResponse_channels :: Lens.Lens' ListChannelsResponse (Prelude.Maybe [ChannelSummary])
listChannelsResponse_channels :: Lens' ListChannelsResponse (Maybe [ChannelSummary])
listChannelsResponse_channels = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelsResponse' {Maybe [ChannelSummary]
channels :: Maybe [ChannelSummary]
$sel:channels:ListChannelsResponse' :: ListChannelsResponse -> Maybe [ChannelSummary]
channels} -> Maybe [ChannelSummary]
channels) (\s :: ListChannelsResponse
s@ListChannelsResponse' {} Maybe [ChannelSummary]
a -> ListChannelsResponse
s {$sel:channels:ListChannelsResponse' :: Maybe [ChannelSummary]
channels = Maybe [ChannelSummary]
a} :: ListChannelsResponse) 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
listChannelsResponse_nextToken :: Lens.Lens' ListChannelsResponse (Prelude.Maybe Prelude.Text)
listChannelsResponse_nextToken :: Lens' ListChannelsResponse (Maybe Text)
listChannelsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelsResponse' {Maybe (Sensitive Text)
nextToken :: Maybe (Sensitive Text)
$sel:nextToken:ListChannelsResponse' :: ListChannelsResponse -> Maybe (Sensitive Text)
nextToken} -> Maybe (Sensitive Text)
nextToken) (\s :: ListChannelsResponse
s@ListChannelsResponse' {} Maybe (Sensitive Text)
a -> ListChannelsResponse
s {$sel:nextToken:ListChannelsResponse' :: Maybe (Sensitive Text)
nextToken = Maybe (Sensitive Text)
a} :: ListChannelsResponse) 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
listChannelsResponse_httpStatus :: Lens.Lens' ListChannelsResponse Prelude.Int
listChannelsResponse_httpStatus :: Lens' ListChannelsResponse Int
listChannelsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListChannelsResponse' :: ListChannelsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListChannelsResponse
s@ListChannelsResponse' {} Int
a -> ListChannelsResponse
s {$sel:httpStatus:ListChannelsResponse' :: Int
httpStatus = Int
a} :: ListChannelsResponse)
instance Prelude.NFData ListChannelsResponse where
rnf :: ListChannelsResponse -> ()
rnf ListChannelsResponse' {Int
Maybe [ChannelSummary]
Maybe (Sensitive Text)
httpStatus :: Int
nextToken :: Maybe (Sensitive Text)
channels :: Maybe [ChannelSummary]
$sel:httpStatus:ListChannelsResponse' :: ListChannelsResponse -> Int
$sel:nextToken:ListChannelsResponse' :: ListChannelsResponse -> Maybe (Sensitive Text)
$sel:channels:ListChannelsResponse' :: ListChannelsResponse -> Maybe [ChannelSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [ChannelSummary]
channels
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