{-# 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.Connect.Types.ContactFlowSummary
-- 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.Connect.Types.ContactFlowSummary where

import Amazonka.Connect.Types.ContactFlowState
import Amazonka.Connect.Types.ContactFlowType
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

-- | Contains summary information about a flow.
--
-- You can also create and update flows using the
-- <https://docs.aws.amazon.com/connect/latest/APIReference/flow-language.html Amazon Connect Flow language>.
--
-- /See:/ 'newContactFlowSummary' smart constructor.
data ContactFlowSummary = ContactFlowSummary'
  { -- | The Amazon Resource Name (ARN) of the flow.
    ContactFlowSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The type of flow.
    ContactFlowSummary -> Maybe ContactFlowState
contactFlowState :: Prelude.Maybe ContactFlowState,
    -- | The type of flow.
    ContactFlowSummary -> Maybe ContactFlowType
contactFlowType :: Prelude.Maybe ContactFlowType,
    -- | The identifier of the flow.
    ContactFlowSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the flow.
    ContactFlowSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (ContactFlowSummary -> ContactFlowSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContactFlowSummary -> ContactFlowSummary -> Bool
$c/= :: ContactFlowSummary -> ContactFlowSummary -> Bool
== :: ContactFlowSummary -> ContactFlowSummary -> Bool
$c== :: ContactFlowSummary -> ContactFlowSummary -> Bool
Prelude.Eq, ReadPrec [ContactFlowSummary]
ReadPrec ContactFlowSummary
Int -> ReadS ContactFlowSummary
ReadS [ContactFlowSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContactFlowSummary]
$creadListPrec :: ReadPrec [ContactFlowSummary]
readPrec :: ReadPrec ContactFlowSummary
$creadPrec :: ReadPrec ContactFlowSummary
readList :: ReadS [ContactFlowSummary]
$creadList :: ReadS [ContactFlowSummary]
readsPrec :: Int -> ReadS ContactFlowSummary
$creadsPrec :: Int -> ReadS ContactFlowSummary
Prelude.Read, Int -> ContactFlowSummary -> ShowS
[ContactFlowSummary] -> ShowS
ContactFlowSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContactFlowSummary] -> ShowS
$cshowList :: [ContactFlowSummary] -> ShowS
show :: ContactFlowSummary -> String
$cshow :: ContactFlowSummary -> String
showsPrec :: Int -> ContactFlowSummary -> ShowS
$cshowsPrec :: Int -> ContactFlowSummary -> ShowS
Prelude.Show, forall x. Rep ContactFlowSummary x -> ContactFlowSummary
forall x. ContactFlowSummary -> Rep ContactFlowSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContactFlowSummary x -> ContactFlowSummary
$cfrom :: forall x. ContactFlowSummary -> Rep ContactFlowSummary x
Prelude.Generic)

-- |
-- Create a value of 'ContactFlowSummary' 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:
--
-- 'arn', 'contactFlowSummary_arn' - The Amazon Resource Name (ARN) of the flow.
--
-- 'contactFlowState', 'contactFlowSummary_contactFlowState' - The type of flow.
--
-- 'contactFlowType', 'contactFlowSummary_contactFlowType' - The type of flow.
--
-- 'id', 'contactFlowSummary_id' - The identifier of the flow.
--
-- 'name', 'contactFlowSummary_name' - The name of the flow.
newContactFlowSummary ::
  ContactFlowSummary
newContactFlowSummary :: ContactFlowSummary
newContactFlowSummary =
  ContactFlowSummary'
    { $sel:arn:ContactFlowSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:contactFlowState:ContactFlowSummary' :: Maybe ContactFlowState
contactFlowState = forall a. Maybe a
Prelude.Nothing,
      $sel:contactFlowType:ContactFlowSummary' :: Maybe ContactFlowType
contactFlowType = forall a. Maybe a
Prelude.Nothing,
      $sel:id:ContactFlowSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ContactFlowSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the flow.
contactFlowSummary_arn :: Lens.Lens' ContactFlowSummary (Prelude.Maybe Prelude.Text)
contactFlowSummary_arn :: Lens' ContactFlowSummary (Maybe Text)
contactFlowSummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactFlowSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:ContactFlowSummary' :: ContactFlowSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ContactFlowSummary
s@ContactFlowSummary' {} Maybe Text
a -> ContactFlowSummary
s {$sel:arn:ContactFlowSummary' :: Maybe Text
arn = Maybe Text
a} :: ContactFlowSummary)

-- | The type of flow.
contactFlowSummary_contactFlowState :: Lens.Lens' ContactFlowSummary (Prelude.Maybe ContactFlowState)
contactFlowSummary_contactFlowState :: Lens' ContactFlowSummary (Maybe ContactFlowState)
contactFlowSummary_contactFlowState = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactFlowSummary' {Maybe ContactFlowState
contactFlowState :: Maybe ContactFlowState
$sel:contactFlowState:ContactFlowSummary' :: ContactFlowSummary -> Maybe ContactFlowState
contactFlowState} -> Maybe ContactFlowState
contactFlowState) (\s :: ContactFlowSummary
s@ContactFlowSummary' {} Maybe ContactFlowState
a -> ContactFlowSummary
s {$sel:contactFlowState:ContactFlowSummary' :: Maybe ContactFlowState
contactFlowState = Maybe ContactFlowState
a} :: ContactFlowSummary)

-- | The type of flow.
contactFlowSummary_contactFlowType :: Lens.Lens' ContactFlowSummary (Prelude.Maybe ContactFlowType)
contactFlowSummary_contactFlowType :: Lens' ContactFlowSummary (Maybe ContactFlowType)
contactFlowSummary_contactFlowType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactFlowSummary' {Maybe ContactFlowType
contactFlowType :: Maybe ContactFlowType
$sel:contactFlowType:ContactFlowSummary' :: ContactFlowSummary -> Maybe ContactFlowType
contactFlowType} -> Maybe ContactFlowType
contactFlowType) (\s :: ContactFlowSummary
s@ContactFlowSummary' {} Maybe ContactFlowType
a -> ContactFlowSummary
s {$sel:contactFlowType:ContactFlowSummary' :: Maybe ContactFlowType
contactFlowType = Maybe ContactFlowType
a} :: ContactFlowSummary)

-- | The identifier of the flow.
contactFlowSummary_id :: Lens.Lens' ContactFlowSummary (Prelude.Maybe Prelude.Text)
contactFlowSummary_id :: Lens' ContactFlowSummary (Maybe Text)
contactFlowSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactFlowSummary' {Maybe Text
id :: Maybe Text
$sel:id:ContactFlowSummary' :: ContactFlowSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: ContactFlowSummary
s@ContactFlowSummary' {} Maybe Text
a -> ContactFlowSummary
s {$sel:id:ContactFlowSummary' :: Maybe Text
id = Maybe Text
a} :: ContactFlowSummary)

-- | The name of the flow.
contactFlowSummary_name :: Lens.Lens' ContactFlowSummary (Prelude.Maybe Prelude.Text)
contactFlowSummary_name :: Lens' ContactFlowSummary (Maybe Text)
contactFlowSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactFlowSummary' {Maybe Text
name :: Maybe Text
$sel:name:ContactFlowSummary' :: ContactFlowSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: ContactFlowSummary
s@ContactFlowSummary' {} Maybe Text
a -> ContactFlowSummary
s {$sel:name:ContactFlowSummary' :: Maybe Text
name = Maybe Text
a} :: ContactFlowSummary)

instance Data.FromJSON ContactFlowSummary where
  parseJSON :: Value -> Parser ContactFlowSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ContactFlowSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe ContactFlowState
-> Maybe ContactFlowType
-> Maybe Text
-> Maybe Text
-> ContactFlowSummary
ContactFlowSummary'
            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
"Arn")
            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
"ContactFlowState")
            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
"ContactFlowType")
            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
"Id")
            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")
      )

instance Prelude.Hashable ContactFlowSummary where
  hashWithSalt :: Int -> ContactFlowSummary -> Int
hashWithSalt Int
_salt ContactFlowSummary' {Maybe Text
Maybe ContactFlowState
Maybe ContactFlowType
name :: Maybe Text
id :: Maybe Text
contactFlowType :: Maybe ContactFlowType
contactFlowState :: Maybe ContactFlowState
arn :: Maybe Text
$sel:name:ContactFlowSummary' :: ContactFlowSummary -> Maybe Text
$sel:id:ContactFlowSummary' :: ContactFlowSummary -> Maybe Text
$sel:contactFlowType:ContactFlowSummary' :: ContactFlowSummary -> Maybe ContactFlowType
$sel:contactFlowState:ContactFlowSummary' :: ContactFlowSummary -> Maybe ContactFlowState
$sel:arn:ContactFlowSummary' :: ContactFlowSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContactFlowState
contactFlowState
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContactFlowType
contactFlowType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData ContactFlowSummary where
  rnf :: ContactFlowSummary -> ()
rnf ContactFlowSummary' {Maybe Text
Maybe ContactFlowState
Maybe ContactFlowType
name :: Maybe Text
id :: Maybe Text
contactFlowType :: Maybe ContactFlowType
contactFlowState :: Maybe ContactFlowState
arn :: Maybe Text
$sel:name:ContactFlowSummary' :: ContactFlowSummary -> Maybe Text
$sel:id:ContactFlowSummary' :: ContactFlowSummary -> Maybe Text
$sel:contactFlowType:ContactFlowSummary' :: ContactFlowSummary -> Maybe ContactFlowType
$sel:contactFlowState:ContactFlowSummary' :: ContactFlowSummary -> Maybe ContactFlowState
$sel:arn:ContactFlowSummary' :: ContactFlowSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ContactFlowState
contactFlowState
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ContactFlowType
contactFlowType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name