{-# 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.CreateChannelMembership
-- 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)
--
-- Adds a user to a channel. The @InvitedBy@ response field is derived from
-- the request header. A channel member can:
--
-- -   List messages
--
-- -   Send messages
--
-- -   Receive messages
--
-- -   Edit their own messages
--
-- -   Leave the channel
--
-- Privacy settings impact this action as follows:
--
-- -   Public Channels: You do not need to be a member to list messages,
--     but you must be a member to send messages.
--
-- -   Private Channels: You must be a member to list or send messages.
--
-- 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.CreateChannelMembership
  ( -- * Creating a Request
    CreateChannelMembership (..),
    newCreateChannelMembership,

    -- * Request Lenses
    createChannelMembership_channelArn,
    createChannelMembership_memberArn,
    createChannelMembership_type,
    createChannelMembership_chimeBearer,

    -- * Destructuring the Response
    CreateChannelMembershipResponse (..),
    newCreateChannelMembershipResponse,

    -- * Response Lenses
    createChannelMembershipResponse_channelArn,
    createChannelMembershipResponse_member,
    createChannelMembershipResponse_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:/ 'newCreateChannelMembership' smart constructor.
data CreateChannelMembership = CreateChannelMembership'
  { -- | The ARN of the channel to which you\'re adding users.
    CreateChannelMembership -> Text
channelArn :: Prelude.Text,
    -- | The ARN of the member you want to add to the channel.
    CreateChannelMembership -> Text
memberArn :: 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. This is only
    -- supported by moderators.
    CreateChannelMembership -> ChannelMembershipType
type' :: ChannelMembershipType,
    -- | The @AppInstanceUserArn@ of the user that makes the API call.
    CreateChannelMembership -> Text
chimeBearer :: Prelude.Text
  }
  deriving (CreateChannelMembership -> CreateChannelMembership -> Bool
(CreateChannelMembership -> CreateChannelMembership -> Bool)
-> (CreateChannelMembership -> CreateChannelMembership -> Bool)
-> Eq CreateChannelMembership
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateChannelMembership -> CreateChannelMembership -> Bool
$c/= :: CreateChannelMembership -> CreateChannelMembership -> Bool
== :: CreateChannelMembership -> CreateChannelMembership -> Bool
$c== :: CreateChannelMembership -> CreateChannelMembership -> Bool
Prelude.Eq, ReadPrec [CreateChannelMembership]
ReadPrec CreateChannelMembership
Int -> ReadS CreateChannelMembership
ReadS [CreateChannelMembership]
(Int -> ReadS CreateChannelMembership)
-> ReadS [CreateChannelMembership]
-> ReadPrec CreateChannelMembership
-> ReadPrec [CreateChannelMembership]
-> Read CreateChannelMembership
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateChannelMembership]
$creadListPrec :: ReadPrec [CreateChannelMembership]
readPrec :: ReadPrec CreateChannelMembership
$creadPrec :: ReadPrec CreateChannelMembership
readList :: ReadS [CreateChannelMembership]
$creadList :: ReadS [CreateChannelMembership]
readsPrec :: Int -> ReadS CreateChannelMembership
$creadsPrec :: Int -> ReadS CreateChannelMembership
Prelude.Read, Int -> CreateChannelMembership -> ShowS
[CreateChannelMembership] -> ShowS
CreateChannelMembership -> String
(Int -> CreateChannelMembership -> ShowS)
-> (CreateChannelMembership -> String)
-> ([CreateChannelMembership] -> ShowS)
-> Show CreateChannelMembership
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateChannelMembership] -> ShowS
$cshowList :: [CreateChannelMembership] -> ShowS
show :: CreateChannelMembership -> String
$cshow :: CreateChannelMembership -> String
showsPrec :: Int -> CreateChannelMembership -> ShowS
$cshowsPrec :: Int -> CreateChannelMembership -> ShowS
Prelude.Show, (forall x.
 CreateChannelMembership -> Rep CreateChannelMembership x)
-> (forall x.
    Rep CreateChannelMembership x -> CreateChannelMembership)
-> Generic CreateChannelMembership
forall x. Rep CreateChannelMembership x -> CreateChannelMembership
forall x. CreateChannelMembership -> Rep CreateChannelMembership x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateChannelMembership x -> CreateChannelMembership
$cfrom :: forall x. CreateChannelMembership -> Rep CreateChannelMembership x
Prelude.Generic)

-- |
-- Create a value of 'CreateChannelMembership' 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', 'createChannelMembership_channelArn' - The ARN of the channel to which you\'re adding users.
--
-- 'memberArn', 'createChannelMembership_memberArn' - The ARN of the member you want to add to the channel.
--
-- 'type'', 'createChannelMembership_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. This is only
-- supported by moderators.
--
-- 'chimeBearer', 'createChannelMembership_chimeBearer' - The @AppInstanceUserArn@ of the user that makes the API call.
newCreateChannelMembership ::
  -- | 'channelArn'
  Prelude.Text ->
  -- | 'memberArn'
  Prelude.Text ->
  -- | 'type''
  ChannelMembershipType ->
  -- | 'chimeBearer'
  Prelude.Text ->
  CreateChannelMembership
newCreateChannelMembership :: Text
-> Text -> ChannelMembershipType -> Text -> CreateChannelMembership
newCreateChannelMembership
  Text
pChannelArn_
  Text
pMemberArn_
  ChannelMembershipType
pType_
  Text
pChimeBearer_ =
    CreateChannelMembership' :: Text
-> Text -> ChannelMembershipType -> Text -> CreateChannelMembership
CreateChannelMembership'
      { $sel:channelArn:CreateChannelMembership' :: Text
channelArn = Text
pChannelArn_,
        $sel:memberArn:CreateChannelMembership' :: Text
memberArn = Text
pMemberArn_,
        $sel:type':CreateChannelMembership' :: ChannelMembershipType
type' = ChannelMembershipType
pType_,
        $sel:chimeBearer:CreateChannelMembership' :: Text
chimeBearer = Text
pChimeBearer_
      }

-- | The ARN of the channel to which you\'re adding users.
createChannelMembership_channelArn :: Lens.Lens' CreateChannelMembership Prelude.Text
createChannelMembership_channelArn :: (Text -> f Text)
-> CreateChannelMembership -> f CreateChannelMembership
createChannelMembership_channelArn = (CreateChannelMembership -> Text)
-> (CreateChannelMembership -> Text -> CreateChannelMembership)
-> Lens CreateChannelMembership CreateChannelMembership Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelMembership' {Text
channelArn :: Text
$sel:channelArn:CreateChannelMembership' :: CreateChannelMembership -> Text
channelArn} -> Text
channelArn) (\s :: CreateChannelMembership
s@CreateChannelMembership' {} Text
a -> CreateChannelMembership
s {$sel:channelArn:CreateChannelMembership' :: Text
channelArn = Text
a} :: CreateChannelMembership)

-- | The ARN of the member you want to add to the channel.
createChannelMembership_memberArn :: Lens.Lens' CreateChannelMembership Prelude.Text
createChannelMembership_memberArn :: (Text -> f Text)
-> CreateChannelMembership -> f CreateChannelMembership
createChannelMembership_memberArn = (CreateChannelMembership -> Text)
-> (CreateChannelMembership -> Text -> CreateChannelMembership)
-> Lens CreateChannelMembership CreateChannelMembership Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelMembership' {Text
memberArn :: Text
$sel:memberArn:CreateChannelMembership' :: CreateChannelMembership -> Text
memberArn} -> Text
memberArn) (\s :: CreateChannelMembership
s@CreateChannelMembership' {} Text
a -> CreateChannelMembership
s {$sel:memberArn:CreateChannelMembership' :: Text
memberArn = Text
a} :: CreateChannelMembership)

-- | 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. This is only
-- supported by moderators.
createChannelMembership_type :: Lens.Lens' CreateChannelMembership ChannelMembershipType
createChannelMembership_type :: (ChannelMembershipType -> f ChannelMembershipType)
-> CreateChannelMembership -> f CreateChannelMembership
createChannelMembership_type = (CreateChannelMembership -> ChannelMembershipType)
-> (CreateChannelMembership
    -> ChannelMembershipType -> CreateChannelMembership)
-> Lens
     CreateChannelMembership
     CreateChannelMembership
     ChannelMembershipType
     ChannelMembershipType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelMembership' {ChannelMembershipType
type' :: ChannelMembershipType
$sel:type':CreateChannelMembership' :: CreateChannelMembership -> ChannelMembershipType
type'} -> ChannelMembershipType
type') (\s :: CreateChannelMembership
s@CreateChannelMembership' {} ChannelMembershipType
a -> CreateChannelMembership
s {$sel:type':CreateChannelMembership' :: ChannelMembershipType
type' = ChannelMembershipType
a} :: CreateChannelMembership)

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

instance Core.AWSRequest CreateChannelMembership where
  type
    AWSResponse CreateChannelMembership =
      CreateChannelMembershipResponse
  request :: CreateChannelMembership -> Request CreateChannelMembership
request = Service
-> CreateChannelMembership -> Request CreateChannelMembership
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateChannelMembership
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateChannelMembership)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateChannelMembership))
-> Logger
-> Service
-> Proxy CreateChannelMembership
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateChannelMembership)))
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 Text
-> Maybe Identity -> Int -> CreateChannelMembershipResponse
CreateChannelMembershipResponse'
            (Maybe Text
 -> Maybe Identity -> Int -> CreateChannelMembershipResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Identity -> Int -> CreateChannelMembershipResponse)
forall (f :: * -> *) a b. Functor 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 Identity -> Int -> CreateChannelMembershipResponse)
-> Either String (Maybe Identity)
-> Either String (Int -> CreateChannelMembershipResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Identity)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Member")
            Either String (Int -> CreateChannelMembershipResponse)
-> Either String Int
-> Either String CreateChannelMembershipResponse
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 CreateChannelMembership

instance Prelude.NFData CreateChannelMembership

instance Core.ToHeaders CreateChannelMembership where
  toHeaders :: CreateChannelMembership -> ResponseHeaders
toHeaders CreateChannelMembership' {Text
ChannelMembershipType
chimeBearer :: Text
type' :: ChannelMembershipType
memberArn :: Text
channelArn :: Text
$sel:chimeBearer:CreateChannelMembership' :: CreateChannelMembership -> Text
$sel:type':CreateChannelMembership' :: CreateChannelMembership -> ChannelMembershipType
$sel:memberArn:CreateChannelMembership' :: CreateChannelMembership -> Text
$sel:channelArn:CreateChannelMembership' :: CreateChannelMembership -> 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.ToJSON CreateChannelMembership where
  toJSON :: CreateChannelMembership -> Value
toJSON CreateChannelMembership' {Text
ChannelMembershipType
chimeBearer :: Text
type' :: ChannelMembershipType
memberArn :: Text
channelArn :: Text
$sel:chimeBearer:CreateChannelMembership' :: CreateChannelMembership -> Text
$sel:type':CreateChannelMembership' :: CreateChannelMembership -> ChannelMembershipType
$sel:memberArn:CreateChannelMembership' :: CreateChannelMembership -> Text
$sel:channelArn:CreateChannelMembership' :: CreateChannelMembership -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"MemberArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
memberArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Type" Text -> ChannelMembershipType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ChannelMembershipType
type')
          ]
      )

instance Core.ToPath CreateChannelMembership where
  toPath :: CreateChannelMembership -> ByteString
toPath CreateChannelMembership' {Text
ChannelMembershipType
chimeBearer :: Text
type' :: ChannelMembershipType
memberArn :: Text
channelArn :: Text
$sel:chimeBearer:CreateChannelMembership' :: CreateChannelMembership -> Text
$sel:type':CreateChannelMembership' :: CreateChannelMembership -> ChannelMembershipType
$sel:memberArn:CreateChannelMembership' :: CreateChannelMembership -> Text
$sel:channelArn:CreateChannelMembership' :: CreateChannelMembership -> 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 CreateChannelMembership where
  toQuery :: CreateChannelMembership -> QueryString
toQuery = QueryString -> CreateChannelMembership -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateChannelMembershipResponse' smart constructor.
data CreateChannelMembershipResponse = CreateChannelMembershipResponse'
  { -- | The ARN of the channel.
    CreateChannelMembershipResponse -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
    -- | The ARN and metadata of the member being added.
    CreateChannelMembershipResponse -> Maybe Identity
member :: Prelude.Maybe Identity,
    -- | The response's http status code.
    CreateChannelMembershipResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateChannelMembershipResponse
-> CreateChannelMembershipResponse -> Bool
(CreateChannelMembershipResponse
 -> CreateChannelMembershipResponse -> Bool)
-> (CreateChannelMembershipResponse
    -> CreateChannelMembershipResponse -> Bool)
-> Eq CreateChannelMembershipResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateChannelMembershipResponse
-> CreateChannelMembershipResponse -> Bool
$c/= :: CreateChannelMembershipResponse
-> CreateChannelMembershipResponse -> Bool
== :: CreateChannelMembershipResponse
-> CreateChannelMembershipResponse -> Bool
$c== :: CreateChannelMembershipResponse
-> CreateChannelMembershipResponse -> Bool
Prelude.Eq, Int -> CreateChannelMembershipResponse -> ShowS
[CreateChannelMembershipResponse] -> ShowS
CreateChannelMembershipResponse -> String
(Int -> CreateChannelMembershipResponse -> ShowS)
-> (CreateChannelMembershipResponse -> String)
-> ([CreateChannelMembershipResponse] -> ShowS)
-> Show CreateChannelMembershipResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateChannelMembershipResponse] -> ShowS
$cshowList :: [CreateChannelMembershipResponse] -> ShowS
show :: CreateChannelMembershipResponse -> String
$cshow :: CreateChannelMembershipResponse -> String
showsPrec :: Int -> CreateChannelMembershipResponse -> ShowS
$cshowsPrec :: Int -> CreateChannelMembershipResponse -> ShowS
Prelude.Show, (forall x.
 CreateChannelMembershipResponse
 -> Rep CreateChannelMembershipResponse x)
-> (forall x.
    Rep CreateChannelMembershipResponse x
    -> CreateChannelMembershipResponse)
-> Generic CreateChannelMembershipResponse
forall x.
Rep CreateChannelMembershipResponse x
-> CreateChannelMembershipResponse
forall x.
CreateChannelMembershipResponse
-> Rep CreateChannelMembershipResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateChannelMembershipResponse x
-> CreateChannelMembershipResponse
$cfrom :: forall x.
CreateChannelMembershipResponse
-> Rep CreateChannelMembershipResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateChannelMembershipResponse' 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', 'createChannelMembershipResponse_channelArn' - The ARN of the channel.
--
-- 'member', 'createChannelMembershipResponse_member' - The ARN and metadata of the member being added.
--
-- 'httpStatus', 'createChannelMembershipResponse_httpStatus' - The response's http status code.
newCreateChannelMembershipResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateChannelMembershipResponse
newCreateChannelMembershipResponse :: Int -> CreateChannelMembershipResponse
newCreateChannelMembershipResponse Int
pHttpStatus_ =
  CreateChannelMembershipResponse' :: Maybe Text
-> Maybe Identity -> Int -> CreateChannelMembershipResponse
CreateChannelMembershipResponse'
    { $sel:channelArn:CreateChannelMembershipResponse' :: Maybe Text
channelArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:member:CreateChannelMembershipResponse' :: Maybe Identity
member = Maybe Identity
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateChannelMembershipResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The ARN and metadata of the member being added.
createChannelMembershipResponse_member :: Lens.Lens' CreateChannelMembershipResponse (Prelude.Maybe Identity)
createChannelMembershipResponse_member :: (Maybe Identity -> f (Maybe Identity))
-> CreateChannelMembershipResponse
-> f CreateChannelMembershipResponse
createChannelMembershipResponse_member = (CreateChannelMembershipResponse -> Maybe Identity)
-> (CreateChannelMembershipResponse
    -> Maybe Identity -> CreateChannelMembershipResponse)
-> Lens
     CreateChannelMembershipResponse
     CreateChannelMembershipResponse
     (Maybe Identity)
     (Maybe Identity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateChannelMembershipResponse' {Maybe Identity
member :: Maybe Identity
$sel:member:CreateChannelMembershipResponse' :: CreateChannelMembershipResponse -> Maybe Identity
member} -> Maybe Identity
member) (\s :: CreateChannelMembershipResponse
s@CreateChannelMembershipResponse' {} Maybe Identity
a -> CreateChannelMembershipResponse
s {$sel:member:CreateChannelMembershipResponse' :: Maybe Identity
member = Maybe Identity
a} :: CreateChannelMembershipResponse)

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

instance
  Prelude.NFData
    CreateChannelMembershipResponse