{-# 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.GlobalAccelerator.Types.Accelerator where
import qualified Amazonka.Core as Core
import Amazonka.GlobalAccelerator.Types.AcceleratorStatus
import Amazonka.GlobalAccelerator.Types.IpAddressType
import Amazonka.GlobalAccelerator.Types.IpSet
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Accelerator = Accelerator'
{
Accelerator -> Maybe AcceleratorStatus
status :: Prelude.Maybe AcceleratorStatus,
Accelerator -> Maybe Text
acceleratorArn :: Prelude.Maybe Prelude.Text,
Accelerator -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
Accelerator -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
Accelerator -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
Accelerator -> Maybe IpAddressType
ipAddressType :: Prelude.Maybe IpAddressType,
Accelerator -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Accelerator -> Maybe [IpSet]
ipSets :: Prelude.Maybe [IpSet],
Accelerator -> Maybe Text
dnsName :: Prelude.Maybe Prelude.Text
}
deriving (Accelerator -> Accelerator -> Bool
(Accelerator -> Accelerator -> Bool)
-> (Accelerator -> Accelerator -> Bool) -> Eq Accelerator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Accelerator -> Accelerator -> Bool
$c/= :: Accelerator -> Accelerator -> Bool
== :: Accelerator -> Accelerator -> Bool
$c== :: Accelerator -> Accelerator -> Bool
Prelude.Eq, ReadPrec [Accelerator]
ReadPrec Accelerator
Int -> ReadS Accelerator
ReadS [Accelerator]
(Int -> ReadS Accelerator)
-> ReadS [Accelerator]
-> ReadPrec Accelerator
-> ReadPrec [Accelerator]
-> Read Accelerator
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Accelerator]
$creadListPrec :: ReadPrec [Accelerator]
readPrec :: ReadPrec Accelerator
$creadPrec :: ReadPrec Accelerator
readList :: ReadS [Accelerator]
$creadList :: ReadS [Accelerator]
readsPrec :: Int -> ReadS Accelerator
$creadsPrec :: Int -> ReadS Accelerator
Prelude.Read, Int -> Accelerator -> ShowS
[Accelerator] -> ShowS
Accelerator -> String
(Int -> Accelerator -> ShowS)
-> (Accelerator -> String)
-> ([Accelerator] -> ShowS)
-> Show Accelerator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Accelerator] -> ShowS
$cshowList :: [Accelerator] -> ShowS
show :: Accelerator -> String
$cshow :: Accelerator -> String
showsPrec :: Int -> Accelerator -> ShowS
$cshowsPrec :: Int -> Accelerator -> ShowS
Prelude.Show, (forall x. Accelerator -> Rep Accelerator x)
-> (forall x. Rep Accelerator x -> Accelerator)
-> Generic Accelerator
forall x. Rep Accelerator x -> Accelerator
forall x. Accelerator -> Rep Accelerator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Accelerator x -> Accelerator
$cfrom :: forall x. Accelerator -> Rep Accelerator x
Prelude.Generic)
newAccelerator ::
Accelerator
newAccelerator :: Accelerator
newAccelerator =
Accelerator' :: Maybe AcceleratorStatus
-> Maybe Text
-> Maybe Bool
-> Maybe POSIX
-> Maybe POSIX
-> Maybe IpAddressType
-> Maybe Text
-> Maybe [IpSet]
-> Maybe Text
-> Accelerator
Accelerator'
{ $sel:status:Accelerator' :: Maybe AcceleratorStatus
status = Maybe AcceleratorStatus
forall a. Maybe a
Prelude.Nothing,
$sel:acceleratorArn:Accelerator' :: Maybe Text
acceleratorArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:enabled:Accelerator' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:createdTime:Accelerator' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:lastModifiedTime:Accelerator' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:ipAddressType:Accelerator' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
forall a. Maybe a
Prelude.Nothing,
$sel:name:Accelerator' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ipSets:Accelerator' :: Maybe [IpSet]
ipSets = Maybe [IpSet]
forall a. Maybe a
Prelude.Nothing,
$sel:dnsName:Accelerator' :: Maybe Text
dnsName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
accelerator_status :: Lens.Lens' Accelerator (Prelude.Maybe AcceleratorStatus)
accelerator_status :: (Maybe AcceleratorStatus -> f (Maybe AcceleratorStatus))
-> Accelerator -> f Accelerator
accelerator_status = (Accelerator -> Maybe AcceleratorStatus)
-> (Accelerator -> Maybe AcceleratorStatus -> Accelerator)
-> Lens
Accelerator
Accelerator
(Maybe AcceleratorStatus)
(Maybe AcceleratorStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Accelerator' {Maybe AcceleratorStatus
status :: Maybe AcceleratorStatus
$sel:status:Accelerator' :: Accelerator -> Maybe AcceleratorStatus
status} -> Maybe AcceleratorStatus
status) (\s :: Accelerator
s@Accelerator' {} Maybe AcceleratorStatus
a -> Accelerator
s {$sel:status:Accelerator' :: Maybe AcceleratorStatus
status = Maybe AcceleratorStatus
a} :: Accelerator)
accelerator_acceleratorArn :: Lens.Lens' Accelerator (Prelude.Maybe Prelude.Text)
accelerator_acceleratorArn :: (Maybe Text -> f (Maybe Text)) -> Accelerator -> f Accelerator
accelerator_acceleratorArn = (Accelerator -> Maybe Text)
-> (Accelerator -> Maybe Text -> Accelerator)
-> Lens Accelerator Accelerator (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Accelerator' {Maybe Text
acceleratorArn :: Maybe Text
$sel:acceleratorArn:Accelerator' :: Accelerator -> Maybe Text
acceleratorArn} -> Maybe Text
acceleratorArn) (\s :: Accelerator
s@Accelerator' {} Maybe Text
a -> Accelerator
s {$sel:acceleratorArn:Accelerator' :: Maybe Text
acceleratorArn = Maybe Text
a} :: Accelerator)
accelerator_enabled :: Lens.Lens' Accelerator (Prelude.Maybe Prelude.Bool)
accelerator_enabled :: (Maybe Bool -> f (Maybe Bool)) -> Accelerator -> f Accelerator
accelerator_enabled = (Accelerator -> Maybe Bool)
-> (Accelerator -> Maybe Bool -> Accelerator)
-> Lens Accelerator Accelerator (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Accelerator' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:Accelerator' :: Accelerator -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: Accelerator
s@Accelerator' {} Maybe Bool
a -> Accelerator
s {$sel:enabled:Accelerator' :: Maybe Bool
enabled = Maybe Bool
a} :: Accelerator)
accelerator_createdTime :: Lens.Lens' Accelerator (Prelude.Maybe Prelude.UTCTime)
accelerator_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> Accelerator -> f Accelerator
accelerator_createdTime = (Accelerator -> Maybe POSIX)
-> (Accelerator -> Maybe POSIX -> Accelerator)
-> Lens Accelerator Accelerator (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Accelerator' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:Accelerator' :: Accelerator -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: Accelerator
s@Accelerator' {} Maybe POSIX
a -> Accelerator
s {$sel:createdTime:Accelerator' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: Accelerator) ((Maybe POSIX -> f (Maybe POSIX)) -> Accelerator -> f Accelerator)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Accelerator
-> f Accelerator
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
accelerator_lastModifiedTime :: Lens.Lens' Accelerator (Prelude.Maybe Prelude.UTCTime)
accelerator_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> Accelerator -> f Accelerator
accelerator_lastModifiedTime = (Accelerator -> Maybe POSIX)
-> (Accelerator -> Maybe POSIX -> Accelerator)
-> Lens Accelerator Accelerator (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Accelerator' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:Accelerator' :: Accelerator -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: Accelerator
s@Accelerator' {} Maybe POSIX
a -> Accelerator
s {$sel:lastModifiedTime:Accelerator' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: Accelerator) ((Maybe POSIX -> f (Maybe POSIX)) -> Accelerator -> f Accelerator)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Accelerator
-> f Accelerator
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
accelerator_ipAddressType :: Lens.Lens' Accelerator (Prelude.Maybe IpAddressType)
accelerator_ipAddressType :: (Maybe IpAddressType -> f (Maybe IpAddressType))
-> Accelerator -> f Accelerator
accelerator_ipAddressType = (Accelerator -> Maybe IpAddressType)
-> (Accelerator -> Maybe IpAddressType -> Accelerator)
-> Lens
Accelerator Accelerator (Maybe IpAddressType) (Maybe IpAddressType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Accelerator' {Maybe IpAddressType
ipAddressType :: Maybe IpAddressType
$sel:ipAddressType:Accelerator' :: Accelerator -> Maybe IpAddressType
ipAddressType} -> Maybe IpAddressType
ipAddressType) (\s :: Accelerator
s@Accelerator' {} Maybe IpAddressType
a -> Accelerator
s {$sel:ipAddressType:Accelerator' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
a} :: Accelerator)
accelerator_name :: Lens.Lens' Accelerator (Prelude.Maybe Prelude.Text)
accelerator_name :: (Maybe Text -> f (Maybe Text)) -> Accelerator -> f Accelerator
accelerator_name = (Accelerator -> Maybe Text)
-> (Accelerator -> Maybe Text -> Accelerator)
-> Lens Accelerator Accelerator (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Accelerator' {Maybe Text
name :: Maybe Text
$sel:name:Accelerator' :: Accelerator -> Maybe Text
name} -> Maybe Text
name) (\s :: Accelerator
s@Accelerator' {} Maybe Text
a -> Accelerator
s {$sel:name:Accelerator' :: Maybe Text
name = Maybe Text
a} :: Accelerator)
accelerator_ipSets :: Lens.Lens' Accelerator (Prelude.Maybe [IpSet])
accelerator_ipSets :: (Maybe [IpSet] -> f (Maybe [IpSet]))
-> Accelerator -> f Accelerator
accelerator_ipSets = (Accelerator -> Maybe [IpSet])
-> (Accelerator -> Maybe [IpSet] -> Accelerator)
-> Lens Accelerator Accelerator (Maybe [IpSet]) (Maybe [IpSet])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Accelerator' {Maybe [IpSet]
ipSets :: Maybe [IpSet]
$sel:ipSets:Accelerator' :: Accelerator -> Maybe [IpSet]
ipSets} -> Maybe [IpSet]
ipSets) (\s :: Accelerator
s@Accelerator' {} Maybe [IpSet]
a -> Accelerator
s {$sel:ipSets:Accelerator' :: Maybe [IpSet]
ipSets = Maybe [IpSet]
a} :: Accelerator) ((Maybe [IpSet] -> f (Maybe [IpSet]))
-> Accelerator -> f Accelerator)
-> ((Maybe [IpSet] -> f (Maybe [IpSet]))
-> Maybe [IpSet] -> f (Maybe [IpSet]))
-> (Maybe [IpSet] -> f (Maybe [IpSet]))
-> Accelerator
-> f Accelerator
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [IpSet] [IpSet] [IpSet] [IpSet]
-> Iso
(Maybe [IpSet]) (Maybe [IpSet]) (Maybe [IpSet]) (Maybe [IpSet])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [IpSet] [IpSet] [IpSet] [IpSet]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
accelerator_dnsName :: Lens.Lens' Accelerator (Prelude.Maybe Prelude.Text)
accelerator_dnsName :: (Maybe Text -> f (Maybe Text)) -> Accelerator -> f Accelerator
accelerator_dnsName = (Accelerator -> Maybe Text)
-> (Accelerator -> Maybe Text -> Accelerator)
-> Lens Accelerator Accelerator (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Accelerator' {Maybe Text
dnsName :: Maybe Text
$sel:dnsName:Accelerator' :: Accelerator -> Maybe Text
dnsName} -> Maybe Text
dnsName) (\s :: Accelerator
s@Accelerator' {} Maybe Text
a -> Accelerator
s {$sel:dnsName:Accelerator' :: Maybe Text
dnsName = Maybe Text
a} :: Accelerator)
instance Core.FromJSON Accelerator where
parseJSON :: Value -> Parser Accelerator
parseJSON =
String
-> (Object -> Parser Accelerator) -> Value -> Parser Accelerator
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Accelerator"
( \Object
x ->
Maybe AcceleratorStatus
-> Maybe Text
-> Maybe Bool
-> Maybe POSIX
-> Maybe POSIX
-> Maybe IpAddressType
-> Maybe Text
-> Maybe [IpSet]
-> Maybe Text
-> Accelerator
Accelerator'
(Maybe AcceleratorStatus
-> Maybe Text
-> Maybe Bool
-> Maybe POSIX
-> Maybe POSIX
-> Maybe IpAddressType
-> Maybe Text
-> Maybe [IpSet]
-> Maybe Text
-> Accelerator)
-> Parser (Maybe AcceleratorStatus)
-> Parser
(Maybe Text
-> Maybe Bool
-> Maybe POSIX
-> Maybe POSIX
-> Maybe IpAddressType
-> Maybe Text
-> Maybe [IpSet]
-> Maybe Text
-> Accelerator)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AcceleratorStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe Text
-> Maybe Bool
-> Maybe POSIX
-> Maybe POSIX
-> Maybe IpAddressType
-> Maybe Text
-> Maybe [IpSet]
-> Maybe Text
-> Accelerator)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool
-> Maybe POSIX
-> Maybe POSIX
-> Maybe IpAddressType
-> Maybe Text
-> Maybe [IpSet]
-> Maybe Text
-> Accelerator)
forall (f :: * -> *) a b. Applicative f => 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
"AcceleratorArn")
Parser
(Maybe Bool
-> Maybe POSIX
-> Maybe POSIX
-> Maybe IpAddressType
-> Maybe Text
-> Maybe [IpSet]
-> Maybe Text
-> Accelerator)
-> Parser (Maybe Bool)
-> Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe IpAddressType
-> Maybe Text
-> Maybe [IpSet]
-> Maybe Text
-> Accelerator)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Enabled")
Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe IpAddressType
-> Maybe Text
-> Maybe [IpSet]
-> Maybe Text
-> Accelerator)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Maybe IpAddressType
-> Maybe Text
-> Maybe [IpSet]
-> Maybe Text
-> Accelerator)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedTime")
Parser
(Maybe POSIX
-> Maybe IpAddressType
-> Maybe Text
-> Maybe [IpSet]
-> Maybe Text
-> Accelerator)
-> Parser (Maybe POSIX)
-> Parser
(Maybe IpAddressType
-> Maybe Text -> Maybe [IpSet] -> Maybe Text -> Accelerator)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastModifiedTime")
Parser
(Maybe IpAddressType
-> Maybe Text -> Maybe [IpSet] -> Maybe Text -> Accelerator)
-> Parser (Maybe IpAddressType)
-> Parser
(Maybe Text -> Maybe [IpSet] -> Maybe Text -> Accelerator)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe IpAddressType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IpAddressType")
Parser (Maybe Text -> Maybe [IpSet] -> Maybe Text -> Accelerator)
-> Parser (Maybe Text)
-> Parser (Maybe [IpSet] -> Maybe Text -> Accelerator)
forall (f :: * -> *) a b. Applicative f => 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
"Name")
Parser (Maybe [IpSet] -> Maybe Text -> Accelerator)
-> Parser (Maybe [IpSet]) -> Parser (Maybe Text -> Accelerator)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [IpSet]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IpSets" Parser (Maybe (Maybe [IpSet]))
-> Maybe [IpSet] -> Parser (Maybe [IpSet])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [IpSet]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> Accelerator)
-> Parser (Maybe Text) -> Parser Accelerator
forall (f :: * -> *) a b. Applicative f => 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
"DnsName")
)
instance Prelude.Hashable Accelerator
instance Prelude.NFData Accelerator