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

import Amazonka.Connect.Types.ContactFlowType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains summary information about a contact flow.
--
-- You can also create and update contact flows using the
-- <https://docs.aws.amazon.com/connect/latest/adminguide/flow-language.html Amazon Connect Flow language>.
--
-- /See:/ 'newContactFlowSummary' smart constructor.
data ContactFlowSummary = ContactFlowSummary'
  { -- | The Amazon Resource Name (ARN) of the contact flow.
    ContactFlowSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The name of the contact flow.
    ContactFlowSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The type of contact flow.
    ContactFlowSummary -> Maybe ContactFlowType
contactFlowType :: Prelude.Maybe ContactFlowType,
    -- | The identifier of the contact flow.
    ContactFlowSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (ContactFlowSummary -> ContactFlowSummary -> Bool
(ContactFlowSummary -> ContactFlowSummary -> Bool)
-> (ContactFlowSummary -> ContactFlowSummary -> Bool)
-> Eq ContactFlowSummary
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]
(Int -> ReadS ContactFlowSummary)
-> ReadS [ContactFlowSummary]
-> ReadPrec ContactFlowSummary
-> ReadPrec [ContactFlowSummary]
-> Read 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
(Int -> ContactFlowSummary -> ShowS)
-> (ContactFlowSummary -> String)
-> ([ContactFlowSummary] -> ShowS)
-> Show ContactFlowSummary
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. ContactFlowSummary -> Rep ContactFlowSummary x)
-> (forall x. Rep ContactFlowSummary x -> ContactFlowSummary)
-> Generic ContactFlowSummary
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 contact flow.
--
-- 'name', 'contactFlowSummary_name' - The name of the contact flow.
--
-- 'contactFlowType', 'contactFlowSummary_contactFlowType' - The type of contact flow.
--
-- 'id', 'contactFlowSummary_id' - The identifier of the contact flow.
newContactFlowSummary ::
  ContactFlowSummary
newContactFlowSummary :: ContactFlowSummary
newContactFlowSummary =
  ContactFlowSummary' :: Maybe Text
-> Maybe Text
-> Maybe ContactFlowType
-> Maybe Text
-> ContactFlowSummary
ContactFlowSummary'
    { $sel:arn:ContactFlowSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ContactFlowSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contactFlowType:ContactFlowSummary' :: Maybe ContactFlowType
contactFlowType = Maybe ContactFlowType
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ContactFlowSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the contact flow.
contactFlowSummary_arn :: Lens.Lens' ContactFlowSummary (Prelude.Maybe Prelude.Text)
contactFlowSummary_arn :: (Maybe Text -> f (Maybe Text))
-> ContactFlowSummary -> f ContactFlowSummary
contactFlowSummary_arn = (ContactFlowSummary -> Maybe Text)
-> (ContactFlowSummary -> Maybe Text -> ContactFlowSummary)
-> Lens
     ContactFlowSummary ContactFlowSummary (Maybe Text) (Maybe Text)
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 name of the contact flow.
contactFlowSummary_name :: Lens.Lens' ContactFlowSummary (Prelude.Maybe Prelude.Text)
contactFlowSummary_name :: (Maybe Text -> f (Maybe Text))
-> ContactFlowSummary -> f ContactFlowSummary
contactFlowSummary_name = (ContactFlowSummary -> Maybe Text)
-> (ContactFlowSummary -> Maybe Text -> ContactFlowSummary)
-> Lens
     ContactFlowSummary ContactFlowSummary (Maybe Text) (Maybe Text)
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)

-- | The type of contact flow.
contactFlowSummary_contactFlowType :: Lens.Lens' ContactFlowSummary (Prelude.Maybe ContactFlowType)
contactFlowSummary_contactFlowType :: (Maybe ContactFlowType -> f (Maybe ContactFlowType))
-> ContactFlowSummary -> f ContactFlowSummary
contactFlowSummary_contactFlowType = (ContactFlowSummary -> Maybe ContactFlowType)
-> (ContactFlowSummary
    -> Maybe ContactFlowType -> ContactFlowSummary)
-> Lens
     ContactFlowSummary
     ContactFlowSummary
     (Maybe ContactFlowType)
     (Maybe 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 contact flow.
contactFlowSummary_id :: Lens.Lens' ContactFlowSummary (Prelude.Maybe Prelude.Text)
contactFlowSummary_id :: (Maybe Text -> f (Maybe Text))
-> ContactFlowSummary -> f ContactFlowSummary
contactFlowSummary_id = (ContactFlowSummary -> Maybe Text)
-> (ContactFlowSummary -> Maybe Text -> ContactFlowSummary)
-> Lens
     ContactFlowSummary ContactFlowSummary (Maybe Text) (Maybe Text)
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)

instance Core.FromJSON ContactFlowSummary where
  parseJSON :: Value -> Parser ContactFlowSummary
parseJSON =
    String
-> (Object -> Parser ContactFlowSummary)
-> Value
-> Parser ContactFlowSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ContactFlowSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe ContactFlowType
-> Maybe Text
-> ContactFlowSummary
ContactFlowSummary'
            (Maybe Text
 -> Maybe Text
 -> Maybe ContactFlowType
 -> Maybe Text
 -> ContactFlowSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ContactFlowType -> Maybe Text -> ContactFlowSummary)
forall (f :: * -> *) a b. Functor 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
"Arn")
            Parser
  (Maybe Text
   -> Maybe ContactFlowType -> Maybe Text -> ContactFlowSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe ContactFlowType -> Maybe Text -> ContactFlowSummary)
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
"Name")
            Parser (Maybe ContactFlowType -> Maybe Text -> ContactFlowSummary)
-> Parser (Maybe ContactFlowType)
-> Parser (Maybe Text -> ContactFlowSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ContactFlowType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ContactFlowType")
            Parser (Maybe Text -> ContactFlowSummary)
-> Parser (Maybe Text) -> Parser ContactFlowSummary
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
"Id")
      )

instance Prelude.Hashable ContactFlowSummary

instance Prelude.NFData ContactFlowSummary