{-# 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.ContactFlowModuleSummary
-- 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.ContactFlowModuleSummary where

import Amazonka.Connect.Types.ContactFlowModuleState
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.
--
-- /See:/ 'newContactFlowModuleSummary' smart constructor.
data ContactFlowModuleSummary = ContactFlowModuleSummary'
  { -- | The Amazon Resource Name (ARN) of the flow module.
    ContactFlowModuleSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the flow module.
    ContactFlowModuleSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the flow module.
    ContactFlowModuleSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The type of flow module.
    ContactFlowModuleSummary -> Maybe ContactFlowModuleState
state :: Prelude.Maybe ContactFlowModuleState
  }
  deriving (ContactFlowModuleSummary -> ContactFlowModuleSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContactFlowModuleSummary -> ContactFlowModuleSummary -> Bool
$c/= :: ContactFlowModuleSummary -> ContactFlowModuleSummary -> Bool
== :: ContactFlowModuleSummary -> ContactFlowModuleSummary -> Bool
$c== :: ContactFlowModuleSummary -> ContactFlowModuleSummary -> Bool
Prelude.Eq, ReadPrec [ContactFlowModuleSummary]
ReadPrec ContactFlowModuleSummary
Int -> ReadS ContactFlowModuleSummary
ReadS [ContactFlowModuleSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContactFlowModuleSummary]
$creadListPrec :: ReadPrec [ContactFlowModuleSummary]
readPrec :: ReadPrec ContactFlowModuleSummary
$creadPrec :: ReadPrec ContactFlowModuleSummary
readList :: ReadS [ContactFlowModuleSummary]
$creadList :: ReadS [ContactFlowModuleSummary]
readsPrec :: Int -> ReadS ContactFlowModuleSummary
$creadsPrec :: Int -> ReadS ContactFlowModuleSummary
Prelude.Read, Int -> ContactFlowModuleSummary -> ShowS
[ContactFlowModuleSummary] -> ShowS
ContactFlowModuleSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContactFlowModuleSummary] -> ShowS
$cshowList :: [ContactFlowModuleSummary] -> ShowS
show :: ContactFlowModuleSummary -> String
$cshow :: ContactFlowModuleSummary -> String
showsPrec :: Int -> ContactFlowModuleSummary -> ShowS
$cshowsPrec :: Int -> ContactFlowModuleSummary -> ShowS
Prelude.Show, forall x.
Rep ContactFlowModuleSummary x -> ContactFlowModuleSummary
forall x.
ContactFlowModuleSummary -> Rep ContactFlowModuleSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ContactFlowModuleSummary x -> ContactFlowModuleSummary
$cfrom :: forall x.
ContactFlowModuleSummary -> Rep ContactFlowModuleSummary x
Prelude.Generic)

-- |
-- Create a value of 'ContactFlowModuleSummary' 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', 'contactFlowModuleSummary_arn' - The Amazon Resource Name (ARN) of the flow module.
--
-- 'id', 'contactFlowModuleSummary_id' - The identifier of the flow module.
--
-- 'name', 'contactFlowModuleSummary_name' - The name of the flow module.
--
-- 'state', 'contactFlowModuleSummary_state' - The type of flow module.
newContactFlowModuleSummary ::
  ContactFlowModuleSummary
newContactFlowModuleSummary :: ContactFlowModuleSummary
newContactFlowModuleSummary =
  ContactFlowModuleSummary'
    { $sel:arn:ContactFlowModuleSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:id:ContactFlowModuleSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ContactFlowModuleSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:state:ContactFlowModuleSummary' :: Maybe ContactFlowModuleState
state = forall a. Maybe a
Prelude.Nothing
    }

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

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

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

-- | The type of flow module.
contactFlowModuleSummary_state :: Lens.Lens' ContactFlowModuleSummary (Prelude.Maybe ContactFlowModuleState)
contactFlowModuleSummary_state :: Lens' ContactFlowModuleSummary (Maybe ContactFlowModuleState)
contactFlowModuleSummary_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactFlowModuleSummary' {Maybe ContactFlowModuleState
state :: Maybe ContactFlowModuleState
$sel:state:ContactFlowModuleSummary' :: ContactFlowModuleSummary -> Maybe ContactFlowModuleState
state} -> Maybe ContactFlowModuleState
state) (\s :: ContactFlowModuleSummary
s@ContactFlowModuleSummary' {} Maybe ContactFlowModuleState
a -> ContactFlowModuleSummary
s {$sel:state:ContactFlowModuleSummary' :: Maybe ContactFlowModuleState
state = Maybe ContactFlowModuleState
a} :: ContactFlowModuleSummary)

instance Data.FromJSON ContactFlowModuleSummary where
  parseJSON :: Value -> Parser ContactFlowModuleSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ContactFlowModuleSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ContactFlowModuleState
-> ContactFlowModuleSummary
ContactFlowModuleSummary'
            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
"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")
            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
"State")
      )

instance Prelude.Hashable ContactFlowModuleSummary where
  hashWithSalt :: Int -> ContactFlowModuleSummary -> Int
hashWithSalt Int
_salt ContactFlowModuleSummary' {Maybe Text
Maybe ContactFlowModuleState
state :: Maybe ContactFlowModuleState
name :: Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:state:ContactFlowModuleSummary' :: ContactFlowModuleSummary -> Maybe ContactFlowModuleState
$sel:name:ContactFlowModuleSummary' :: ContactFlowModuleSummary -> Maybe Text
$sel:id:ContactFlowModuleSummary' :: ContactFlowModuleSummary -> Maybe Text
$sel:arn:ContactFlowModuleSummary' :: ContactFlowModuleSummary -> 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 Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContactFlowModuleState
state

instance Prelude.NFData ContactFlowModuleSummary where
  rnf :: ContactFlowModuleSummary -> ()
rnf ContactFlowModuleSummary' {Maybe Text
Maybe ContactFlowModuleState
state :: Maybe ContactFlowModuleState
name :: Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:state:ContactFlowModuleSummary' :: ContactFlowModuleSummary -> Maybe ContactFlowModuleState
$sel:name:ContactFlowModuleSummary' :: ContactFlowModuleSummary -> Maybe Text
$sel:id:ContactFlowModuleSummary' :: ContactFlowModuleSummary -> Maybe Text
$sel:arn:ContactFlowModuleSummary' :: ContactFlowModuleSummary -> 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 Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ContactFlowModuleState
state