{-# 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.ListChannelMemberships
-- 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 channel memberships in a channel.
--
-- 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.ListChannelMemberships
  ( -- * Creating a Request
    ListChannelMemberships (..),
    newListChannelMemberships,

    -- * Request Lenses
    listChannelMemberships_chimeBearer,
    listChannelMemberships_nextToken,
    listChannelMemberships_type,
    listChannelMemberships_maxResults,
    listChannelMemberships_channelArn,

    -- * Destructuring the Response
    ListChannelMembershipsResponse (..),
    newListChannelMembershipsResponse,

    -- * Response Lenses
    listChannelMembershipsResponse_channelMemberships,
    listChannelMembershipsResponse_channelArn,
    listChannelMembershipsResponse_nextToken,
    listChannelMembershipsResponse_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:/ 'newListChannelMemberships' smart constructor.
data ListChannelMemberships = ListChannelMemberships'
  { -- | The @AppInstanceUserArn@ of the user that makes the API call.
    ListChannelMemberships -> Maybe Text
chimeBearer :: Prelude.Maybe Prelude.Text,
    -- | The token passed by previous API calls until all requested channel
    -- memberships are returned.
    ListChannelMemberships -> Maybe (Sensitive Text)
nextToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The membership type of a user, @DEFAULT@ or @HIDDEN@. Default members
    -- are always returned as part of @ListChannelMemberships@. Hidden members
    -- are only returned if the type filter in @ListChannelMemberships@ equals
    -- @HIDDEN@. Otherwise hidden members are not returned.
    ListChannelMemberships -> Maybe ChannelMembershipType
type' :: Prelude.Maybe ChannelMembershipType,
    -- | The maximum number of channel memberships that you want returned.
    ListChannelMemberships -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The maximum number of channel memberships that you want returned.
    ListChannelMemberships -> Text
channelArn :: Prelude.Text
  }
  deriving (ListChannelMemberships -> ListChannelMemberships -> Bool
(ListChannelMemberships -> ListChannelMemberships -> Bool)
-> (ListChannelMemberships -> ListChannelMemberships -> Bool)
-> Eq ListChannelMemberships
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListChannelMemberships -> ListChannelMemberships -> Bool
$c/= :: ListChannelMemberships -> ListChannelMemberships -> Bool
== :: ListChannelMemberships -> ListChannelMemberships -> Bool
$c== :: ListChannelMemberships -> ListChannelMemberships -> Bool
Prelude.Eq, Int -> ListChannelMemberships -> ShowS
[ListChannelMemberships] -> ShowS
ListChannelMemberships -> String
(Int -> ListChannelMemberships -> ShowS)
-> (ListChannelMemberships -> String)
-> ([ListChannelMemberships] -> ShowS)
-> Show ListChannelMemberships
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListChannelMemberships] -> ShowS
$cshowList :: [ListChannelMemberships] -> ShowS
show :: ListChannelMemberships -> String
$cshow :: ListChannelMemberships -> String
showsPrec :: Int -> ListChannelMemberships -> ShowS
$cshowsPrec :: Int -> ListChannelMemberships -> ShowS
Prelude.Show, (forall x. ListChannelMemberships -> Rep ListChannelMemberships x)
-> (forall x.
    Rep ListChannelMemberships x -> ListChannelMemberships)
-> Generic ListChannelMemberships
forall x. Rep ListChannelMemberships x -> ListChannelMemberships
forall x. ListChannelMemberships -> Rep ListChannelMemberships x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListChannelMemberships x -> ListChannelMemberships
$cfrom :: forall x. ListChannelMemberships -> Rep ListChannelMemberships x
Prelude.Generic)

-- |
-- Create a value of 'ListChannelMemberships' 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:
--
-- 'chimeBearer', 'listChannelMemberships_chimeBearer' - The @AppInstanceUserArn@ of the user that makes the API call.
--
-- 'nextToken', 'listChannelMemberships_nextToken' - The token passed by previous API calls until all requested channel
-- memberships are returned.
--
-- 'type'', 'listChannelMemberships_type' - The membership type of a user, @DEFAULT@ or @HIDDEN@. Default members
-- are always returned as part of @ListChannelMemberships@. Hidden members
-- are only returned if the type filter in @ListChannelMemberships@ equals
-- @HIDDEN@. Otherwise hidden members are not returned.
--
-- 'maxResults', 'listChannelMemberships_maxResults' - The maximum number of channel memberships that you want returned.
--
-- 'channelArn', 'listChannelMemberships_channelArn' - The maximum number of channel memberships that you want returned.
newListChannelMemberships ::
  -- | 'channelArn'
  Prelude.Text ->
  ListChannelMemberships
newListChannelMemberships :: Text -> ListChannelMemberships
newListChannelMemberships Text
pChannelArn_ =
  ListChannelMemberships' :: Maybe Text
-> Maybe (Sensitive Text)
-> Maybe ChannelMembershipType
-> Maybe Natural
-> Text
-> ListChannelMemberships
ListChannelMemberships'
    { $sel:chimeBearer:ListChannelMemberships' :: Maybe Text
chimeBearer =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListChannelMemberships' :: Maybe (Sensitive Text)
nextToken = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:type':ListChannelMemberships' :: Maybe ChannelMembershipType
type' = Maybe ChannelMembershipType
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListChannelMemberships' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:channelArn:ListChannelMemberships' :: Text
channelArn = Text
pChannelArn_
    }

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

-- | The token passed by previous API calls until all requested channel
-- memberships are returned.
listChannelMemberships_nextToken :: Lens.Lens' ListChannelMemberships (Prelude.Maybe Prelude.Text)
listChannelMemberships_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListChannelMemberships -> f ListChannelMemberships
listChannelMemberships_nextToken = (ListChannelMemberships -> Maybe (Sensitive Text))
-> (ListChannelMemberships
    -> Maybe (Sensitive Text) -> ListChannelMemberships)
-> Lens
     ListChannelMemberships
     ListChannelMemberships
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelMemberships' {Maybe (Sensitive Text)
nextToken :: Maybe (Sensitive Text)
$sel:nextToken:ListChannelMemberships' :: ListChannelMemberships -> Maybe (Sensitive Text)
nextToken} -> Maybe (Sensitive Text)
nextToken) (\s :: ListChannelMemberships
s@ListChannelMemberships' {} Maybe (Sensitive Text)
a -> ListChannelMemberships
s {$sel:nextToken:ListChannelMemberships' :: Maybe (Sensitive Text)
nextToken = Maybe (Sensitive Text)
a} :: ListChannelMemberships) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> ListChannelMemberships -> f ListChannelMemberships)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ListChannelMemberships
-> f ListChannelMemberships
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 membership type of a user, @DEFAULT@ or @HIDDEN@. Default members
-- are always returned as part of @ListChannelMemberships@. Hidden members
-- are only returned if the type filter in @ListChannelMemberships@ equals
-- @HIDDEN@. Otherwise hidden members are not returned.
listChannelMemberships_type :: Lens.Lens' ListChannelMemberships (Prelude.Maybe ChannelMembershipType)
listChannelMemberships_type :: (Maybe ChannelMembershipType -> f (Maybe ChannelMembershipType))
-> ListChannelMemberships -> f ListChannelMemberships
listChannelMemberships_type = (ListChannelMemberships -> Maybe ChannelMembershipType)
-> (ListChannelMemberships
    -> Maybe ChannelMembershipType -> ListChannelMemberships)
-> Lens
     ListChannelMemberships
     ListChannelMemberships
     (Maybe ChannelMembershipType)
     (Maybe ChannelMembershipType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelMemberships' {Maybe ChannelMembershipType
type' :: Maybe ChannelMembershipType
$sel:type':ListChannelMemberships' :: ListChannelMemberships -> Maybe ChannelMembershipType
type'} -> Maybe ChannelMembershipType
type') (\s :: ListChannelMemberships
s@ListChannelMemberships' {} Maybe ChannelMembershipType
a -> ListChannelMemberships
s {$sel:type':ListChannelMemberships' :: Maybe ChannelMembershipType
type' = Maybe ChannelMembershipType
a} :: ListChannelMemberships)

-- | The maximum number of channel memberships that you want returned.
listChannelMemberships_maxResults :: Lens.Lens' ListChannelMemberships (Prelude.Maybe Prelude.Natural)
listChannelMemberships_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListChannelMemberships -> f ListChannelMemberships
listChannelMemberships_maxResults = (ListChannelMemberships -> Maybe Natural)
-> (ListChannelMemberships
    -> Maybe Natural -> ListChannelMemberships)
-> Lens
     ListChannelMemberships
     ListChannelMemberships
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelMemberships' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListChannelMemberships' :: ListChannelMemberships -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListChannelMemberships
s@ListChannelMemberships' {} Maybe Natural
a -> ListChannelMemberships
s {$sel:maxResults:ListChannelMemberships' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListChannelMemberships)

-- | The maximum number of channel memberships that you want returned.
listChannelMemberships_channelArn :: Lens.Lens' ListChannelMemberships Prelude.Text
listChannelMemberships_channelArn :: (Text -> f Text)
-> ListChannelMemberships -> f ListChannelMemberships
listChannelMemberships_channelArn = (ListChannelMemberships -> Text)
-> (ListChannelMemberships -> Text -> ListChannelMemberships)
-> Lens ListChannelMemberships ListChannelMemberships Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelMemberships' {Text
channelArn :: Text
$sel:channelArn:ListChannelMemberships' :: ListChannelMemberships -> Text
channelArn} -> Text
channelArn) (\s :: ListChannelMemberships
s@ListChannelMemberships' {} Text
a -> ListChannelMemberships
s {$sel:channelArn:ListChannelMemberships' :: Text
channelArn = Text
a} :: ListChannelMemberships)

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

instance Prelude.NFData ListChannelMemberships

instance Core.ToHeaders ListChannelMemberships where
  toHeaders :: ListChannelMemberships -> ResponseHeaders
toHeaders ListChannelMemberships' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Maybe ChannelMembershipType
Text
channelArn :: Text
maxResults :: Maybe Natural
type' :: Maybe ChannelMembershipType
nextToken :: Maybe (Sensitive Text)
chimeBearer :: Maybe Text
$sel:channelArn:ListChannelMemberships' :: ListChannelMemberships -> Text
$sel:maxResults:ListChannelMemberships' :: ListChannelMemberships -> Maybe Natural
$sel:type':ListChannelMemberships' :: ListChannelMemberships -> Maybe ChannelMembershipType
$sel:nextToken:ListChannelMemberships' :: ListChannelMemberships -> Maybe (Sensitive Text)
$sel:chimeBearer:ListChannelMemberships' :: ListChannelMemberships -> 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 ListChannelMemberships where
  toPath :: ListChannelMemberships -> ByteString
toPath ListChannelMemberships' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Maybe ChannelMembershipType
Text
channelArn :: Text
maxResults :: Maybe Natural
type' :: Maybe ChannelMembershipType
nextToken :: Maybe (Sensitive Text)
chimeBearer :: Maybe Text
$sel:channelArn:ListChannelMemberships' :: ListChannelMemberships -> Text
$sel:maxResults:ListChannelMemberships' :: ListChannelMemberships -> Maybe Natural
$sel:type':ListChannelMemberships' :: ListChannelMemberships -> Maybe ChannelMembershipType
$sel:nextToken:ListChannelMemberships' :: ListChannelMemberships -> Maybe (Sensitive Text)
$sel:chimeBearer:ListChannelMemberships' :: ListChannelMemberships -> 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
"/memberships"]

instance Core.ToQuery ListChannelMemberships where
  toQuery :: ListChannelMemberships -> QueryString
toQuery ListChannelMemberships' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Maybe ChannelMembershipType
Text
channelArn :: Text
maxResults :: Maybe Natural
type' :: Maybe ChannelMembershipType
nextToken :: Maybe (Sensitive Text)
chimeBearer :: Maybe Text
$sel:channelArn:ListChannelMemberships' :: ListChannelMemberships -> Text
$sel:maxResults:ListChannelMemberships' :: ListChannelMemberships -> Maybe Natural
$sel:type':ListChannelMemberships' :: ListChannelMemberships -> Maybe ChannelMembershipType
$sel:nextToken:ListChannelMemberships' :: ListChannelMemberships -> Maybe (Sensitive Text)
$sel:chimeBearer:ListChannelMemberships' :: ListChannelMemberships -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"next-token" ByteString -> Maybe (Sensitive Text) -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe (Sensitive Text)
nextToken,
        ByteString
"type" ByteString -> Maybe ChannelMembershipType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ChannelMembershipType
type',
        ByteString
"max-results" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListChannelMembershipsResponse' smart constructor.
data ListChannelMembershipsResponse = ListChannelMembershipsResponse'
  { -- | The information for the requested channel memberships.
    ListChannelMembershipsResponse -> Maybe [ChannelMembershipSummary]
channelMemberships :: Prelude.Maybe [ChannelMembershipSummary],
    -- | The ARN of the channel.
    ListChannelMembershipsResponse -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
    -- | The token passed by previous API calls until all requested channel
    -- memberships are returned.
    ListChannelMembershipsResponse -> Maybe (Sensitive Text)
nextToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The response's http status code.
    ListChannelMembershipsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListChannelMembershipsResponse
-> ListChannelMembershipsResponse -> Bool
(ListChannelMembershipsResponse
 -> ListChannelMembershipsResponse -> Bool)
-> (ListChannelMembershipsResponse
    -> ListChannelMembershipsResponse -> Bool)
-> Eq ListChannelMembershipsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListChannelMembershipsResponse
-> ListChannelMembershipsResponse -> Bool
$c/= :: ListChannelMembershipsResponse
-> ListChannelMembershipsResponse -> Bool
== :: ListChannelMembershipsResponse
-> ListChannelMembershipsResponse -> Bool
$c== :: ListChannelMembershipsResponse
-> ListChannelMembershipsResponse -> Bool
Prelude.Eq, Int -> ListChannelMembershipsResponse -> ShowS
[ListChannelMembershipsResponse] -> ShowS
ListChannelMembershipsResponse -> String
(Int -> ListChannelMembershipsResponse -> ShowS)
-> (ListChannelMembershipsResponse -> String)
-> ([ListChannelMembershipsResponse] -> ShowS)
-> Show ListChannelMembershipsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListChannelMembershipsResponse] -> ShowS
$cshowList :: [ListChannelMembershipsResponse] -> ShowS
show :: ListChannelMembershipsResponse -> String
$cshow :: ListChannelMembershipsResponse -> String
showsPrec :: Int -> ListChannelMembershipsResponse -> ShowS
$cshowsPrec :: Int -> ListChannelMembershipsResponse -> ShowS
Prelude.Show, (forall x.
 ListChannelMembershipsResponse
 -> Rep ListChannelMembershipsResponse x)
-> (forall x.
    Rep ListChannelMembershipsResponse x
    -> ListChannelMembershipsResponse)
-> Generic ListChannelMembershipsResponse
forall x.
Rep ListChannelMembershipsResponse x
-> ListChannelMembershipsResponse
forall x.
ListChannelMembershipsResponse
-> Rep ListChannelMembershipsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListChannelMembershipsResponse x
-> ListChannelMembershipsResponse
$cfrom :: forall x.
ListChannelMembershipsResponse
-> Rep ListChannelMembershipsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListChannelMembershipsResponse' 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:
--
-- 'channelMemberships', 'listChannelMembershipsResponse_channelMemberships' - The information for the requested channel memberships.
--
-- 'channelArn', 'listChannelMembershipsResponse_channelArn' - The ARN of the channel.
--
-- 'nextToken', 'listChannelMembershipsResponse_nextToken' - The token passed by previous API calls until all requested channel
-- memberships are returned.
--
-- 'httpStatus', 'listChannelMembershipsResponse_httpStatus' - The response's http status code.
newListChannelMembershipsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListChannelMembershipsResponse
newListChannelMembershipsResponse :: Int -> ListChannelMembershipsResponse
newListChannelMembershipsResponse Int
pHttpStatus_ =
  ListChannelMembershipsResponse' :: Maybe [ChannelMembershipSummary]
-> Maybe Text
-> Maybe (Sensitive Text)
-> Int
-> ListChannelMembershipsResponse
ListChannelMembershipsResponse'
    { $sel:channelMemberships:ListChannelMembershipsResponse' :: Maybe [ChannelMembershipSummary]
channelMemberships =
        Maybe [ChannelMembershipSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:channelArn:ListChannelMembershipsResponse' :: Maybe Text
channelArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListChannelMembershipsResponse' :: Maybe (Sensitive Text)
nextToken = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListChannelMembershipsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The information for the requested channel memberships.
listChannelMembershipsResponse_channelMemberships :: Lens.Lens' ListChannelMembershipsResponse (Prelude.Maybe [ChannelMembershipSummary])
listChannelMembershipsResponse_channelMemberships :: (Maybe [ChannelMembershipSummary]
 -> f (Maybe [ChannelMembershipSummary]))
-> ListChannelMembershipsResponse
-> f ListChannelMembershipsResponse
listChannelMembershipsResponse_channelMemberships = (ListChannelMembershipsResponse
 -> Maybe [ChannelMembershipSummary])
-> (ListChannelMembershipsResponse
    -> Maybe [ChannelMembershipSummary]
    -> ListChannelMembershipsResponse)
-> Lens
     ListChannelMembershipsResponse
     ListChannelMembershipsResponse
     (Maybe [ChannelMembershipSummary])
     (Maybe [ChannelMembershipSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelMembershipsResponse' {Maybe [ChannelMembershipSummary]
channelMemberships :: Maybe [ChannelMembershipSummary]
$sel:channelMemberships:ListChannelMembershipsResponse' :: ListChannelMembershipsResponse -> Maybe [ChannelMembershipSummary]
channelMemberships} -> Maybe [ChannelMembershipSummary]
channelMemberships) (\s :: ListChannelMembershipsResponse
s@ListChannelMembershipsResponse' {} Maybe [ChannelMembershipSummary]
a -> ListChannelMembershipsResponse
s {$sel:channelMemberships:ListChannelMembershipsResponse' :: Maybe [ChannelMembershipSummary]
channelMemberships = Maybe [ChannelMembershipSummary]
a} :: ListChannelMembershipsResponse) ((Maybe [ChannelMembershipSummary]
  -> f (Maybe [ChannelMembershipSummary]))
 -> ListChannelMembershipsResponse
 -> f ListChannelMembershipsResponse)
-> ((Maybe [ChannelMembershipSummary]
     -> f (Maybe [ChannelMembershipSummary]))
    -> Maybe [ChannelMembershipSummary]
    -> f (Maybe [ChannelMembershipSummary]))
-> (Maybe [ChannelMembershipSummary]
    -> f (Maybe [ChannelMembershipSummary]))
-> ListChannelMembershipsResponse
-> f ListChannelMembershipsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ChannelMembershipSummary]
  [ChannelMembershipSummary]
  [ChannelMembershipSummary]
  [ChannelMembershipSummary]
-> Iso
     (Maybe [ChannelMembershipSummary])
     (Maybe [ChannelMembershipSummary])
     (Maybe [ChannelMembershipSummary])
     (Maybe [ChannelMembershipSummary])
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
  [ChannelMembershipSummary]
  [ChannelMembershipSummary]
  [ChannelMembershipSummary]
  [ChannelMembershipSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ARN of the channel.
listChannelMembershipsResponse_channelArn :: Lens.Lens' ListChannelMembershipsResponse (Prelude.Maybe Prelude.Text)
listChannelMembershipsResponse_channelArn :: (Maybe Text -> f (Maybe Text))
-> ListChannelMembershipsResponse
-> f ListChannelMembershipsResponse
listChannelMembershipsResponse_channelArn = (ListChannelMembershipsResponse -> Maybe Text)
-> (ListChannelMembershipsResponse
    -> Maybe Text -> ListChannelMembershipsResponse)
-> Lens
     ListChannelMembershipsResponse
     ListChannelMembershipsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelMembershipsResponse' {Maybe Text
channelArn :: Maybe Text
$sel:channelArn:ListChannelMembershipsResponse' :: ListChannelMembershipsResponse -> Maybe Text
channelArn} -> Maybe Text
channelArn) (\s :: ListChannelMembershipsResponse
s@ListChannelMembershipsResponse' {} Maybe Text
a -> ListChannelMembershipsResponse
s {$sel:channelArn:ListChannelMembershipsResponse' :: Maybe Text
channelArn = Maybe Text
a} :: ListChannelMembershipsResponse)

-- | The token passed by previous API calls until all requested channel
-- memberships are returned.
listChannelMembershipsResponse_nextToken :: Lens.Lens' ListChannelMembershipsResponse (Prelude.Maybe Prelude.Text)
listChannelMembershipsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListChannelMembershipsResponse
-> f ListChannelMembershipsResponse
listChannelMembershipsResponse_nextToken = (ListChannelMembershipsResponse -> Maybe (Sensitive Text))
-> (ListChannelMembershipsResponse
    -> Maybe (Sensitive Text) -> ListChannelMembershipsResponse)
-> Lens
     ListChannelMembershipsResponse
     ListChannelMembershipsResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelMembershipsResponse' {Maybe (Sensitive Text)
nextToken :: Maybe (Sensitive Text)
$sel:nextToken:ListChannelMembershipsResponse' :: ListChannelMembershipsResponse -> Maybe (Sensitive Text)
nextToken} -> Maybe (Sensitive Text)
nextToken) (\s :: ListChannelMembershipsResponse
s@ListChannelMembershipsResponse' {} Maybe (Sensitive Text)
a -> ListChannelMembershipsResponse
s {$sel:nextToken:ListChannelMembershipsResponse' :: Maybe (Sensitive Text)
nextToken = Maybe (Sensitive Text)
a} :: ListChannelMembershipsResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> ListChannelMembershipsResponse
 -> f ListChannelMembershipsResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ListChannelMembershipsResponse
-> f ListChannelMembershipsResponse
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.
listChannelMembershipsResponse_httpStatus :: Lens.Lens' ListChannelMembershipsResponse Prelude.Int
listChannelMembershipsResponse_httpStatus :: (Int -> f Int)
-> ListChannelMembershipsResponse
-> f ListChannelMembershipsResponse
listChannelMembershipsResponse_httpStatus = (ListChannelMembershipsResponse -> Int)
-> (ListChannelMembershipsResponse
    -> Int -> ListChannelMembershipsResponse)
-> Lens
     ListChannelMembershipsResponse
     ListChannelMembershipsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListChannelMembershipsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListChannelMembershipsResponse' :: ListChannelMembershipsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListChannelMembershipsResponse
s@ListChannelMembershipsResponse' {} Int
a -> ListChannelMembershipsResponse
s {$sel:httpStatus:ListChannelMembershipsResponse' :: Int
httpStatus = Int
a} :: ListChannelMembershipsResponse)

instance
  Prelude.NFData
    ListChannelMembershipsResponse