{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Chime.Types.BatchChannelMemberships where
import Amazonka.Chime.Types.ChannelMembershipType
import Amazonka.Chime.Types.Identity
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BatchChannelMemberships = BatchChannelMemberships'
{
BatchChannelMemberships -> Maybe [Identity]
members :: Prelude.Maybe [Identity],
BatchChannelMemberships -> Maybe Text
channelArn :: Prelude.Maybe Prelude.Text,
BatchChannelMemberships -> Maybe ChannelMembershipType
type' :: Prelude.Maybe ChannelMembershipType,
BatchChannelMemberships -> Maybe Identity
invitedBy :: Prelude.Maybe Identity
}
deriving (BatchChannelMemberships -> BatchChannelMemberships -> Bool
(BatchChannelMemberships -> BatchChannelMemberships -> Bool)
-> (BatchChannelMemberships -> BatchChannelMemberships -> Bool)
-> Eq BatchChannelMemberships
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchChannelMemberships -> BatchChannelMemberships -> Bool
$c/= :: BatchChannelMemberships -> BatchChannelMemberships -> Bool
== :: BatchChannelMemberships -> BatchChannelMemberships -> Bool
$c== :: BatchChannelMemberships -> BatchChannelMemberships -> Bool
Prelude.Eq, Int -> BatchChannelMemberships -> ShowS
[BatchChannelMemberships] -> ShowS
BatchChannelMemberships -> String
(Int -> BatchChannelMemberships -> ShowS)
-> (BatchChannelMemberships -> String)
-> ([BatchChannelMemberships] -> ShowS)
-> Show BatchChannelMemberships
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchChannelMemberships] -> ShowS
$cshowList :: [BatchChannelMemberships] -> ShowS
show :: BatchChannelMemberships -> String
$cshow :: BatchChannelMemberships -> String
showsPrec :: Int -> BatchChannelMemberships -> ShowS
$cshowsPrec :: Int -> BatchChannelMemberships -> ShowS
Prelude.Show, (forall x.
BatchChannelMemberships -> Rep BatchChannelMemberships x)
-> (forall x.
Rep BatchChannelMemberships x -> BatchChannelMemberships)
-> Generic BatchChannelMemberships
forall x. Rep BatchChannelMemberships x -> BatchChannelMemberships
forall x. BatchChannelMemberships -> Rep BatchChannelMemberships x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchChannelMemberships x -> BatchChannelMemberships
$cfrom :: forall x. BatchChannelMemberships -> Rep BatchChannelMemberships x
Prelude.Generic)
newBatchChannelMemberships ::
BatchChannelMemberships
newBatchChannelMemberships :: BatchChannelMemberships
newBatchChannelMemberships =
BatchChannelMemberships' :: Maybe [Identity]
-> Maybe Text
-> Maybe ChannelMembershipType
-> Maybe Identity
-> BatchChannelMemberships
BatchChannelMemberships'
{ $sel:members:BatchChannelMemberships' :: Maybe [Identity]
members = Maybe [Identity]
forall a. Maybe a
Prelude.Nothing,
$sel:channelArn:BatchChannelMemberships' :: Maybe Text
channelArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':BatchChannelMemberships' :: Maybe ChannelMembershipType
type' = Maybe ChannelMembershipType
forall a. Maybe a
Prelude.Nothing,
$sel:invitedBy:BatchChannelMemberships' :: Maybe Identity
invitedBy = Maybe Identity
forall a. Maybe a
Prelude.Nothing
}
batchChannelMemberships_members :: Lens.Lens' BatchChannelMemberships (Prelude.Maybe [Identity])
batchChannelMemberships_members :: (Maybe [Identity] -> f (Maybe [Identity]))
-> BatchChannelMemberships -> f BatchChannelMemberships
batchChannelMemberships_members = (BatchChannelMemberships -> Maybe [Identity])
-> (BatchChannelMemberships
-> Maybe [Identity] -> BatchChannelMemberships)
-> Lens
BatchChannelMemberships
BatchChannelMemberships
(Maybe [Identity])
(Maybe [Identity])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchChannelMemberships' {Maybe [Identity]
members :: Maybe [Identity]
$sel:members:BatchChannelMemberships' :: BatchChannelMemberships -> Maybe [Identity]
members} -> Maybe [Identity]
members) (\s :: BatchChannelMemberships
s@BatchChannelMemberships' {} Maybe [Identity]
a -> BatchChannelMemberships
s {$sel:members:BatchChannelMemberships' :: Maybe [Identity]
members = Maybe [Identity]
a} :: BatchChannelMemberships) ((Maybe [Identity] -> f (Maybe [Identity]))
-> BatchChannelMemberships -> f BatchChannelMemberships)
-> ((Maybe [Identity] -> f (Maybe [Identity]))
-> Maybe [Identity] -> f (Maybe [Identity]))
-> (Maybe [Identity] -> f (Maybe [Identity]))
-> BatchChannelMemberships
-> f BatchChannelMemberships
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Identity] [Identity] [Identity] [Identity]
-> Iso
(Maybe [Identity])
(Maybe [Identity])
(Maybe [Identity])
(Maybe [Identity])
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 [Identity] [Identity] [Identity] [Identity]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
batchChannelMemberships_channelArn :: Lens.Lens' BatchChannelMemberships (Prelude.Maybe Prelude.Text)
batchChannelMemberships_channelArn :: (Maybe Text -> f (Maybe Text))
-> BatchChannelMemberships -> f BatchChannelMemberships
batchChannelMemberships_channelArn = (BatchChannelMemberships -> Maybe Text)
-> (BatchChannelMemberships
-> Maybe Text -> BatchChannelMemberships)
-> Lens
BatchChannelMemberships
BatchChannelMemberships
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchChannelMemberships' {Maybe Text
channelArn :: Maybe Text
$sel:channelArn:BatchChannelMemberships' :: BatchChannelMemberships -> Maybe Text
channelArn} -> Maybe Text
channelArn) (\s :: BatchChannelMemberships
s@BatchChannelMemberships' {} Maybe Text
a -> BatchChannelMemberships
s {$sel:channelArn:BatchChannelMemberships' :: Maybe Text
channelArn = Maybe Text
a} :: BatchChannelMemberships)
batchChannelMemberships_type :: Lens.Lens' BatchChannelMemberships (Prelude.Maybe ChannelMembershipType)
batchChannelMemberships_type :: (Maybe ChannelMembershipType -> f (Maybe ChannelMembershipType))
-> BatchChannelMemberships -> f BatchChannelMemberships
batchChannelMemberships_type = (BatchChannelMemberships -> Maybe ChannelMembershipType)
-> (BatchChannelMemberships
-> Maybe ChannelMembershipType -> BatchChannelMemberships)
-> Lens
BatchChannelMemberships
BatchChannelMemberships
(Maybe ChannelMembershipType)
(Maybe ChannelMembershipType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchChannelMemberships' {Maybe ChannelMembershipType
type' :: Maybe ChannelMembershipType
$sel:type':BatchChannelMemberships' :: BatchChannelMemberships -> Maybe ChannelMembershipType
type'} -> Maybe ChannelMembershipType
type') (\s :: BatchChannelMemberships
s@BatchChannelMemberships' {} Maybe ChannelMembershipType
a -> BatchChannelMemberships
s {$sel:type':BatchChannelMemberships' :: Maybe ChannelMembershipType
type' = Maybe ChannelMembershipType
a} :: BatchChannelMemberships)
batchChannelMemberships_invitedBy :: Lens.Lens' BatchChannelMemberships (Prelude.Maybe Identity)
batchChannelMemberships_invitedBy :: (Maybe Identity -> f (Maybe Identity))
-> BatchChannelMemberships -> f BatchChannelMemberships
batchChannelMemberships_invitedBy = (BatchChannelMemberships -> Maybe Identity)
-> (BatchChannelMemberships
-> Maybe Identity -> BatchChannelMemberships)
-> Lens
BatchChannelMemberships
BatchChannelMemberships
(Maybe Identity)
(Maybe Identity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchChannelMemberships' {Maybe Identity
invitedBy :: Maybe Identity
$sel:invitedBy:BatchChannelMemberships' :: BatchChannelMemberships -> Maybe Identity
invitedBy} -> Maybe Identity
invitedBy) (\s :: BatchChannelMemberships
s@BatchChannelMemberships' {} Maybe Identity
a -> BatchChannelMemberships
s {$sel:invitedBy:BatchChannelMemberships' :: Maybe Identity
invitedBy = Maybe Identity
a} :: BatchChannelMemberships)
instance Core.FromJSON BatchChannelMemberships where
parseJSON :: Value -> Parser BatchChannelMemberships
parseJSON =
String
-> (Object -> Parser BatchChannelMemberships)
-> Value
-> Parser BatchChannelMemberships
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BatchChannelMemberships"
( \Object
x ->
Maybe [Identity]
-> Maybe Text
-> Maybe ChannelMembershipType
-> Maybe Identity
-> BatchChannelMemberships
BatchChannelMemberships'
(Maybe [Identity]
-> Maybe Text
-> Maybe ChannelMembershipType
-> Maybe Identity
-> BatchChannelMemberships)
-> Parser (Maybe [Identity])
-> Parser
(Maybe Text
-> Maybe ChannelMembershipType
-> Maybe Identity
-> BatchChannelMemberships)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Identity]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Members" Parser (Maybe (Maybe [Identity]))
-> Maybe [Identity] -> Parser (Maybe [Identity])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Identity]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text
-> Maybe ChannelMembershipType
-> Maybe Identity
-> BatchChannelMemberships)
-> Parser (Maybe Text)
-> Parser
(Maybe ChannelMembershipType
-> Maybe Identity -> BatchChannelMemberships)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ChannelArn")
Parser
(Maybe ChannelMembershipType
-> Maybe Identity -> BatchChannelMemberships)
-> Parser (Maybe ChannelMembershipType)
-> Parser (Maybe Identity -> BatchChannelMemberships)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ChannelMembershipType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
Parser (Maybe Identity -> BatchChannelMemberships)
-> Parser (Maybe Identity) -> Parser BatchChannelMemberships
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Identity)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InvitedBy")
)
instance Prelude.Hashable BatchChannelMemberships
instance Prelude.NFData BatchChannelMemberships