{-# 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.ProgressiveDialerConfig
-- 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.ProgressiveDialerConfig 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

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

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

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

instance Data.FromJSON ProgressiveDialerConfig where
  parseJSON :: Value -> Parser ProgressiveDialerConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ProgressiveDialerConfig"
      ( \Object
x ->
          Double -> ProgressiveDialerConfig
ProgressiveDialerConfig'
            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 ProgressiveDialerConfig where
  hashWithSalt :: Int -> ProgressiveDialerConfig -> Int
hashWithSalt Int
_salt ProgressiveDialerConfig' {Double
bandwidthAllocation :: Double
$sel:bandwidthAllocation:ProgressiveDialerConfig' :: ProgressiveDialerConfig -> Double
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Double
bandwidthAllocation

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

instance Data.ToJSON ProgressiveDialerConfig where
  toJSON :: ProgressiveDialerConfig -> Value
toJSON ProgressiveDialerConfig' {Double
bandwidthAllocation :: Double
$sel:bandwidthAllocation:ProgressiveDialerConfig' :: ProgressiveDialerConfig -> 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)
          ]
      )