{-# 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.GlobalAccelerator.Types.Accelerator
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | An accelerator is a complex type that includes one or more listeners
-- that process inbound connections and then direct traffic to one or more
-- endpoint groups, each of which includes endpoints, such as load
-- balancers.
--
-- /See:/ 'newAccelerator' smart constructor.
data Accelerator = Accelerator'
  { -- | Describes the deployment status of the accelerator.
    Accelerator -> Maybe AcceleratorStatus
status :: Prelude.Maybe AcceleratorStatus,
    -- | The Amazon Resource Name (ARN) of the accelerator.
    Accelerator -> Maybe Text
acceleratorArn :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the accelerator is enabled. The value is true or
    -- false. The default value is true.
    --
    -- If the value is set to true, the accelerator cannot be deleted. If set
    -- to false, accelerator can be deleted.
    Accelerator -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
    -- | The date and time that the accelerator was created.
    Accelerator -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
    -- | The date and time that the accelerator was last modified.
    Accelerator -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
    -- | The value for the address type must be IPv4.
    Accelerator -> Maybe IpAddressType
ipAddressType :: Prelude.Maybe IpAddressType,
    -- | The name of the accelerator. The name must contain only alphanumeric
    -- characters or hyphens (-), and must not begin or end with a hyphen.
    Accelerator -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The static IP addresses that Global Accelerator associates with the
    -- accelerator.
    Accelerator -> Maybe [IpSet]
ipSets :: Prelude.Maybe [IpSet],
    -- | The Domain Name System (DNS) name that Global Accelerator creates that
    -- points to your accelerator\'s static IP addresses.
    --
    -- The naming convention for the DNS name is the following: A lowercase
    -- letter a, followed by a 16-bit random hex string, followed by
    -- .awsglobalaccelerator.com. For example:
    -- a1234567890abcdef.awsglobalaccelerator.com.
    --
    -- For more information about the default DNS name, see
    -- <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html#about-accelerators.dns-addressing Support for DNS Addressing in Global Accelerator>
    -- in the /AWS Global Accelerator Developer Guide/.
    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)

-- |
-- Create a value of 'Accelerator' 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:
--
-- 'status', 'accelerator_status' - Describes the deployment status of the accelerator.
--
-- 'acceleratorArn', 'accelerator_acceleratorArn' - The Amazon Resource Name (ARN) of the accelerator.
--
-- 'enabled', 'accelerator_enabled' - Indicates whether the accelerator is enabled. The value is true or
-- false. The default value is true.
--
-- If the value is set to true, the accelerator cannot be deleted. If set
-- to false, accelerator can be deleted.
--
-- 'createdTime', 'accelerator_createdTime' - The date and time that the accelerator was created.
--
-- 'lastModifiedTime', 'accelerator_lastModifiedTime' - The date and time that the accelerator was last modified.
--
-- 'ipAddressType', 'accelerator_ipAddressType' - The value for the address type must be IPv4.
--
-- 'name', 'accelerator_name' - The name of the accelerator. The name must contain only alphanumeric
-- characters or hyphens (-), and must not begin or end with a hyphen.
--
-- 'ipSets', 'accelerator_ipSets' - The static IP addresses that Global Accelerator associates with the
-- accelerator.
--
-- 'dnsName', 'accelerator_dnsName' - The Domain Name System (DNS) name that Global Accelerator creates that
-- points to your accelerator\'s static IP addresses.
--
-- The naming convention for the DNS name is the following: A lowercase
-- letter a, followed by a 16-bit random hex string, followed by
-- .awsglobalaccelerator.com. For example:
-- a1234567890abcdef.awsglobalaccelerator.com.
--
-- For more information about the default DNS name, see
-- <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html#about-accelerators.dns-addressing Support for DNS Addressing in Global Accelerator>
-- in the /AWS Global Accelerator Developer Guide/.
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
    }

-- | Describes the deployment status of the accelerator.
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)

-- | The Amazon Resource Name (ARN) of the 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)

-- | Indicates whether the accelerator is enabled. The value is true or
-- false. The default value is true.
--
-- If the value is set to true, the accelerator cannot be deleted. If set
-- to false, accelerator can be deleted.
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)

-- | The date and time that the accelerator was created.
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

-- | The date and time that the accelerator was last modified.
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

-- | The value for the address type must be IPv4.
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)

-- | The name of the accelerator. The name must contain only alphanumeric
-- characters or hyphens (-), and must not begin or end with a hyphen.
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)

-- | The static IP addresses that Global Accelerator associates with the
-- 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

-- | The Domain Name System (DNS) name that Global Accelerator creates that
-- points to your accelerator\'s static IP addresses.
--
-- The naming convention for the DNS name is the following: A lowercase
-- letter a, followed by a 16-bit random hex string, followed by
-- .awsglobalaccelerator.com. For example:
-- a1234567890abcdef.awsglobalaccelerator.com.
--
-- For more information about the default DNS name, see
-- <https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html#about-accelerators.dns-addressing Support for DNS Addressing in Global Accelerator>
-- in the /AWS Global Accelerator Developer Guide/.
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