{-# 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 #-}
module Amazonka.SESV2.Types.DedicatedIp where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SESV2.Types.WarmupStatus
data DedicatedIp = DedicatedIp'
{
DedicatedIp -> Maybe Text
poolName :: Prelude.Maybe Prelude.Text,
DedicatedIp -> Text
ip :: Prelude.Text,
DedicatedIp -> WarmupStatus
warmupStatus :: WarmupStatus,
DedicatedIp -> Int
warmupPercentage :: Prelude.Int
}
deriving (DedicatedIp -> DedicatedIp -> Bool
(DedicatedIp -> DedicatedIp -> Bool)
-> (DedicatedIp -> DedicatedIp -> Bool) -> Eq DedicatedIp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DedicatedIp -> DedicatedIp -> Bool
$c/= :: DedicatedIp -> DedicatedIp -> Bool
== :: DedicatedIp -> DedicatedIp -> Bool
$c== :: DedicatedIp -> DedicatedIp -> Bool
Prelude.Eq, ReadPrec [DedicatedIp]
ReadPrec DedicatedIp
Int -> ReadS DedicatedIp
ReadS [DedicatedIp]
(Int -> ReadS DedicatedIp)
-> ReadS [DedicatedIp]
-> ReadPrec DedicatedIp
-> ReadPrec [DedicatedIp]
-> Read DedicatedIp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DedicatedIp]
$creadListPrec :: ReadPrec [DedicatedIp]
readPrec :: ReadPrec DedicatedIp
$creadPrec :: ReadPrec DedicatedIp
readList :: ReadS [DedicatedIp]
$creadList :: ReadS [DedicatedIp]
readsPrec :: Int -> ReadS DedicatedIp
$creadsPrec :: Int -> ReadS DedicatedIp
Prelude.Read, Int -> DedicatedIp -> ShowS
[DedicatedIp] -> ShowS
DedicatedIp -> String
(Int -> DedicatedIp -> ShowS)
-> (DedicatedIp -> String)
-> ([DedicatedIp] -> ShowS)
-> Show DedicatedIp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DedicatedIp] -> ShowS
$cshowList :: [DedicatedIp] -> ShowS
show :: DedicatedIp -> String
$cshow :: DedicatedIp -> String
showsPrec :: Int -> DedicatedIp -> ShowS
$cshowsPrec :: Int -> DedicatedIp -> ShowS
Prelude.Show, (forall x. DedicatedIp -> Rep DedicatedIp x)
-> (forall x. Rep DedicatedIp x -> DedicatedIp)
-> Generic DedicatedIp
forall x. Rep DedicatedIp x -> DedicatedIp
forall x. DedicatedIp -> Rep DedicatedIp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DedicatedIp x -> DedicatedIp
$cfrom :: forall x. DedicatedIp -> Rep DedicatedIp x
Prelude.Generic)
newDedicatedIp ::
Prelude.Text ->
WarmupStatus ->
Prelude.Int ->
DedicatedIp
newDedicatedIp :: Text -> WarmupStatus -> Int -> DedicatedIp
newDedicatedIp Text
pIp_ WarmupStatus
pWarmupStatus_ Int
pWarmupPercentage_ =
DedicatedIp' :: Maybe Text -> Text -> WarmupStatus -> Int -> DedicatedIp
DedicatedIp'
{ $sel:poolName:DedicatedIp' :: Maybe Text
poolName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ip:DedicatedIp' :: Text
ip = Text
pIp_,
$sel:warmupStatus:DedicatedIp' :: WarmupStatus
warmupStatus = WarmupStatus
pWarmupStatus_,
$sel:warmupPercentage:DedicatedIp' :: Int
warmupPercentage = Int
pWarmupPercentage_
}
dedicatedIp_poolName :: Lens.Lens' DedicatedIp (Prelude.Maybe Prelude.Text)
dedicatedIp_poolName :: (Maybe Text -> f (Maybe Text)) -> DedicatedIp -> f DedicatedIp
dedicatedIp_poolName = (DedicatedIp -> Maybe Text)
-> (DedicatedIp -> Maybe Text -> DedicatedIp)
-> Lens DedicatedIp DedicatedIp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DedicatedIp' {Maybe Text
poolName :: Maybe Text
$sel:poolName:DedicatedIp' :: DedicatedIp -> Maybe Text
poolName} -> Maybe Text
poolName) (\s :: DedicatedIp
s@DedicatedIp' {} Maybe Text
a -> DedicatedIp
s {$sel:poolName:DedicatedIp' :: Maybe Text
poolName = Maybe Text
a} :: DedicatedIp)
dedicatedIp_ip :: Lens.Lens' DedicatedIp Prelude.Text
dedicatedIp_ip :: (Text -> f Text) -> DedicatedIp -> f DedicatedIp
dedicatedIp_ip = (DedicatedIp -> Text)
-> (DedicatedIp -> Text -> DedicatedIp)
-> Lens DedicatedIp DedicatedIp Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DedicatedIp' {Text
ip :: Text
$sel:ip:DedicatedIp' :: DedicatedIp -> Text
ip} -> Text
ip) (\s :: DedicatedIp
s@DedicatedIp' {} Text
a -> DedicatedIp
s {$sel:ip:DedicatedIp' :: Text
ip = Text
a} :: DedicatedIp)
dedicatedIp_warmupStatus :: Lens.Lens' DedicatedIp WarmupStatus
dedicatedIp_warmupStatus :: (WarmupStatus -> f WarmupStatus) -> DedicatedIp -> f DedicatedIp
dedicatedIp_warmupStatus = (DedicatedIp -> WarmupStatus)
-> (DedicatedIp -> WarmupStatus -> DedicatedIp)
-> Lens DedicatedIp DedicatedIp WarmupStatus WarmupStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DedicatedIp' {WarmupStatus
warmupStatus :: WarmupStatus
$sel:warmupStatus:DedicatedIp' :: DedicatedIp -> WarmupStatus
warmupStatus} -> WarmupStatus
warmupStatus) (\s :: DedicatedIp
s@DedicatedIp' {} WarmupStatus
a -> DedicatedIp
s {$sel:warmupStatus:DedicatedIp' :: WarmupStatus
warmupStatus = WarmupStatus
a} :: DedicatedIp)
dedicatedIp_warmupPercentage :: Lens.Lens' DedicatedIp Prelude.Int
dedicatedIp_warmupPercentage :: (Int -> f Int) -> DedicatedIp -> f DedicatedIp
dedicatedIp_warmupPercentage = (DedicatedIp -> Int)
-> (DedicatedIp -> Int -> DedicatedIp)
-> Lens DedicatedIp DedicatedIp Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DedicatedIp' {Int
warmupPercentage :: Int
$sel:warmupPercentage:DedicatedIp' :: DedicatedIp -> Int
warmupPercentage} -> Int
warmupPercentage) (\s :: DedicatedIp
s@DedicatedIp' {} Int
a -> DedicatedIp
s {$sel:warmupPercentage:DedicatedIp' :: Int
warmupPercentage = Int
a} :: DedicatedIp)
instance Core.FromJSON DedicatedIp where
parseJSON :: Value -> Parser DedicatedIp
parseJSON =
String
-> (Object -> Parser DedicatedIp) -> Value -> Parser DedicatedIp
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DedicatedIp"
( \Object
x ->
Maybe Text -> Text -> WarmupStatus -> Int -> DedicatedIp
DedicatedIp'
(Maybe Text -> Text -> WarmupStatus -> Int -> DedicatedIp)
-> Parser (Maybe Text)
-> Parser (Text -> WarmupStatus -> Int -> DedicatedIp)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PoolName")
Parser (Text -> WarmupStatus -> Int -> DedicatedIp)
-> Parser Text -> Parser (WarmupStatus -> Int -> DedicatedIp)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Ip")
Parser (WarmupStatus -> Int -> DedicatedIp)
-> Parser WarmupStatus -> Parser (Int -> DedicatedIp)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser WarmupStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"WarmupStatus")
Parser (Int -> DedicatedIp) -> Parser Int -> Parser DedicatedIp
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"WarmupPercentage")
)
instance Prelude.Hashable DedicatedIp
instance Prelude.NFData DedicatedIp