{-# 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.ConnectCampaigns.Types.PredictiveDialerConfig
-- 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.ConnectCampaigns.Types.PredictiveDialerConfig 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

-- | Predictive Dialer config
--
-- /See:/ 'newPredictiveDialerConfig' smart constructor.
data PredictiveDialerConfig = PredictiveDialerConfig'
  { PredictiveDialerConfig -> Double
bandwidthAllocation :: Prelude.Double
  }
  deriving (PredictiveDialerConfig -> PredictiveDialerConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PredictiveDialerConfig -> PredictiveDialerConfig -> Bool
$c/= :: PredictiveDialerConfig -> PredictiveDialerConfig -> Bool
== :: PredictiveDialerConfig -> PredictiveDialerConfig -> Bool
$c== :: PredictiveDialerConfig -> PredictiveDialerConfig -> Bool
Prelude.Eq, ReadPrec [PredictiveDialerConfig]
ReadPrec PredictiveDialerConfig
Int -> ReadS PredictiveDialerConfig
ReadS [PredictiveDialerConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PredictiveDialerConfig]
$creadListPrec :: ReadPrec [PredictiveDialerConfig]
readPrec :: ReadPrec PredictiveDialerConfig
$creadPrec :: ReadPrec PredictiveDialerConfig
readList :: ReadS [PredictiveDialerConfig]
$creadList :: ReadS [PredictiveDialerConfig]
readsPrec :: Int -> ReadS PredictiveDialerConfig
$creadsPrec :: Int -> ReadS PredictiveDialerConfig
Prelude.Read, Int -> PredictiveDialerConfig -> ShowS
[PredictiveDialerConfig] -> ShowS
PredictiveDialerConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PredictiveDialerConfig] -> ShowS
$cshowList :: [PredictiveDialerConfig] -> ShowS
show :: PredictiveDialerConfig -> String
$cshow :: PredictiveDialerConfig -> String
showsPrec :: Int -> PredictiveDialerConfig -> ShowS
$cshowsPrec :: Int -> PredictiveDialerConfig -> ShowS
Prelude.Show, forall x. Rep PredictiveDialerConfig x -> PredictiveDialerConfig
forall x. PredictiveDialerConfig -> Rep PredictiveDialerConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PredictiveDialerConfig x -> PredictiveDialerConfig
$cfrom :: forall x. PredictiveDialerConfig -> Rep PredictiveDialerConfig x
Prelude.Generic)

-- |
-- Create a value of 'PredictiveDialerConfig' 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:
--
-- 'bandwidthAllocation', 'predictiveDialerConfig_bandwidthAllocation' - Undocumented member.
newPredictiveDialerConfig ::
  -- | 'bandwidthAllocation'
  Prelude.Double ->
  PredictiveDialerConfig
newPredictiveDialerConfig :: Double -> PredictiveDialerConfig
newPredictiveDialerConfig Double
pBandwidthAllocation_ =
  PredictiveDialerConfig'
    { $sel:bandwidthAllocation:PredictiveDialerConfig' :: Double
bandwidthAllocation =
        Double
pBandwidthAllocation_
    }

-- | Undocumented member.
predictiveDialerConfig_bandwidthAllocation :: Lens.Lens' PredictiveDialerConfig Prelude.Double
predictiveDialerConfig_bandwidthAllocation :: Lens' PredictiveDialerConfig Double
predictiveDialerConfig_bandwidthAllocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PredictiveDialerConfig' {Double
bandwidthAllocation :: Double
$sel:bandwidthAllocation:PredictiveDialerConfig' :: PredictiveDialerConfig -> Double
bandwidthAllocation} -> Double
bandwidthAllocation) (\s :: PredictiveDialerConfig
s@PredictiveDialerConfig' {} Double
a -> PredictiveDialerConfig
s {$sel:bandwidthAllocation:PredictiveDialerConfig' :: Double
bandwidthAllocation = Double
a} :: PredictiveDialerConfig)

instance Data.FromJSON PredictiveDialerConfig where
  parseJSON :: Value -> Parser PredictiveDialerConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PredictiveDialerConfig"
      ( \Object
x ->
          Double -> PredictiveDialerConfig
PredictiveDialerConfig'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"bandwidthAllocation")
      )

instance Prelude.Hashable PredictiveDialerConfig where
  hashWithSalt :: Int -> PredictiveDialerConfig -> Int
hashWithSalt Int
_salt PredictiveDialerConfig' {Double
bandwidthAllocation :: Double
$sel:bandwidthAllocation:PredictiveDialerConfig' :: PredictiveDialerConfig -> Double
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
bandwidthAllocation

instance Prelude.NFData PredictiveDialerConfig where
  rnf :: PredictiveDialerConfig -> ()
rnf PredictiveDialerConfig' {Double
bandwidthAllocation :: Double
$sel:bandwidthAllocation:PredictiveDialerConfig' :: PredictiveDialerConfig -> Double
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Double
bandwidthAllocation

instance Data.ToJSON PredictiveDialerConfig where
  toJSON :: PredictiveDialerConfig -> Value
toJSON PredictiveDialerConfig' {Double
bandwidthAllocation :: Double
$sel:bandwidthAllocation:PredictiveDialerConfig' :: PredictiveDialerConfig -> Double
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"bandwidthAllocation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Double
bandwidthAllocation)
          ]
      )