{-# 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.SESV2.Types.DedicatedIpPool
-- 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.SESV2.Types.DedicatedIpPool 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
import Amazonka.SESV2.Types.ScalingMode

-- | Contains information about a dedicated IP pool.
--
-- /See:/ 'newDedicatedIpPool' smart constructor.
data DedicatedIpPool = DedicatedIpPool'
  { -- | The name of the dedicated IP pool.
    DedicatedIpPool -> Text
poolName :: Prelude.Text,
    -- | The type of the dedicated IP pool.
    --
    -- -   @STANDARD@ – A dedicated IP pool where the customer can control
    --     which IPs are part of the pool.
    --
    -- -   @MANAGED@ – A dedicated IP pool where the reputation and number of
    --     IPs is automatically managed by Amazon SES.
    DedicatedIpPool -> ScalingMode
scalingMode :: ScalingMode
  }
  deriving (DedicatedIpPool -> DedicatedIpPool -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DedicatedIpPool -> DedicatedIpPool -> Bool
$c/= :: DedicatedIpPool -> DedicatedIpPool -> Bool
== :: DedicatedIpPool -> DedicatedIpPool -> Bool
$c== :: DedicatedIpPool -> DedicatedIpPool -> Bool
Prelude.Eq, ReadPrec [DedicatedIpPool]
ReadPrec DedicatedIpPool
Int -> ReadS DedicatedIpPool
ReadS [DedicatedIpPool]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DedicatedIpPool]
$creadListPrec :: ReadPrec [DedicatedIpPool]
readPrec :: ReadPrec DedicatedIpPool
$creadPrec :: ReadPrec DedicatedIpPool
readList :: ReadS [DedicatedIpPool]
$creadList :: ReadS [DedicatedIpPool]
readsPrec :: Int -> ReadS DedicatedIpPool
$creadsPrec :: Int -> ReadS DedicatedIpPool
Prelude.Read, Int -> DedicatedIpPool -> ShowS
[DedicatedIpPool] -> ShowS
DedicatedIpPool -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DedicatedIpPool] -> ShowS
$cshowList :: [DedicatedIpPool] -> ShowS
show :: DedicatedIpPool -> String
$cshow :: DedicatedIpPool -> String
showsPrec :: Int -> DedicatedIpPool -> ShowS
$cshowsPrec :: Int -> DedicatedIpPool -> ShowS
Prelude.Show, forall x. Rep DedicatedIpPool x -> DedicatedIpPool
forall x. DedicatedIpPool -> Rep DedicatedIpPool x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DedicatedIpPool x -> DedicatedIpPool
$cfrom :: forall x. DedicatedIpPool -> Rep DedicatedIpPool x
Prelude.Generic)

-- |
-- Create a value of 'DedicatedIpPool' 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:
--
-- 'poolName', 'dedicatedIpPool_poolName' - The name of the dedicated IP pool.
--
-- 'scalingMode', 'dedicatedIpPool_scalingMode' - The type of the dedicated IP pool.
--
-- -   @STANDARD@ – A dedicated IP pool where the customer can control
--     which IPs are part of the pool.
--
-- -   @MANAGED@ – A dedicated IP pool where the reputation and number of
--     IPs is automatically managed by Amazon SES.
newDedicatedIpPool ::
  -- | 'poolName'
  Prelude.Text ->
  -- | 'scalingMode'
  ScalingMode ->
  DedicatedIpPool
newDedicatedIpPool :: Text -> ScalingMode -> DedicatedIpPool
newDedicatedIpPool Text
pPoolName_ ScalingMode
pScalingMode_ =
  DedicatedIpPool'
    { $sel:poolName:DedicatedIpPool' :: Text
poolName = Text
pPoolName_,
      $sel:scalingMode:DedicatedIpPool' :: ScalingMode
scalingMode = ScalingMode
pScalingMode_
    }

-- | The name of the dedicated IP pool.
dedicatedIpPool_poolName :: Lens.Lens' DedicatedIpPool Prelude.Text
dedicatedIpPool_poolName :: Lens' DedicatedIpPool Text
dedicatedIpPool_poolName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DedicatedIpPool' {Text
poolName :: Text
$sel:poolName:DedicatedIpPool' :: DedicatedIpPool -> Text
poolName} -> Text
poolName) (\s :: DedicatedIpPool
s@DedicatedIpPool' {} Text
a -> DedicatedIpPool
s {$sel:poolName:DedicatedIpPool' :: Text
poolName = Text
a} :: DedicatedIpPool)

-- | The type of the dedicated IP pool.
--
-- -   @STANDARD@ – A dedicated IP pool where the customer can control
--     which IPs are part of the pool.
--
-- -   @MANAGED@ – A dedicated IP pool where the reputation and number of
--     IPs is automatically managed by Amazon SES.
dedicatedIpPool_scalingMode :: Lens.Lens' DedicatedIpPool ScalingMode
dedicatedIpPool_scalingMode :: Lens' DedicatedIpPool ScalingMode
dedicatedIpPool_scalingMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DedicatedIpPool' {ScalingMode
scalingMode :: ScalingMode
$sel:scalingMode:DedicatedIpPool' :: DedicatedIpPool -> ScalingMode
scalingMode} -> ScalingMode
scalingMode) (\s :: DedicatedIpPool
s@DedicatedIpPool' {} ScalingMode
a -> DedicatedIpPool
s {$sel:scalingMode:DedicatedIpPool' :: ScalingMode
scalingMode = ScalingMode
a} :: DedicatedIpPool)

instance Data.FromJSON DedicatedIpPool where
  parseJSON :: Value -> Parser DedicatedIpPool
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DedicatedIpPool"
      ( \Object
x ->
          Text -> ScalingMode -> DedicatedIpPool
DedicatedIpPool'
            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
"PoolName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ScalingMode")
      )

instance Prelude.Hashable DedicatedIpPool where
  hashWithSalt :: Int -> DedicatedIpPool -> Int
hashWithSalt Int
_salt DedicatedIpPool' {Text
ScalingMode
scalingMode :: ScalingMode
poolName :: Text
$sel:scalingMode:DedicatedIpPool' :: DedicatedIpPool -> ScalingMode
$sel:poolName:DedicatedIpPool' :: DedicatedIpPool -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
poolName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ScalingMode
scalingMode

instance Prelude.NFData DedicatedIpPool where
  rnf :: DedicatedIpPool -> ()
rnf DedicatedIpPool' {Text
ScalingMode
scalingMode :: ScalingMode
poolName :: Text
$sel:scalingMode:DedicatedIpPool' :: DedicatedIpPool -> ScalingMode
$sel:poolName:DedicatedIpPool' :: DedicatedIpPool -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
poolName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ScalingMode
scalingMode