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

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

-- |
-- Module      : Amazonka.Chime.Types.ChannelMembershipForAppInstanceUserSummary
-- 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)
module Amazonka.Chime.Types.ChannelMembershipForAppInstanceUserSummary where

import Amazonka.Chime.Types.AppInstanceUserMembershipSummary
import Amazonka.Chime.Types.ChannelSummary
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Summary of the channel membership details of an @AppInstanceUser@.
--
-- /See:/ 'newChannelMembershipForAppInstanceUserSummary' smart constructor.
data ChannelMembershipForAppInstanceUserSummary = ChannelMembershipForAppInstanceUserSummary'
  { ChannelMembershipForAppInstanceUserSummary
-> Maybe AppInstanceUserMembershipSummary
appInstanceUserMembershipSummary :: Prelude.Maybe AppInstanceUserMembershipSummary,
    ChannelMembershipForAppInstanceUserSummary -> Maybe ChannelSummary
channelSummary :: Prelude.Maybe ChannelSummary
  }
  deriving (ChannelMembershipForAppInstanceUserSummary
-> ChannelMembershipForAppInstanceUserSummary -> Bool
(ChannelMembershipForAppInstanceUserSummary
 -> ChannelMembershipForAppInstanceUserSummary -> Bool)
-> (ChannelMembershipForAppInstanceUserSummary
    -> ChannelMembershipForAppInstanceUserSummary -> Bool)
-> Eq ChannelMembershipForAppInstanceUserSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelMembershipForAppInstanceUserSummary
-> ChannelMembershipForAppInstanceUserSummary -> Bool
$c/= :: ChannelMembershipForAppInstanceUserSummary
-> ChannelMembershipForAppInstanceUserSummary -> Bool
== :: ChannelMembershipForAppInstanceUserSummary
-> ChannelMembershipForAppInstanceUserSummary -> Bool
$c== :: ChannelMembershipForAppInstanceUserSummary
-> ChannelMembershipForAppInstanceUserSummary -> Bool
Prelude.Eq, Int -> ChannelMembershipForAppInstanceUserSummary -> ShowS
[ChannelMembershipForAppInstanceUserSummary] -> ShowS
ChannelMembershipForAppInstanceUserSummary -> String
(Int -> ChannelMembershipForAppInstanceUserSummary -> ShowS)
-> (ChannelMembershipForAppInstanceUserSummary -> String)
-> ([ChannelMembershipForAppInstanceUserSummary] -> ShowS)
-> Show ChannelMembershipForAppInstanceUserSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelMembershipForAppInstanceUserSummary] -> ShowS
$cshowList :: [ChannelMembershipForAppInstanceUserSummary] -> ShowS
show :: ChannelMembershipForAppInstanceUserSummary -> String
$cshow :: ChannelMembershipForAppInstanceUserSummary -> String
showsPrec :: Int -> ChannelMembershipForAppInstanceUserSummary -> ShowS
$cshowsPrec :: Int -> ChannelMembershipForAppInstanceUserSummary -> ShowS
Prelude.Show, (forall x.
 ChannelMembershipForAppInstanceUserSummary
 -> Rep ChannelMembershipForAppInstanceUserSummary x)
-> (forall x.
    Rep ChannelMembershipForAppInstanceUserSummary x
    -> ChannelMembershipForAppInstanceUserSummary)
-> Generic ChannelMembershipForAppInstanceUserSummary
forall x.
Rep ChannelMembershipForAppInstanceUserSummary x
-> ChannelMembershipForAppInstanceUserSummary
forall x.
ChannelMembershipForAppInstanceUserSummary
-> Rep ChannelMembershipForAppInstanceUserSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ChannelMembershipForAppInstanceUserSummary x
-> ChannelMembershipForAppInstanceUserSummary
$cfrom :: forall x.
ChannelMembershipForAppInstanceUserSummary
-> Rep ChannelMembershipForAppInstanceUserSummary x
Prelude.Generic)

-- |
-- Create a value of 'ChannelMembershipForAppInstanceUserSummary' 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:
--
-- 'appInstanceUserMembershipSummary', 'channelMembershipForAppInstanceUserSummary_appInstanceUserMembershipSummary' - Undocumented member.
--
-- 'channelSummary', 'channelMembershipForAppInstanceUserSummary_channelSummary' - Undocumented member.
newChannelMembershipForAppInstanceUserSummary ::
  ChannelMembershipForAppInstanceUserSummary
newChannelMembershipForAppInstanceUserSummary :: ChannelMembershipForAppInstanceUserSummary
newChannelMembershipForAppInstanceUserSummary =
  ChannelMembershipForAppInstanceUserSummary' :: Maybe AppInstanceUserMembershipSummary
-> Maybe ChannelSummary
-> ChannelMembershipForAppInstanceUserSummary
ChannelMembershipForAppInstanceUserSummary'
    { $sel:appInstanceUserMembershipSummary:ChannelMembershipForAppInstanceUserSummary' :: Maybe AppInstanceUserMembershipSummary
appInstanceUserMembershipSummary =
        Maybe AppInstanceUserMembershipSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:channelSummary:ChannelMembershipForAppInstanceUserSummary' :: Maybe ChannelSummary
channelSummary =
        Maybe ChannelSummary
forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
channelMembershipForAppInstanceUserSummary_appInstanceUserMembershipSummary :: Lens.Lens' ChannelMembershipForAppInstanceUserSummary (Prelude.Maybe AppInstanceUserMembershipSummary)
channelMembershipForAppInstanceUserSummary_appInstanceUserMembershipSummary :: (Maybe AppInstanceUserMembershipSummary
 -> f (Maybe AppInstanceUserMembershipSummary))
-> ChannelMembershipForAppInstanceUserSummary
-> f ChannelMembershipForAppInstanceUserSummary
channelMembershipForAppInstanceUserSummary_appInstanceUserMembershipSummary = (ChannelMembershipForAppInstanceUserSummary
 -> Maybe AppInstanceUserMembershipSummary)
-> (ChannelMembershipForAppInstanceUserSummary
    -> Maybe AppInstanceUserMembershipSummary
    -> ChannelMembershipForAppInstanceUserSummary)
-> Lens
     ChannelMembershipForAppInstanceUserSummary
     ChannelMembershipForAppInstanceUserSummary
     (Maybe AppInstanceUserMembershipSummary)
     (Maybe AppInstanceUserMembershipSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelMembershipForAppInstanceUserSummary' {Maybe AppInstanceUserMembershipSummary
appInstanceUserMembershipSummary :: Maybe AppInstanceUserMembershipSummary
$sel:appInstanceUserMembershipSummary:ChannelMembershipForAppInstanceUserSummary' :: ChannelMembershipForAppInstanceUserSummary
-> Maybe AppInstanceUserMembershipSummary
appInstanceUserMembershipSummary} -> Maybe AppInstanceUserMembershipSummary
appInstanceUserMembershipSummary) (\s :: ChannelMembershipForAppInstanceUserSummary
s@ChannelMembershipForAppInstanceUserSummary' {} Maybe AppInstanceUserMembershipSummary
a -> ChannelMembershipForAppInstanceUserSummary
s {$sel:appInstanceUserMembershipSummary:ChannelMembershipForAppInstanceUserSummary' :: Maybe AppInstanceUserMembershipSummary
appInstanceUserMembershipSummary = Maybe AppInstanceUserMembershipSummary
a} :: ChannelMembershipForAppInstanceUserSummary)

-- | Undocumented member.
channelMembershipForAppInstanceUserSummary_channelSummary :: Lens.Lens' ChannelMembershipForAppInstanceUserSummary (Prelude.Maybe ChannelSummary)
channelMembershipForAppInstanceUserSummary_channelSummary :: (Maybe ChannelSummary -> f (Maybe ChannelSummary))
-> ChannelMembershipForAppInstanceUserSummary
-> f ChannelMembershipForAppInstanceUserSummary
channelMembershipForAppInstanceUserSummary_channelSummary = (ChannelMembershipForAppInstanceUserSummary
 -> Maybe ChannelSummary)
-> (ChannelMembershipForAppInstanceUserSummary
    -> Maybe ChannelSummary
    -> ChannelMembershipForAppInstanceUserSummary)
-> Lens
     ChannelMembershipForAppInstanceUserSummary
     ChannelMembershipForAppInstanceUserSummary
     (Maybe ChannelSummary)
     (Maybe ChannelSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelMembershipForAppInstanceUserSummary' {Maybe ChannelSummary
channelSummary :: Maybe ChannelSummary
$sel:channelSummary:ChannelMembershipForAppInstanceUserSummary' :: ChannelMembershipForAppInstanceUserSummary -> Maybe ChannelSummary
channelSummary} -> Maybe ChannelSummary
channelSummary) (\s :: ChannelMembershipForAppInstanceUserSummary
s@ChannelMembershipForAppInstanceUserSummary' {} Maybe ChannelSummary
a -> ChannelMembershipForAppInstanceUserSummary
s {$sel:channelSummary:ChannelMembershipForAppInstanceUserSummary' :: Maybe ChannelSummary
channelSummary = Maybe ChannelSummary
a} :: ChannelMembershipForAppInstanceUserSummary)

instance
  Core.FromJSON
    ChannelMembershipForAppInstanceUserSummary
  where
  parseJSON :: Value -> Parser ChannelMembershipForAppInstanceUserSummary
parseJSON =
    String
-> (Object -> Parser ChannelMembershipForAppInstanceUserSummary)
-> Value
-> Parser ChannelMembershipForAppInstanceUserSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ChannelMembershipForAppInstanceUserSummary"
      ( \Object
x ->
          Maybe AppInstanceUserMembershipSummary
-> Maybe ChannelSummary
-> ChannelMembershipForAppInstanceUserSummary
ChannelMembershipForAppInstanceUserSummary'
            (Maybe AppInstanceUserMembershipSummary
 -> Maybe ChannelSummary
 -> ChannelMembershipForAppInstanceUserSummary)
-> Parser (Maybe AppInstanceUserMembershipSummary)
-> Parser
     (Maybe ChannelSummary
      -> ChannelMembershipForAppInstanceUserSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AppInstanceUserMembershipSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AppInstanceUserMembershipSummary")
              Parser
  (Maybe ChannelSummary
   -> ChannelMembershipForAppInstanceUserSummary)
-> Parser (Maybe ChannelSummary)
-> Parser ChannelMembershipForAppInstanceUserSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ChannelSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ChannelSummary")
      )

instance
  Prelude.Hashable
    ChannelMembershipForAppInstanceUserSummary

instance
  Prelude.NFData
    ChannelMembershipForAppInstanceUserSummary