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

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

-- | The outbound caller ID name, number, and outbound whisper flow.
--
-- /See:/ 'newOutboundCallerConfig' smart constructor.
data OutboundCallerConfig = OutboundCallerConfig'
  { -- | The caller ID name.
    OutboundCallerConfig -> Maybe Text
outboundCallerIdName :: Prelude.Maybe Prelude.Text,
    -- | The caller ID number.
    OutboundCallerConfig -> Maybe Text
outboundCallerIdNumberId :: Prelude.Maybe Prelude.Text,
    -- | The outbound whisper flow to be used during an outbound call.
    OutboundCallerConfig -> Maybe Text
outboundFlowId :: Prelude.Maybe Prelude.Text
  }
  deriving (OutboundCallerConfig -> OutboundCallerConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OutboundCallerConfig -> OutboundCallerConfig -> Bool
$c/= :: OutboundCallerConfig -> OutboundCallerConfig -> Bool
== :: OutboundCallerConfig -> OutboundCallerConfig -> Bool
$c== :: OutboundCallerConfig -> OutboundCallerConfig -> Bool
Prelude.Eq, ReadPrec [OutboundCallerConfig]
ReadPrec OutboundCallerConfig
Int -> ReadS OutboundCallerConfig
ReadS [OutboundCallerConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OutboundCallerConfig]
$creadListPrec :: ReadPrec [OutboundCallerConfig]
readPrec :: ReadPrec OutboundCallerConfig
$creadPrec :: ReadPrec OutboundCallerConfig
readList :: ReadS [OutboundCallerConfig]
$creadList :: ReadS [OutboundCallerConfig]
readsPrec :: Int -> ReadS OutboundCallerConfig
$creadsPrec :: Int -> ReadS OutboundCallerConfig
Prelude.Read, Int -> OutboundCallerConfig -> ShowS
[OutboundCallerConfig] -> ShowS
OutboundCallerConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OutboundCallerConfig] -> ShowS
$cshowList :: [OutboundCallerConfig] -> ShowS
show :: OutboundCallerConfig -> String
$cshow :: OutboundCallerConfig -> String
showsPrec :: Int -> OutboundCallerConfig -> ShowS
$cshowsPrec :: Int -> OutboundCallerConfig -> ShowS
Prelude.Show, forall x. Rep OutboundCallerConfig x -> OutboundCallerConfig
forall x. OutboundCallerConfig -> Rep OutboundCallerConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OutboundCallerConfig x -> OutboundCallerConfig
$cfrom :: forall x. OutboundCallerConfig -> Rep OutboundCallerConfig x
Prelude.Generic)

-- |
-- Create a value of 'OutboundCallerConfig' 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:
--
-- 'outboundCallerIdName', 'outboundCallerConfig_outboundCallerIdName' - The caller ID name.
--
-- 'outboundCallerIdNumberId', 'outboundCallerConfig_outboundCallerIdNumberId' - The caller ID number.
--
-- 'outboundFlowId', 'outboundCallerConfig_outboundFlowId' - The outbound whisper flow to be used during an outbound call.
newOutboundCallerConfig ::
  OutboundCallerConfig
newOutboundCallerConfig :: OutboundCallerConfig
newOutboundCallerConfig =
  OutboundCallerConfig'
    { $sel:outboundCallerIdName:OutboundCallerConfig' :: Maybe Text
outboundCallerIdName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:outboundCallerIdNumberId:OutboundCallerConfig' :: Maybe Text
outboundCallerIdNumberId = forall a. Maybe a
Prelude.Nothing,
      $sel:outboundFlowId:OutboundCallerConfig' :: Maybe Text
outboundFlowId = forall a. Maybe a
Prelude.Nothing
    }

-- | The caller ID name.
outboundCallerConfig_outboundCallerIdName :: Lens.Lens' OutboundCallerConfig (Prelude.Maybe Prelude.Text)
outboundCallerConfig_outboundCallerIdName :: Lens' OutboundCallerConfig (Maybe Text)
outboundCallerConfig_outboundCallerIdName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutboundCallerConfig' {Maybe Text
outboundCallerIdName :: Maybe Text
$sel:outboundCallerIdName:OutboundCallerConfig' :: OutboundCallerConfig -> Maybe Text
outboundCallerIdName} -> Maybe Text
outboundCallerIdName) (\s :: OutboundCallerConfig
s@OutboundCallerConfig' {} Maybe Text
a -> OutboundCallerConfig
s {$sel:outboundCallerIdName:OutboundCallerConfig' :: Maybe Text
outboundCallerIdName = Maybe Text
a} :: OutboundCallerConfig)

-- | The caller ID number.
outboundCallerConfig_outboundCallerIdNumberId :: Lens.Lens' OutboundCallerConfig (Prelude.Maybe Prelude.Text)
outboundCallerConfig_outboundCallerIdNumberId :: Lens' OutboundCallerConfig (Maybe Text)
outboundCallerConfig_outboundCallerIdNumberId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutboundCallerConfig' {Maybe Text
outboundCallerIdNumberId :: Maybe Text
$sel:outboundCallerIdNumberId:OutboundCallerConfig' :: OutboundCallerConfig -> Maybe Text
outboundCallerIdNumberId} -> Maybe Text
outboundCallerIdNumberId) (\s :: OutboundCallerConfig
s@OutboundCallerConfig' {} Maybe Text
a -> OutboundCallerConfig
s {$sel:outboundCallerIdNumberId:OutboundCallerConfig' :: Maybe Text
outboundCallerIdNumberId = Maybe Text
a} :: OutboundCallerConfig)

-- | The outbound whisper flow to be used during an outbound call.
outboundCallerConfig_outboundFlowId :: Lens.Lens' OutboundCallerConfig (Prelude.Maybe Prelude.Text)
outboundCallerConfig_outboundFlowId :: Lens' OutboundCallerConfig (Maybe Text)
outboundCallerConfig_outboundFlowId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutboundCallerConfig' {Maybe Text
outboundFlowId :: Maybe Text
$sel:outboundFlowId:OutboundCallerConfig' :: OutboundCallerConfig -> Maybe Text
outboundFlowId} -> Maybe Text
outboundFlowId) (\s :: OutboundCallerConfig
s@OutboundCallerConfig' {} Maybe Text
a -> OutboundCallerConfig
s {$sel:outboundFlowId:OutboundCallerConfig' :: Maybe Text
outboundFlowId = Maybe Text
a} :: OutboundCallerConfig)

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

instance Prelude.Hashable OutboundCallerConfig where
  hashWithSalt :: Int -> OutboundCallerConfig -> Int
hashWithSalt Int
_salt OutboundCallerConfig' {Maybe Text
outboundFlowId :: Maybe Text
outboundCallerIdNumberId :: Maybe Text
outboundCallerIdName :: Maybe Text
$sel:outboundFlowId:OutboundCallerConfig' :: OutboundCallerConfig -> Maybe Text
$sel:outboundCallerIdNumberId:OutboundCallerConfig' :: OutboundCallerConfig -> Maybe Text
$sel:outboundCallerIdName:OutboundCallerConfig' :: OutboundCallerConfig -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
outboundCallerIdName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
outboundCallerIdNumberId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
outboundFlowId

instance Prelude.NFData OutboundCallerConfig where
  rnf :: OutboundCallerConfig -> ()
rnf OutboundCallerConfig' {Maybe Text
outboundFlowId :: Maybe Text
outboundCallerIdNumberId :: Maybe Text
outboundCallerIdName :: Maybe Text
$sel:outboundFlowId:OutboundCallerConfig' :: OutboundCallerConfig -> Maybe Text
$sel:outboundCallerIdNumberId:OutboundCallerConfig' :: OutboundCallerConfig -> Maybe Text
$sel:outboundCallerIdName:OutboundCallerConfig' :: OutboundCallerConfig -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
outboundCallerIdName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
outboundCallerIdNumberId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
outboundFlowId

instance Data.ToJSON OutboundCallerConfig where
  toJSON :: OutboundCallerConfig -> Value
toJSON OutboundCallerConfig' {Maybe Text
outboundFlowId :: Maybe Text
outboundCallerIdNumberId :: Maybe Text
outboundCallerIdName :: Maybe Text
$sel:outboundFlowId:OutboundCallerConfig' :: OutboundCallerConfig -> Maybe Text
$sel:outboundCallerIdNumberId:OutboundCallerConfig' :: OutboundCallerConfig -> Maybe Text
$sel:outboundCallerIdName:OutboundCallerConfig' :: OutboundCallerConfig -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"OutboundCallerIdName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
outboundCallerIdName,
            (Key
"OutboundCallerIdNumberId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
outboundCallerIdNumberId,
            (Key
"OutboundFlowId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
outboundFlowId
          ]
      )