{-# 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.ChimeSDKMessaging.DescribeChannelMembershipForAppInstanceUser
-- 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)
--
-- Returns the details of a channel based on the membership of the
-- specified @AppInstanceUser@.
--
-- 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.ChimeSDKMessaging.DescribeChannelMembershipForAppInstanceUser
  ( -- * Creating a Request
    DescribeChannelMembershipForAppInstanceUser (..),
    newDescribeChannelMembershipForAppInstanceUser,

    -- * Request Lenses
    describeChannelMembershipForAppInstanceUser_channelArn,
    describeChannelMembershipForAppInstanceUser_appInstanceUserArn,
    describeChannelMembershipForAppInstanceUser_chimeBearer,

    -- * Destructuring the Response
    DescribeChannelMembershipForAppInstanceUserResponse (..),
    newDescribeChannelMembershipForAppInstanceUserResponse,

    -- * Response Lenses
    describeChannelMembershipForAppInstanceUserResponse_channelMembership,
    describeChannelMembershipForAppInstanceUserResponse_httpStatus,
  )
where

import Amazonka.ChimeSDKMessaging.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:/ 'newDescribeChannelMembershipForAppInstanceUser' smart constructor.
data DescribeChannelMembershipForAppInstanceUser = DescribeChannelMembershipForAppInstanceUser'
  { -- | The ARN of the channel to which the user belongs.
    DescribeChannelMembershipForAppInstanceUser -> Text
channelArn :: Prelude.Text,
    -- | The ARN of the user in a channel.
    DescribeChannelMembershipForAppInstanceUser -> Text
appInstanceUserArn :: Prelude.Text,
    -- | The @AppInstanceUserArn@ of the user that makes the API call.
    DescribeChannelMembershipForAppInstanceUser -> Text
chimeBearer :: Prelude.Text
  }
  deriving (DescribeChannelMembershipForAppInstanceUser
-> DescribeChannelMembershipForAppInstanceUser -> Bool
(DescribeChannelMembershipForAppInstanceUser
 -> DescribeChannelMembershipForAppInstanceUser -> Bool)
-> (DescribeChannelMembershipForAppInstanceUser
    -> DescribeChannelMembershipForAppInstanceUser -> Bool)
-> Eq DescribeChannelMembershipForAppInstanceUser
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeChannelMembershipForAppInstanceUser
-> DescribeChannelMembershipForAppInstanceUser -> Bool
$c/= :: DescribeChannelMembershipForAppInstanceUser
-> DescribeChannelMembershipForAppInstanceUser -> Bool
== :: DescribeChannelMembershipForAppInstanceUser
-> DescribeChannelMembershipForAppInstanceUser -> Bool
$c== :: DescribeChannelMembershipForAppInstanceUser
-> DescribeChannelMembershipForAppInstanceUser -> Bool
Prelude.Eq, ReadPrec [DescribeChannelMembershipForAppInstanceUser]
ReadPrec DescribeChannelMembershipForAppInstanceUser
Int -> ReadS DescribeChannelMembershipForAppInstanceUser
ReadS [DescribeChannelMembershipForAppInstanceUser]
(Int -> ReadS DescribeChannelMembershipForAppInstanceUser)
-> ReadS [DescribeChannelMembershipForAppInstanceUser]
-> ReadPrec DescribeChannelMembershipForAppInstanceUser
-> ReadPrec [DescribeChannelMembershipForAppInstanceUser]
-> Read DescribeChannelMembershipForAppInstanceUser
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeChannelMembershipForAppInstanceUser]
$creadListPrec :: ReadPrec [DescribeChannelMembershipForAppInstanceUser]
readPrec :: ReadPrec DescribeChannelMembershipForAppInstanceUser
$creadPrec :: ReadPrec DescribeChannelMembershipForAppInstanceUser
readList :: ReadS [DescribeChannelMembershipForAppInstanceUser]
$creadList :: ReadS [DescribeChannelMembershipForAppInstanceUser]
readsPrec :: Int -> ReadS DescribeChannelMembershipForAppInstanceUser
$creadsPrec :: Int -> ReadS DescribeChannelMembershipForAppInstanceUser
Prelude.Read, Int -> DescribeChannelMembershipForAppInstanceUser -> ShowS
[DescribeChannelMembershipForAppInstanceUser] -> ShowS
DescribeChannelMembershipForAppInstanceUser -> String
(Int -> DescribeChannelMembershipForAppInstanceUser -> ShowS)
-> (DescribeChannelMembershipForAppInstanceUser -> String)
-> ([DescribeChannelMembershipForAppInstanceUser] -> ShowS)
-> Show DescribeChannelMembershipForAppInstanceUser
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeChannelMembershipForAppInstanceUser] -> ShowS
$cshowList :: [DescribeChannelMembershipForAppInstanceUser] -> ShowS
show :: DescribeChannelMembershipForAppInstanceUser -> String
$cshow :: DescribeChannelMembershipForAppInstanceUser -> String
showsPrec :: Int -> DescribeChannelMembershipForAppInstanceUser -> ShowS
$cshowsPrec :: Int -> DescribeChannelMembershipForAppInstanceUser -> ShowS
Prelude.Show, (forall x.
 DescribeChannelMembershipForAppInstanceUser
 -> Rep DescribeChannelMembershipForAppInstanceUser x)
-> (forall x.
    Rep DescribeChannelMembershipForAppInstanceUser x
    -> DescribeChannelMembershipForAppInstanceUser)
-> Generic DescribeChannelMembershipForAppInstanceUser
forall x.
Rep DescribeChannelMembershipForAppInstanceUser x
-> DescribeChannelMembershipForAppInstanceUser
forall x.
DescribeChannelMembershipForAppInstanceUser
-> Rep DescribeChannelMembershipForAppInstanceUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeChannelMembershipForAppInstanceUser x
-> DescribeChannelMembershipForAppInstanceUser
$cfrom :: forall x.
DescribeChannelMembershipForAppInstanceUser
-> Rep DescribeChannelMembershipForAppInstanceUser x
Prelude.Generic)

-- |
-- Create a value of 'DescribeChannelMembershipForAppInstanceUser' 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:
--
-- 'channelArn', 'describeChannelMembershipForAppInstanceUser_channelArn' - The ARN of the channel to which the user belongs.
--
-- 'appInstanceUserArn', 'describeChannelMembershipForAppInstanceUser_appInstanceUserArn' - The ARN of the user in a channel.
--
-- 'chimeBearer', 'describeChannelMembershipForAppInstanceUser_chimeBearer' - The @AppInstanceUserArn@ of the user that makes the API call.
newDescribeChannelMembershipForAppInstanceUser ::
  -- | 'channelArn'
  Prelude.Text ->
  -- | 'appInstanceUserArn'
  Prelude.Text ->
  -- | 'chimeBearer'
  Prelude.Text ->
  DescribeChannelMembershipForAppInstanceUser
newDescribeChannelMembershipForAppInstanceUser :: Text -> Text -> Text -> DescribeChannelMembershipForAppInstanceUser
newDescribeChannelMembershipForAppInstanceUser
  Text
pChannelArn_
  Text
pAppInstanceUserArn_
  Text
pChimeBearer_ =
    DescribeChannelMembershipForAppInstanceUser' :: Text -> Text -> Text -> DescribeChannelMembershipForAppInstanceUser
DescribeChannelMembershipForAppInstanceUser'
      { $sel:channelArn:DescribeChannelMembershipForAppInstanceUser' :: Text
channelArn =
          Text
pChannelArn_,
        $sel:appInstanceUserArn:DescribeChannelMembershipForAppInstanceUser' :: Text
appInstanceUserArn =
          Text
pAppInstanceUserArn_,
        $sel:chimeBearer:DescribeChannelMembershipForAppInstanceUser' :: Text
chimeBearer = Text
pChimeBearer_
      }

-- | The ARN of the channel to which the user belongs.
describeChannelMembershipForAppInstanceUser_channelArn :: Lens.Lens' DescribeChannelMembershipForAppInstanceUser Prelude.Text
describeChannelMembershipForAppInstanceUser_channelArn :: (Text -> f Text)
-> DescribeChannelMembershipForAppInstanceUser
-> f DescribeChannelMembershipForAppInstanceUser
describeChannelMembershipForAppInstanceUser_channelArn = (DescribeChannelMembershipForAppInstanceUser -> Text)
-> (DescribeChannelMembershipForAppInstanceUser
    -> Text -> DescribeChannelMembershipForAppInstanceUser)
-> Lens
     DescribeChannelMembershipForAppInstanceUser
     DescribeChannelMembershipForAppInstanceUser
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelMembershipForAppInstanceUser' {Text
channelArn :: Text
$sel:channelArn:DescribeChannelMembershipForAppInstanceUser' :: DescribeChannelMembershipForAppInstanceUser -> Text
channelArn} -> Text
channelArn) (\s :: DescribeChannelMembershipForAppInstanceUser
s@DescribeChannelMembershipForAppInstanceUser' {} Text
a -> DescribeChannelMembershipForAppInstanceUser
s {$sel:channelArn:DescribeChannelMembershipForAppInstanceUser' :: Text
channelArn = Text
a} :: DescribeChannelMembershipForAppInstanceUser)

-- | The ARN of the user in a channel.
describeChannelMembershipForAppInstanceUser_appInstanceUserArn :: Lens.Lens' DescribeChannelMembershipForAppInstanceUser Prelude.Text
describeChannelMembershipForAppInstanceUser_appInstanceUserArn :: (Text -> f Text)
-> DescribeChannelMembershipForAppInstanceUser
-> f DescribeChannelMembershipForAppInstanceUser
describeChannelMembershipForAppInstanceUser_appInstanceUserArn = (DescribeChannelMembershipForAppInstanceUser -> Text)
-> (DescribeChannelMembershipForAppInstanceUser
    -> Text -> DescribeChannelMembershipForAppInstanceUser)
-> Lens
     DescribeChannelMembershipForAppInstanceUser
     DescribeChannelMembershipForAppInstanceUser
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelMembershipForAppInstanceUser' {Text
appInstanceUserArn :: Text
$sel:appInstanceUserArn:DescribeChannelMembershipForAppInstanceUser' :: DescribeChannelMembershipForAppInstanceUser -> Text
appInstanceUserArn} -> Text
appInstanceUserArn) (\s :: DescribeChannelMembershipForAppInstanceUser
s@DescribeChannelMembershipForAppInstanceUser' {} Text
a -> DescribeChannelMembershipForAppInstanceUser
s {$sel:appInstanceUserArn:DescribeChannelMembershipForAppInstanceUser' :: Text
appInstanceUserArn = Text
a} :: DescribeChannelMembershipForAppInstanceUser)

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

instance
  Core.AWSRequest
    DescribeChannelMembershipForAppInstanceUser
  where
  type
    AWSResponse
      DescribeChannelMembershipForAppInstanceUser =
      DescribeChannelMembershipForAppInstanceUserResponse
  request :: DescribeChannelMembershipForAppInstanceUser
-> Request DescribeChannelMembershipForAppInstanceUser
request = Service
-> DescribeChannelMembershipForAppInstanceUser
-> Request DescribeChannelMembershipForAppInstanceUser
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeChannelMembershipForAppInstanceUser
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DescribeChannelMembershipForAppInstanceUser)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse DescribeChannelMembershipForAppInstanceUser))
-> Logger
-> Service
-> Proxy DescribeChannelMembershipForAppInstanceUser
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DescribeChannelMembershipForAppInstanceUser)))
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 ChannelMembershipForAppInstanceUserSummary
-> Int -> DescribeChannelMembershipForAppInstanceUserResponse
DescribeChannelMembershipForAppInstanceUserResponse'
            (Maybe ChannelMembershipForAppInstanceUserSummary
 -> Int -> DescribeChannelMembershipForAppInstanceUserResponse)
-> Either String (Maybe ChannelMembershipForAppInstanceUserSummary)
-> Either
     String (Int -> DescribeChannelMembershipForAppInstanceUserResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Either String (Maybe ChannelMembershipForAppInstanceUserSummary)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ChannelMembership")
              Either
  String (Int -> DescribeChannelMembershipForAppInstanceUserResponse)
-> Either String Int
-> Either
     String DescribeChannelMembershipForAppInstanceUserResponse
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
    DescribeChannelMembershipForAppInstanceUser

instance
  Prelude.NFData
    DescribeChannelMembershipForAppInstanceUser

instance
  Core.ToHeaders
    DescribeChannelMembershipForAppInstanceUser
  where
  toHeaders :: DescribeChannelMembershipForAppInstanceUser -> ResponseHeaders
toHeaders
    DescribeChannelMembershipForAppInstanceUser' {Text
chimeBearer :: Text
appInstanceUserArn :: Text
channelArn :: Text
$sel:chimeBearer:DescribeChannelMembershipForAppInstanceUser' :: DescribeChannelMembershipForAppInstanceUser -> Text
$sel:appInstanceUserArn:DescribeChannelMembershipForAppInstanceUser' :: DescribeChannelMembershipForAppInstanceUser -> Text
$sel:channelArn:DescribeChannelMembershipForAppInstanceUser' :: DescribeChannelMembershipForAppInstanceUser -> Text
..} =
      [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
        [HeaderName
"x-amz-chime-bearer" HeaderName -> Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Text
chimeBearer]

instance
  Core.ToPath
    DescribeChannelMembershipForAppInstanceUser
  where
  toPath :: DescribeChannelMembershipForAppInstanceUser -> ByteString
toPath
    DescribeChannelMembershipForAppInstanceUser' {Text
chimeBearer :: Text
appInstanceUserArn :: Text
channelArn :: Text
$sel:chimeBearer:DescribeChannelMembershipForAppInstanceUser' :: DescribeChannelMembershipForAppInstanceUser -> Text
$sel:appInstanceUserArn:DescribeChannelMembershipForAppInstanceUser' :: DescribeChannelMembershipForAppInstanceUser -> Text
$sel:channelArn:DescribeChannelMembershipForAppInstanceUser' :: DescribeChannelMembershipForAppInstanceUser -> 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]

instance
  Core.ToQuery
    DescribeChannelMembershipForAppInstanceUser
  where
  toQuery :: DescribeChannelMembershipForAppInstanceUser -> QueryString
toQuery
    DescribeChannelMembershipForAppInstanceUser' {Text
chimeBearer :: Text
appInstanceUserArn :: Text
channelArn :: Text
$sel:chimeBearer:DescribeChannelMembershipForAppInstanceUser' :: DescribeChannelMembershipForAppInstanceUser -> Text
$sel:appInstanceUserArn:DescribeChannelMembershipForAppInstanceUser' :: DescribeChannelMembershipForAppInstanceUser -> Text
$sel:channelArn:DescribeChannelMembershipForAppInstanceUser' :: DescribeChannelMembershipForAppInstanceUser -> Text
..} =
      [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
        [ ByteString
"app-instance-user-arn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
appInstanceUserArn,
          QueryString
"scope=app-instance-user-membership"
        ]

-- | /See:/ 'newDescribeChannelMembershipForAppInstanceUserResponse' smart constructor.
data DescribeChannelMembershipForAppInstanceUserResponse = DescribeChannelMembershipForAppInstanceUserResponse'
  { -- | The channel to which a user belongs.
    DescribeChannelMembershipForAppInstanceUserResponse
-> Maybe ChannelMembershipForAppInstanceUserSummary
channelMembership :: Prelude.Maybe ChannelMembershipForAppInstanceUserSummary,
    -- | The response's http status code.
    DescribeChannelMembershipForAppInstanceUserResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeChannelMembershipForAppInstanceUserResponse
-> DescribeChannelMembershipForAppInstanceUserResponse -> Bool
(DescribeChannelMembershipForAppInstanceUserResponse
 -> DescribeChannelMembershipForAppInstanceUserResponse -> Bool)
-> (DescribeChannelMembershipForAppInstanceUserResponse
    -> DescribeChannelMembershipForAppInstanceUserResponse -> Bool)
-> Eq DescribeChannelMembershipForAppInstanceUserResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeChannelMembershipForAppInstanceUserResponse
-> DescribeChannelMembershipForAppInstanceUserResponse -> Bool
$c/= :: DescribeChannelMembershipForAppInstanceUserResponse
-> DescribeChannelMembershipForAppInstanceUserResponse -> Bool
== :: DescribeChannelMembershipForAppInstanceUserResponse
-> DescribeChannelMembershipForAppInstanceUserResponse -> Bool
$c== :: DescribeChannelMembershipForAppInstanceUserResponse
-> DescribeChannelMembershipForAppInstanceUserResponse -> Bool
Prelude.Eq, Int -> DescribeChannelMembershipForAppInstanceUserResponse -> ShowS
[DescribeChannelMembershipForAppInstanceUserResponse] -> ShowS
DescribeChannelMembershipForAppInstanceUserResponse -> String
(Int
 -> DescribeChannelMembershipForAppInstanceUserResponse -> ShowS)
-> (DescribeChannelMembershipForAppInstanceUserResponse -> String)
-> ([DescribeChannelMembershipForAppInstanceUserResponse] -> ShowS)
-> Show DescribeChannelMembershipForAppInstanceUserResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeChannelMembershipForAppInstanceUserResponse] -> ShowS
$cshowList :: [DescribeChannelMembershipForAppInstanceUserResponse] -> ShowS
show :: DescribeChannelMembershipForAppInstanceUserResponse -> String
$cshow :: DescribeChannelMembershipForAppInstanceUserResponse -> String
showsPrec :: Int -> DescribeChannelMembershipForAppInstanceUserResponse -> ShowS
$cshowsPrec :: Int -> DescribeChannelMembershipForAppInstanceUserResponse -> ShowS
Prelude.Show, (forall x.
 DescribeChannelMembershipForAppInstanceUserResponse
 -> Rep DescribeChannelMembershipForAppInstanceUserResponse x)
-> (forall x.
    Rep DescribeChannelMembershipForAppInstanceUserResponse x
    -> DescribeChannelMembershipForAppInstanceUserResponse)
-> Generic DescribeChannelMembershipForAppInstanceUserResponse
forall x.
Rep DescribeChannelMembershipForAppInstanceUserResponse x
-> DescribeChannelMembershipForAppInstanceUserResponse
forall x.
DescribeChannelMembershipForAppInstanceUserResponse
-> Rep DescribeChannelMembershipForAppInstanceUserResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeChannelMembershipForAppInstanceUserResponse x
-> DescribeChannelMembershipForAppInstanceUserResponse
$cfrom :: forall x.
DescribeChannelMembershipForAppInstanceUserResponse
-> Rep DescribeChannelMembershipForAppInstanceUserResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeChannelMembershipForAppInstanceUserResponse' 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:
--
-- 'channelMembership', 'describeChannelMembershipForAppInstanceUserResponse_channelMembership' - The channel to which a user belongs.
--
-- 'httpStatus', 'describeChannelMembershipForAppInstanceUserResponse_httpStatus' - The response's http status code.
newDescribeChannelMembershipForAppInstanceUserResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeChannelMembershipForAppInstanceUserResponse
newDescribeChannelMembershipForAppInstanceUserResponse :: Int -> DescribeChannelMembershipForAppInstanceUserResponse
newDescribeChannelMembershipForAppInstanceUserResponse
  Int
pHttpStatus_ =
    DescribeChannelMembershipForAppInstanceUserResponse' :: Maybe ChannelMembershipForAppInstanceUserSummary
-> Int -> DescribeChannelMembershipForAppInstanceUserResponse
DescribeChannelMembershipForAppInstanceUserResponse'
      { $sel:channelMembership:DescribeChannelMembershipForAppInstanceUserResponse' :: Maybe ChannelMembershipForAppInstanceUserSummary
channelMembership =
          Maybe ChannelMembershipForAppInstanceUserSummary
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeChannelMembershipForAppInstanceUserResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | The channel to which a user belongs.
describeChannelMembershipForAppInstanceUserResponse_channelMembership :: Lens.Lens' DescribeChannelMembershipForAppInstanceUserResponse (Prelude.Maybe ChannelMembershipForAppInstanceUserSummary)
describeChannelMembershipForAppInstanceUserResponse_channelMembership :: (Maybe ChannelMembershipForAppInstanceUserSummary
 -> f (Maybe ChannelMembershipForAppInstanceUserSummary))
-> DescribeChannelMembershipForAppInstanceUserResponse
-> f DescribeChannelMembershipForAppInstanceUserResponse
describeChannelMembershipForAppInstanceUserResponse_channelMembership = (DescribeChannelMembershipForAppInstanceUserResponse
 -> Maybe ChannelMembershipForAppInstanceUserSummary)
-> (DescribeChannelMembershipForAppInstanceUserResponse
    -> Maybe ChannelMembershipForAppInstanceUserSummary
    -> DescribeChannelMembershipForAppInstanceUserResponse)
-> Lens
     DescribeChannelMembershipForAppInstanceUserResponse
     DescribeChannelMembershipForAppInstanceUserResponse
     (Maybe ChannelMembershipForAppInstanceUserSummary)
     (Maybe ChannelMembershipForAppInstanceUserSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelMembershipForAppInstanceUserResponse' {Maybe ChannelMembershipForAppInstanceUserSummary
channelMembership :: Maybe ChannelMembershipForAppInstanceUserSummary
$sel:channelMembership:DescribeChannelMembershipForAppInstanceUserResponse' :: DescribeChannelMembershipForAppInstanceUserResponse
-> Maybe ChannelMembershipForAppInstanceUserSummary
channelMembership} -> Maybe ChannelMembershipForAppInstanceUserSummary
channelMembership) (\s :: DescribeChannelMembershipForAppInstanceUserResponse
s@DescribeChannelMembershipForAppInstanceUserResponse' {} Maybe ChannelMembershipForAppInstanceUserSummary
a -> DescribeChannelMembershipForAppInstanceUserResponse
s {$sel:channelMembership:DescribeChannelMembershipForAppInstanceUserResponse' :: Maybe ChannelMembershipForAppInstanceUserSummary
channelMembership = Maybe ChannelMembershipForAppInstanceUserSummary
a} :: DescribeChannelMembershipForAppInstanceUserResponse)

-- | The response's http status code.
describeChannelMembershipForAppInstanceUserResponse_httpStatus :: Lens.Lens' DescribeChannelMembershipForAppInstanceUserResponse Prelude.Int
describeChannelMembershipForAppInstanceUserResponse_httpStatus :: (Int -> f Int)
-> DescribeChannelMembershipForAppInstanceUserResponse
-> f DescribeChannelMembershipForAppInstanceUserResponse
describeChannelMembershipForAppInstanceUserResponse_httpStatus = (DescribeChannelMembershipForAppInstanceUserResponse -> Int)
-> (DescribeChannelMembershipForAppInstanceUserResponse
    -> Int -> DescribeChannelMembershipForAppInstanceUserResponse)
-> Lens
     DescribeChannelMembershipForAppInstanceUserResponse
     DescribeChannelMembershipForAppInstanceUserResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeChannelMembershipForAppInstanceUserResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeChannelMembershipForAppInstanceUserResponse' :: DescribeChannelMembershipForAppInstanceUserResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeChannelMembershipForAppInstanceUserResponse
s@DescribeChannelMembershipForAppInstanceUserResponse' {} Int
a -> DescribeChannelMembershipForAppInstanceUserResponse
s {$sel:httpStatus:DescribeChannelMembershipForAppInstanceUserResponse' :: Int
httpStatus = Int
a} :: DescribeChannelMembershipForAppInstanceUserResponse)

instance
  Prelude.NFData
    DescribeChannelMembershipForAppInstanceUserResponse