{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Summary of details of a channel flow.
--
-- /See:/ 'newChannelFlowSummary' smart constructor.
data ChannelFlowSummary = ChannelFlowSummary'
  { -- | 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 (Data.Sensitive Prelude.Text),
    -- | Information about the processor Lambda functions.
    ChannelFlowSummary -> Maybe (NonEmpty Processor)
processors :: Prelude.Maybe (Prelude.NonEmpty Processor)
  }
  deriving (ChannelFlowSummary -> ChannelFlowSummary -> Bool
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
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. 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:
--
-- 'channelFlowArn', 'channelFlowSummary_channelFlowArn' - The ARN of the channel flow.
--
-- 'name', 'channelFlowSummary_name' - The name of the channel flow.
--
-- 'processors', 'channelFlowSummary_processors' - Information about the processor Lambda functions.
newChannelFlowSummary ::
  ChannelFlowSummary
newChannelFlowSummary :: ChannelFlowSummary
newChannelFlowSummary =
  ChannelFlowSummary'
    { $sel:channelFlowArn:ChannelFlowSummary' :: Maybe Text
channelFlowArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:name:ChannelFlowSummary' :: Maybe (Sensitive Text)
name = forall a. Maybe a
Prelude.Nothing,
      $sel:processors:ChannelFlowSummary' :: Maybe (NonEmpty Processor)
processors = forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the channel flow.
channelFlowSummary_channelFlowArn :: Lens.Lens' ChannelFlowSummary (Prelude.Maybe Prelude.Text)
channelFlowSummary_channelFlowArn :: Lens' ChannelFlowSummary (Maybe Text)
channelFlowSummary_channelFlowArn = 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 :: Lens' ChannelFlowSummary (Maybe Text)
channelFlowSummary_name = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | Information about the processor Lambda functions.
channelFlowSummary_processors :: Lens.Lens' ChannelFlowSummary (Prelude.Maybe (Prelude.NonEmpty Processor))
channelFlowSummary_processors :: Lens' ChannelFlowSummary (Maybe (NonEmpty Processor))
channelFlowSummary_processors = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable ChannelFlowSummary where
  hashWithSalt :: Int -> ChannelFlowSummary -> Int
hashWithSalt Int
_salt ChannelFlowSummary' {Maybe (NonEmpty Processor)
Maybe Text
Maybe (Sensitive Text)
processors :: Maybe (NonEmpty Processor)
name :: Maybe (Sensitive Text)
channelFlowArn :: Maybe Text
$sel:processors:ChannelFlowSummary' :: ChannelFlowSummary -> Maybe (NonEmpty Processor)
$sel:name:ChannelFlowSummary' :: ChannelFlowSummary -> Maybe (Sensitive Text)
$sel:channelFlowArn:ChannelFlowSummary' :: ChannelFlowSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
channelFlowArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Processor)
processors

instance Prelude.NFData ChannelFlowSummary where
  rnf :: ChannelFlowSummary -> ()
rnf ChannelFlowSummary' {Maybe (NonEmpty Processor)
Maybe Text
Maybe (Sensitive Text)
processors :: Maybe (NonEmpty Processor)
name :: Maybe (Sensitive Text)
channelFlowArn :: Maybe Text
$sel:processors:ChannelFlowSummary' :: ChannelFlowSummary -> Maybe (NonEmpty Processor)
$sel:name:ChannelFlowSummary' :: ChannelFlowSummary -> Maybe (Sensitive Text)
$sel:channelFlowArn:ChannelFlowSummary' :: ChannelFlowSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
channelFlowArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Processor)
processors