{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Chime.ListChannels
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists all Channels created under a single Chime App as a paginated list.
-- You can specify filters to narrow results.
--
-- __Functionality & restrictions__
--
-- -   Use privacy = @PUBLIC@ to retrieve all public channels in the
--     account.
--
-- -   Only an @AppInstanceAdmin@ can set privacy = @PRIVATE@ to list the
--     private channels in an account.
--
-- The @x-amz-chime-bearer@ request header is mandatory. Use the
-- @AppInstanceUserArn@ of the user that makes the API call as the value in
-- the header.
module Amazonka.Chime.ListChannels
  ( -- * Creating a Request
    ListChannels (..),
    newListChannels,

    -- * Request Lenses
    listChannels_privacy,
    listChannels_chimeBearer,
    listChannels_nextToken,
    listChannels_maxResults,
    listChannels_appInstanceArn,

    -- * Destructuring the Response
    ListChannelsResponse (..),
    newListChannelsResponse,

    -- * Response Lenses
    listChannelsResponse_channels,
    listChannelsResponse_nextToken,
    listChannelsResponse_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

-- | /See:/ 'newListChannels' smart constructor.
data ListChannels = ListChannels'
  { -- | The privacy setting. @PUBLIC@ retrieves all the public channels.
    -- @PRIVATE@ retrieves private channels. Only an @AppInstanceAdmin@ can
    -- retrieve private channels.
    ListChannels -> Maybe ChannelPrivacy
privacy :: Prelude.Maybe ChannelPrivacy,
    -- | The @AppInstanceUserArn@ of the user that makes the API call.
    ListChannels -> Maybe Text
chimeBearer :: Prelude.Maybe Prelude.Text,
    -- | The token passed by previous API calls until all requested channels are
    -- returned.
    ListChannels -> Maybe (Sensitive Text)
nextToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The maximum number of channels that you want to return.
    ListChannels -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The ARN of the @AppInstance@.
    ListChannels -> Text
appInstanceArn :: Prelude.Text
  }
  deriving (ListChannels -> ListChannels -> Bool
(ListChannels -> ListChannels -> Bool)
-> (ListChannels -> ListChannels -> Bool) -> Eq ListChannels
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
(Int -> ListChannels -> ShowS)
-> (ListChannels -> String)
-> ([ListChannels] -> ShowS)
-> Show ListChannels
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. ListChannels -> Rep ListChannels x)
-> (forall x. Rep ListChannels x -> ListChannels)
-> Generic ListChannels
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)

-- |
-- Create a value of 'ListChannels' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'privacy', 'listChannels_privacy' - The privacy setting. @PUBLIC@ retrieves all the public channels.
-- @PRIVATE@ retrieves private channels. Only an @AppInstanceAdmin@ can
-- retrieve private channels.
--
-- 'chimeBearer', 'listChannels_chimeBearer' - The @AppInstanceUserArn@ of the user that makes the API call.
--
-- 'nextToken', 'listChannels_nextToken' - The token passed by previous API calls until all requested channels are
-- returned.
--
-- 'maxResults', 'listChannels_maxResults' - The maximum number of channels that you want to return.
--
-- 'appInstanceArn', 'listChannels_appInstanceArn' - The ARN of the @AppInstance@.
newListChannels ::
  -- | 'appInstanceArn'
  Prelude.Text ->
  ListChannels
newListChannels :: Text -> ListChannels
newListChannels Text
pAppInstanceArn_ =
  ListChannels' :: Maybe ChannelPrivacy
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Natural
-> Text
-> ListChannels
ListChannels'
    { $sel:privacy:ListChannels' :: Maybe ChannelPrivacy
privacy = Maybe ChannelPrivacy
forall a. Maybe a
Prelude.Nothing,
      $sel:chimeBearer:ListChannels' :: Maybe Text
chimeBearer = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListChannels' :: Maybe (Sensitive Text)
nextToken = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListChannels' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:appInstanceArn:ListChannels' :: Text
appInstanceArn = Text
pAppInstanceArn_
    }

-- | The privacy setting. @PUBLIC@ retrieves all the public channels.
-- @PRIVATE@ retrieves private channels. Only an @AppInstanceAdmin@ can
-- retrieve private channels.
listChannels_privacy :: Lens.Lens' ListChannels (Prelude.Maybe ChannelPrivacy)
listChannels_privacy :: (Maybe ChannelPrivacy -> f (Maybe ChannelPrivacy))
-> ListChannels -> f ListChannels
listChannels_privacy = (ListChannels -> Maybe ChannelPrivacy)
-> (ListChannels -> Maybe ChannelPrivacy -> ListChannels)
-> Lens
     ListChannels
     ListChannels
     (Maybe ChannelPrivacy)
     (Maybe ChannelPrivacy)
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)

-- | The @AppInstanceUserArn@ of the user that makes the API call.
listChannels_chimeBearer :: Lens.Lens' ListChannels (Prelude.Maybe Prelude.Text)
listChannels_chimeBearer :: (Maybe Text -> f (Maybe Text)) -> ListChannels -> f ListChannels
listChannels_chimeBearer = (ListChannels -> Maybe Text)
-> (ListChannels -> Maybe Text -> ListChannels)
-> Lens ListChannels ListChannels (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannels' {Maybe Text
chimeBearer :: Maybe Text
$sel:chimeBearer:ListChannels' :: ListChannels -> Maybe Text
chimeBearer} -> Maybe Text
chimeBearer) (\s :: ListChannels
s@ListChannels' {} Maybe Text
a -> ListChannels
s {$sel:chimeBearer:ListChannels' :: Maybe Text
chimeBearer = Maybe Text
a} :: ListChannels)

-- | The token passed by previous API calls until all requested channels are
-- returned.
listChannels_nextToken :: Lens.Lens' ListChannels (Prelude.Maybe Prelude.Text)
listChannels_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListChannels -> f ListChannels
listChannels_nextToken = (ListChannels -> Maybe (Sensitive Text))
-> (ListChannels -> Maybe (Sensitive Text) -> ListChannels)
-> Lens
     ListChannels
     ListChannels
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
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) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> ListChannels -> f ListChannels)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ListChannels
-> f ListChannels
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The maximum number of channels that you want to return.
listChannels_maxResults :: Lens.Lens' ListChannels (Prelude.Maybe Prelude.Natural)
listChannels_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListChannels -> f ListChannels
listChannels_maxResults = (ListChannels -> Maybe Natural)
-> (ListChannels -> Maybe Natural -> ListChannels)
-> Lens ListChannels ListChannels (Maybe Natural) (Maybe Natural)
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)

-- | The ARN of the @AppInstance@.
listChannels_appInstanceArn :: Lens.Lens' ListChannels Prelude.Text
listChannels_appInstanceArn :: (Text -> f Text) -> ListChannels -> f ListChannels
listChannels_appInstanceArn = (ListChannels -> Text)
-> (ListChannels -> Text -> ListChannels)
-> Lens ListChannels ListChannels Text Text
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)

instance Core.AWSRequest ListChannels where
  type AWSResponse ListChannels = ListChannelsResponse
  request :: ListChannels -> Request ListChannels
request = Service -> ListChannels -> Request ListChannels
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListChannels
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListChannels)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListChannels))
-> Logger
-> Service
-> Proxy ListChannels
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListChannels)))
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 [ChannelSummary]
-> Maybe (Sensitive Text) -> Int -> ListChannelsResponse
ListChannelsResponse'
            (Maybe [ChannelSummary]
 -> Maybe (Sensitive Text) -> Int -> ListChannelsResponse)
-> Either String (Maybe [ChannelSummary])
-> Either
     String (Maybe (Sensitive Text) -> Int -> ListChannelsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [ChannelSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Channels" Either String (Maybe (Maybe [ChannelSummary]))
-> Maybe [ChannelSummary] -> Either String (Maybe [ChannelSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ChannelSummary]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String (Maybe (Sensitive Text) -> Int -> ListChannelsResponse)
-> Either String (Maybe (Sensitive Text))
-> Either String (Int -> ListChannelsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either String (Int -> ListChannelsResponse)
-> Either String Int -> Either String ListChannelsResponse
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 ListChannels

instance Prelude.NFData ListChannels

instance Core.ToHeaders ListChannels where
  toHeaders :: ListChannels -> ResponseHeaders
toHeaders ListChannels' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Maybe ChannelPrivacy
Text
appInstanceArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe (Sensitive Text)
chimeBearer :: Maybe Text
privacy :: Maybe ChannelPrivacy
$sel:appInstanceArn:ListChannels' :: ListChannels -> Text
$sel:maxResults:ListChannels' :: ListChannels -> Maybe Natural
$sel:nextToken:ListChannels' :: ListChannels -> Maybe (Sensitive Text)
$sel:chimeBearer:ListChannels' :: ListChannels -> Maybe Text
$sel:privacy:ListChannels' :: ListChannels -> Maybe ChannelPrivacy
..} =
    [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 ListChannels where
  toPath :: ListChannels -> ByteString
toPath = ByteString -> ListChannels -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/channels"

instance Core.ToQuery ListChannels where
  toQuery :: ListChannels -> QueryString
toQuery ListChannels' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Maybe ChannelPrivacy
Text
appInstanceArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe (Sensitive Text)
chimeBearer :: Maybe Text
privacy :: Maybe ChannelPrivacy
$sel:appInstanceArn:ListChannels' :: ListChannels -> Text
$sel:maxResults:ListChannels' :: ListChannels -> Maybe Natural
$sel:nextToken:ListChannels' :: ListChannels -> Maybe (Sensitive Text)
$sel:chimeBearer:ListChannels' :: ListChannels -> Maybe Text
$sel:privacy:ListChannels' :: ListChannels -> Maybe ChannelPrivacy
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"privacy" ByteString -> Maybe ChannelPrivacy -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ChannelPrivacy
privacy,
        ByteString
"next-token" ByteString -> Maybe (Sensitive Text) -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe (Sensitive Text)
nextToken,
        ByteString
"max-results" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults,
        ByteString
"app-instance-arn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
appInstanceArn
      ]

-- | /See:/ 'newListChannelsResponse' smart constructor.
data ListChannelsResponse = ListChannelsResponse'
  { -- | The information about each channel.
    ListChannelsResponse -> Maybe [ChannelSummary]
channels :: Prelude.Maybe [ChannelSummary],
    -- | The token returned from previous API requests until the number of
    -- channels is reached.
    ListChannelsResponse -> Maybe (Sensitive Text)
nextToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The response's http status code.
    ListChannelsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListChannelsResponse -> ListChannelsResponse -> Bool
(ListChannelsResponse -> ListChannelsResponse -> Bool)
-> (ListChannelsResponse -> ListChannelsResponse -> Bool)
-> Eq ListChannelsResponse
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
(Int -> ListChannelsResponse -> ShowS)
-> (ListChannelsResponse -> String)
-> ([ListChannelsResponse] -> ShowS)
-> Show ListChannelsResponse
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. ListChannelsResponse -> Rep ListChannelsResponse x)
-> (forall x. Rep ListChannelsResponse x -> ListChannelsResponse)
-> Generic ListChannelsResponse
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)

-- |
-- Create a value of 'ListChannelsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'channels', 'listChannelsResponse_channels' - The information about each channel.
--
-- 'nextToken', 'listChannelsResponse_nextToken' - The token returned from previous API requests until the number of
-- channels is reached.
--
-- 'httpStatus', 'listChannelsResponse_httpStatus' - The response's http status code.
newListChannelsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListChannelsResponse
newListChannelsResponse :: Int -> ListChannelsResponse
newListChannelsResponse Int
pHttpStatus_ =
  ListChannelsResponse' :: Maybe [ChannelSummary]
-> Maybe (Sensitive Text) -> Int -> ListChannelsResponse
ListChannelsResponse'
    { $sel:channels:ListChannelsResponse' :: Maybe [ChannelSummary]
channels = Maybe [ChannelSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListChannelsResponse' :: Maybe (Sensitive Text)
nextToken = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListChannelsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The information about each channel.
listChannelsResponse_channels :: Lens.Lens' ListChannelsResponse (Prelude.Maybe [ChannelSummary])
listChannelsResponse_channels :: (Maybe [ChannelSummary] -> f (Maybe [ChannelSummary]))
-> ListChannelsResponse -> f ListChannelsResponse
listChannelsResponse_channels = (ListChannelsResponse -> Maybe [ChannelSummary])
-> (ListChannelsResponse
    -> Maybe [ChannelSummary] -> ListChannelsResponse)
-> Lens
     ListChannelsResponse
     ListChannelsResponse
     (Maybe [ChannelSummary])
     (Maybe [ChannelSummary])
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) ((Maybe [ChannelSummary] -> f (Maybe [ChannelSummary]))
 -> ListChannelsResponse -> f ListChannelsResponse)
-> ((Maybe [ChannelSummary] -> f (Maybe [ChannelSummary]))
    -> Maybe [ChannelSummary] -> f (Maybe [ChannelSummary]))
-> (Maybe [ChannelSummary] -> f (Maybe [ChannelSummary]))
-> ListChannelsResponse
-> f ListChannelsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ChannelSummary] [ChannelSummary] [ChannelSummary] [ChannelSummary]
-> Iso
     (Maybe [ChannelSummary])
     (Maybe [ChannelSummary])
     (Maybe [ChannelSummary])
     (Maybe [ChannelSummary])
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 AnIso
  [ChannelSummary] [ChannelSummary] [ChannelSummary] [ChannelSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token returned from previous API requests until the number of
-- channels is reached.
listChannelsResponse_nextToken :: Lens.Lens' ListChannelsResponse (Prelude.Maybe Prelude.Text)
listChannelsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListChannelsResponse -> f ListChannelsResponse
listChannelsResponse_nextToken = (ListChannelsResponse -> Maybe (Sensitive Text))
-> (ListChannelsResponse
    -> Maybe (Sensitive Text) -> ListChannelsResponse)
-> Lens
     ListChannelsResponse
     ListChannelsResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
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) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> ListChannelsResponse -> f ListChannelsResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ListChannelsResponse
-> f ListChannelsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The response's http status code.
listChannelsResponse_httpStatus :: Lens.Lens' ListChannelsResponse Prelude.Int
listChannelsResponse_httpStatus :: (Int -> f Int) -> ListChannelsResponse -> f ListChannelsResponse
listChannelsResponse_httpStatus = (ListChannelsResponse -> Int)
-> (ListChannelsResponse -> Int -> ListChannelsResponse)
-> Lens ListChannelsResponse ListChannelsResponse Int Int
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