{-# 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.ChimeSDKMessaging.Types.ChannelFlowSummary
-- 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.ChimeSDKMessaging.Types.ChannelFlowSummary where

import Amazonka.ChimeSDKMessaging.Types.Processor
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Summary of details of a channel flow.
--
-- /See:/ 'newChannelFlowSummary' smart constructor.
data ChannelFlowSummary = ChannelFlowSummary'
  { -- | Information about the processor Lambda functions.
    ChannelFlowSummary -> Maybe (NonEmpty Processor)
processors :: Prelude.Maybe (Prelude.NonEmpty Processor),
    -- | The ARN of the channel flow.
    ChannelFlowSummary -> Maybe Text
channelFlowArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the channel flow.
    ChannelFlowSummary -> Maybe (Sensitive Text)
name :: Prelude.Maybe (Core.Sensitive Prelude.Text)
  }
  deriving (ChannelFlowSummary -> ChannelFlowSummary -> Bool
(ChannelFlowSummary -> ChannelFlowSummary -> Bool)
-> (ChannelFlowSummary -> ChannelFlowSummary -> Bool)
-> Eq ChannelFlowSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelFlowSummary -> ChannelFlowSummary -> Bool
$c/= :: ChannelFlowSummary -> ChannelFlowSummary -> Bool
== :: ChannelFlowSummary -> ChannelFlowSummary -> Bool
$c== :: ChannelFlowSummary -> ChannelFlowSummary -> Bool
Prelude.Eq, Int -> ChannelFlowSummary -> ShowS
[ChannelFlowSummary] -> ShowS
ChannelFlowSummary -> String
(Int -> ChannelFlowSummary -> ShowS)
-> (ChannelFlowSummary -> String)
-> ([ChannelFlowSummary] -> ShowS)
-> Show ChannelFlowSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelFlowSummary] -> ShowS
$cshowList :: [ChannelFlowSummary] -> ShowS
show :: ChannelFlowSummary -> String
$cshow :: ChannelFlowSummary -> String
showsPrec :: Int -> ChannelFlowSummary -> ShowS
$cshowsPrec :: Int -> ChannelFlowSummary -> ShowS
Prelude.Show, (forall x. ChannelFlowSummary -> Rep ChannelFlowSummary x)
-> (forall x. Rep ChannelFlowSummary x -> ChannelFlowSummary)
-> Generic ChannelFlowSummary
forall x. Rep ChannelFlowSummary x -> ChannelFlowSummary
forall x. ChannelFlowSummary -> Rep ChannelFlowSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChannelFlowSummary x -> ChannelFlowSummary
$cfrom :: forall x. ChannelFlowSummary -> Rep ChannelFlowSummary x
Prelude.Generic)

-- |
-- Create a value of 'ChannelFlowSummary' 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:
--
-- 'processors', 'channelFlowSummary_processors' - Information about the processor Lambda functions.
--
-- 'channelFlowArn', 'channelFlowSummary_channelFlowArn' - The ARN of the channel flow.
--
-- 'name', 'channelFlowSummary_name' - The name of the channel flow.
newChannelFlowSummary ::
  ChannelFlowSummary
newChannelFlowSummary :: ChannelFlowSummary
newChannelFlowSummary =
  ChannelFlowSummary' :: Maybe (NonEmpty Processor)
-> Maybe Text -> Maybe (Sensitive Text) -> ChannelFlowSummary
ChannelFlowSummary'
    { $sel:processors:ChannelFlowSummary' :: Maybe (NonEmpty Processor)
processors = Maybe (NonEmpty Processor)
forall a. Maybe a
Prelude.Nothing,
      $sel:channelFlowArn:ChannelFlowSummary' :: Maybe Text
channelFlowArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ChannelFlowSummary' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | Information about the processor Lambda functions.
channelFlowSummary_processors :: Lens.Lens' ChannelFlowSummary (Prelude.Maybe (Prelude.NonEmpty Processor))
channelFlowSummary_processors :: (Maybe (NonEmpty Processor) -> f (Maybe (NonEmpty Processor)))
-> ChannelFlowSummary -> f ChannelFlowSummary
channelFlowSummary_processors = (ChannelFlowSummary -> Maybe (NonEmpty Processor))
-> (ChannelFlowSummary
    -> Maybe (NonEmpty Processor) -> ChannelFlowSummary)
-> Lens
     ChannelFlowSummary
     ChannelFlowSummary
     (Maybe (NonEmpty Processor))
     (Maybe (NonEmpty Processor))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelFlowSummary' {Maybe (NonEmpty Processor)
processors :: Maybe (NonEmpty Processor)
$sel:processors:ChannelFlowSummary' :: ChannelFlowSummary -> Maybe (NonEmpty Processor)
processors} -> Maybe (NonEmpty Processor)
processors) (\s :: ChannelFlowSummary
s@ChannelFlowSummary' {} Maybe (NonEmpty Processor)
a -> ChannelFlowSummary
s {$sel:processors:ChannelFlowSummary' :: Maybe (NonEmpty Processor)
processors = Maybe (NonEmpty Processor)
a} :: ChannelFlowSummary) ((Maybe (NonEmpty Processor) -> f (Maybe (NonEmpty Processor)))
 -> ChannelFlowSummary -> f ChannelFlowSummary)
-> ((Maybe (NonEmpty Processor) -> f (Maybe (NonEmpty Processor)))
    -> Maybe (NonEmpty Processor) -> f (Maybe (NonEmpty Processor)))
-> (Maybe (NonEmpty Processor) -> f (Maybe (NonEmpty Processor)))
-> ChannelFlowSummary
-> f ChannelFlowSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Processor)
  (NonEmpty Processor)
  (NonEmpty Processor)
  (NonEmpty Processor)
-> Iso
     (Maybe (NonEmpty Processor))
     (Maybe (NonEmpty Processor))
     (Maybe (NonEmpty Processor))
     (Maybe (NonEmpty Processor))
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
  (NonEmpty Processor)
  (NonEmpty Processor)
  (NonEmpty Processor)
  (NonEmpty Processor)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The name of the channel flow.
channelFlowSummary_name :: Lens.Lens' ChannelFlowSummary (Prelude.Maybe Prelude.Text)
channelFlowSummary_name :: (Maybe Text -> f (Maybe Text))
-> ChannelFlowSummary -> f ChannelFlowSummary
channelFlowSummary_name = (ChannelFlowSummary -> Maybe (Sensitive Text))
-> (ChannelFlowSummary
    -> Maybe (Sensitive Text) -> ChannelFlowSummary)
-> Lens
     ChannelFlowSummary
     ChannelFlowSummary
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelFlowSummary' {Maybe (Sensitive Text)
name :: Maybe (Sensitive Text)
$sel:name:ChannelFlowSummary' :: ChannelFlowSummary -> Maybe (Sensitive Text)
name} -> Maybe (Sensitive Text)
name) (\s :: ChannelFlowSummary
s@ChannelFlowSummary' {} Maybe (Sensitive Text)
a -> ChannelFlowSummary
s {$sel:name:ChannelFlowSummary' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
a} :: ChannelFlowSummary) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> ChannelFlowSummary -> f ChannelFlowSummary)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ChannelFlowSummary
-> f ChannelFlowSummary
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

instance Core.FromJSON ChannelFlowSummary where
  parseJSON :: Value -> Parser ChannelFlowSummary
parseJSON =
    String
-> (Object -> Parser ChannelFlowSummary)
-> Value
-> Parser ChannelFlowSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ChannelFlowSummary"
      ( \Object
x ->
          Maybe (NonEmpty Processor)
-> Maybe Text -> Maybe (Sensitive Text) -> ChannelFlowSummary
ChannelFlowSummary'
            (Maybe (NonEmpty Processor)
 -> Maybe Text -> Maybe (Sensitive Text) -> ChannelFlowSummary)
-> Parser (Maybe (NonEmpty Processor))
-> Parser
     (Maybe Text -> Maybe (Sensitive Text) -> ChannelFlowSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Processor))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Processors")
            Parser (Maybe Text -> Maybe (Sensitive Text) -> ChannelFlowSummary)
-> Parser (Maybe Text)
-> Parser (Maybe (Sensitive Text) -> ChannelFlowSummary)
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
"ChannelFlowArn")
            Parser (Maybe (Sensitive Text) -> ChannelFlowSummary)
-> Parser (Maybe (Sensitive Text)) -> Parser ChannelFlowSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
      )

instance Prelude.Hashable ChannelFlowSummary

instance Prelude.NFData ChannelFlowSummary