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

import Amazonka.Connect.Types.ContactFlowModuleState
import Amazonka.Connect.Types.ContactFlowModuleStatus
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 information about a flow module.
--
-- /See:/ 'newContactFlowModule' smart constructor.
data ContactFlowModule = ContactFlowModule'
  { -- | The Amazon Resource Name (ARN).
    ContactFlowModule -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The content of the flow module.
    ContactFlowModule -> Maybe Text
content :: Prelude.Maybe Prelude.Text,
    -- | The description of the flow module.
    ContactFlowModule -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the flow module.
    ContactFlowModule -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the flow module.
    ContactFlowModule -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The type of flow module.
    ContactFlowModule -> Maybe ContactFlowModuleState
state :: Prelude.Maybe ContactFlowModuleState,
    -- | The status of the flow module.
    ContactFlowModule -> Maybe ContactFlowModuleStatus
status :: Prelude.Maybe ContactFlowModuleStatus,
    -- | The tags used to organize, track, or control access for this resource.
    -- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
    ContactFlowModule -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (ContactFlowModule -> ContactFlowModule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContactFlowModule -> ContactFlowModule -> Bool
$c/= :: ContactFlowModule -> ContactFlowModule -> Bool
== :: ContactFlowModule -> ContactFlowModule -> Bool
$c== :: ContactFlowModule -> ContactFlowModule -> Bool
Prelude.Eq, ReadPrec [ContactFlowModule]
ReadPrec ContactFlowModule
Int -> ReadS ContactFlowModule
ReadS [ContactFlowModule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContactFlowModule]
$creadListPrec :: ReadPrec [ContactFlowModule]
readPrec :: ReadPrec ContactFlowModule
$creadPrec :: ReadPrec ContactFlowModule
readList :: ReadS [ContactFlowModule]
$creadList :: ReadS [ContactFlowModule]
readsPrec :: Int -> ReadS ContactFlowModule
$creadsPrec :: Int -> ReadS ContactFlowModule
Prelude.Read, Int -> ContactFlowModule -> ShowS
[ContactFlowModule] -> ShowS
ContactFlowModule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContactFlowModule] -> ShowS
$cshowList :: [ContactFlowModule] -> ShowS
show :: ContactFlowModule -> String
$cshow :: ContactFlowModule -> String
showsPrec :: Int -> ContactFlowModule -> ShowS
$cshowsPrec :: Int -> ContactFlowModule -> ShowS
Prelude.Show, forall x. Rep ContactFlowModule x -> ContactFlowModule
forall x. ContactFlowModule -> Rep ContactFlowModule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContactFlowModule x -> ContactFlowModule
$cfrom :: forall x. ContactFlowModule -> Rep ContactFlowModule x
Prelude.Generic)

-- |
-- Create a value of 'ContactFlowModule' 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', 'contactFlowModule_arn' - The Amazon Resource Name (ARN).
--
-- 'content', 'contactFlowModule_content' - The content of the flow module.
--
-- 'description', 'contactFlowModule_description' - The description of the flow module.
--
-- 'id', 'contactFlowModule_id' - The identifier of the flow module.
--
-- 'name', 'contactFlowModule_name' - The name of the flow module.
--
-- 'state', 'contactFlowModule_state' - The type of flow module.
--
-- 'status', 'contactFlowModule_status' - The status of the flow module.
--
-- 'tags', 'contactFlowModule_tags' - The tags used to organize, track, or control access for this resource.
-- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
newContactFlowModule ::
  ContactFlowModule
newContactFlowModule :: ContactFlowModule
newContactFlowModule =
  ContactFlowModule'
    { $sel:arn:ContactFlowModule' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:content:ContactFlowModule' :: Maybe Text
content = forall a. Maybe a
Prelude.Nothing,
      $sel:description:ContactFlowModule' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:id:ContactFlowModule' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ContactFlowModule' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:state:ContactFlowModule' :: Maybe ContactFlowModuleState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:status:ContactFlowModule' :: Maybe ContactFlowModuleStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:ContactFlowModule' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing
    }

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

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

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

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

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

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

-- | The status of the flow module.
contactFlowModule_status :: Lens.Lens' ContactFlowModule (Prelude.Maybe ContactFlowModuleStatus)
contactFlowModule_status :: Lens' ContactFlowModule (Maybe ContactFlowModuleStatus)
contactFlowModule_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactFlowModule' {Maybe ContactFlowModuleStatus
status :: Maybe ContactFlowModuleStatus
$sel:status:ContactFlowModule' :: ContactFlowModule -> Maybe ContactFlowModuleStatus
status} -> Maybe ContactFlowModuleStatus
status) (\s :: ContactFlowModule
s@ContactFlowModule' {} Maybe ContactFlowModuleStatus
a -> ContactFlowModule
s {$sel:status:ContactFlowModule' :: Maybe ContactFlowModuleStatus
status = Maybe ContactFlowModuleStatus
a} :: ContactFlowModule)

-- | The tags used to organize, track, or control access for this resource.
-- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
contactFlowModule_tags :: Lens.Lens' ContactFlowModule (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
contactFlowModule_tags :: Lens' ContactFlowModule (Maybe (HashMap Text Text))
contactFlowModule_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactFlowModule' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ContactFlowModule' :: ContactFlowModule -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ContactFlowModule
s@ContactFlowModule' {} Maybe (HashMap Text Text)
a -> ContactFlowModule
s {$sel:tags:ContactFlowModule' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ContactFlowModule) 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 ContactFlowModule where
  parseJSON :: Value -> Parser ContactFlowModule
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ContactFlowModule"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ContactFlowModuleState
-> Maybe ContactFlowModuleStatus
-> Maybe (HashMap Text Text)
-> ContactFlowModule
ContactFlowModule'
            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
"Content")
            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
"Description")
            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")
            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
"Status")
            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
"Tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ContactFlowModule where
  hashWithSalt :: Int -> ContactFlowModule -> Int
hashWithSalt Int
_salt ContactFlowModule' {Maybe Text
Maybe (HashMap Text Text)
Maybe ContactFlowModuleState
Maybe ContactFlowModuleStatus
tags :: Maybe (HashMap Text Text)
status :: Maybe ContactFlowModuleStatus
state :: Maybe ContactFlowModuleState
name :: Maybe Text
id :: Maybe Text
description :: Maybe Text
content :: Maybe Text
arn :: Maybe Text
$sel:tags:ContactFlowModule' :: ContactFlowModule -> Maybe (HashMap Text Text)
$sel:status:ContactFlowModule' :: ContactFlowModule -> Maybe ContactFlowModuleStatus
$sel:state:ContactFlowModule' :: ContactFlowModule -> Maybe ContactFlowModuleState
$sel:name:ContactFlowModule' :: ContactFlowModule -> Maybe Text
$sel:id:ContactFlowModule' :: ContactFlowModule -> Maybe Text
$sel:description:ContactFlowModule' :: ContactFlowModule -> Maybe Text
$sel:content:ContactFlowModule' :: ContactFlowModule -> Maybe Text
$sel:arn:ContactFlowModule' :: ContactFlowModule -> 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
content
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      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
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContactFlowModuleStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags

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