{-# 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.Lightsail.Types.LightsailDistribution
-- 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.Lightsail.Types.LightsailDistribution where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.CacheBehavior
import Amazonka.Lightsail.Types.CacheBehaviorPerPath
import Amazonka.Lightsail.Types.CacheSettings
import Amazonka.Lightsail.Types.IpAddressType
import Amazonka.Lightsail.Types.Origin
import Amazonka.Lightsail.Types.ResourceLocation
import Amazonka.Lightsail.Types.ResourceType
import Amazonka.Lightsail.Types.Tag
import qualified Amazonka.Prelude as Prelude

-- | Describes an Amazon Lightsail content delivery network (CDN)
-- distribution.
--
-- /See:/ 'newLightsailDistribution' smart constructor.
data LightsailDistribution = LightsailDistribution'
  { -- | The status of the distribution.
    LightsailDistribution -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | An object that describes the origin resource of the distribution, such
    -- as a Lightsail instance or load balancer.
    --
    -- The distribution pulls, caches, and serves content from the origin.
    LightsailDistribution -> Maybe Origin
origin :: Prelude.Maybe Origin,
    -- | The name of the SSL\/TLS certificate attached to the distribution, if
    -- any.
    LightsailDistribution -> Maybe Text
certificateName :: Prelude.Maybe Prelude.Text,
    -- | The Lightsail resource type (e.g., @Distribution@).
    LightsailDistribution -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
    -- | The Amazon Resource Name (ARN) of the distribution.
    LightsailDistribution -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when the distribution was created.
    LightsailDistribution -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | An object that describes the location of the distribution, such as the
    -- AWS Region and Availability Zone.
    --
    -- Lightsail distributions are global resources that can reference an
    -- origin in any AWS Region, and distribute its content globally. However,
    -- all distributions are located in the @us-east-1@ Region.
    LightsailDistribution -> Maybe ResourceLocation
location :: Prelude.Maybe ResourceLocation,
    -- | An object that describes the cache behavior settings of the
    -- distribution.
    LightsailDistribution -> Maybe CacheSettings
cacheBehaviorSettings :: Prelude.Maybe CacheSettings,
    -- | The alternate domain names of the distribution.
    LightsailDistribution -> Maybe [Text]
alternativeDomainNames :: Prelude.Maybe [Prelude.Text],
    -- | The ID of the bundle currently applied to the distribution.
    LightsailDistribution -> Maybe Text
bundleId :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the bundle that is currently applied to your
    -- distribution, specified using the @distributionName@ parameter, can be
    -- changed to another bundle.
    --
    -- Use the @UpdateDistributionBundle@ action to change your distribution\'s
    -- bundle.
    LightsailDistribution -> Maybe Bool
ableToUpdateBundle :: Prelude.Maybe Prelude.Bool,
    -- | The public DNS of the origin.
    LightsailDistribution -> Maybe Text
originPublicDNS :: Prelude.Maybe Prelude.Text,
    -- | The domain name of the distribution.
    LightsailDistribution -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
    -- | The name of the distribution.
    LightsailDistribution -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The IP address type of the distribution.
    --
    -- The possible values are @ipv4@ for IPv4 only, and @dualstack@ for IPv4
    -- and IPv6.
    LightsailDistribution -> Maybe IpAddressType
ipAddressType :: Prelude.Maybe IpAddressType,
    -- | Indicates whether the distribution is enabled.
    LightsailDistribution -> Maybe Bool
isEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The support code. Include this code in your email to support when you
    -- have questions about your Lightsail distribution. This code enables our
    -- support team to look up your Lightsail information more easily.
    LightsailDistribution -> Maybe Text
supportCode :: Prelude.Maybe Prelude.Text,
    -- | An object that describes the default cache behavior of the distribution.
    LightsailDistribution -> Maybe CacheBehavior
defaultCacheBehavior :: Prelude.Maybe CacheBehavior,
    -- | An array of objects that describe the per-path cache behavior of the
    -- distribution.
    LightsailDistribution -> Maybe [CacheBehaviorPerPath]
cacheBehaviors :: Prelude.Maybe [CacheBehaviorPerPath],
    -- | The tag keys and optional values for the resource. For more information
    -- about tags in Lightsail, see the
    -- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags Amazon Lightsail Developer Guide>.
    LightsailDistribution -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
  }
  deriving (LightsailDistribution -> LightsailDistribution -> Bool
(LightsailDistribution -> LightsailDistribution -> Bool)
-> (LightsailDistribution -> LightsailDistribution -> Bool)
-> Eq LightsailDistribution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LightsailDistribution -> LightsailDistribution -> Bool
$c/= :: LightsailDistribution -> LightsailDistribution -> Bool
== :: LightsailDistribution -> LightsailDistribution -> Bool
$c== :: LightsailDistribution -> LightsailDistribution -> Bool
Prelude.Eq, ReadPrec [LightsailDistribution]
ReadPrec LightsailDistribution
Int -> ReadS LightsailDistribution
ReadS [LightsailDistribution]
(Int -> ReadS LightsailDistribution)
-> ReadS [LightsailDistribution]
-> ReadPrec LightsailDistribution
-> ReadPrec [LightsailDistribution]
-> Read LightsailDistribution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LightsailDistribution]
$creadListPrec :: ReadPrec [LightsailDistribution]
readPrec :: ReadPrec LightsailDistribution
$creadPrec :: ReadPrec LightsailDistribution
readList :: ReadS [LightsailDistribution]
$creadList :: ReadS [LightsailDistribution]
readsPrec :: Int -> ReadS LightsailDistribution
$creadsPrec :: Int -> ReadS LightsailDistribution
Prelude.Read, Int -> LightsailDistribution -> ShowS
[LightsailDistribution] -> ShowS
LightsailDistribution -> String
(Int -> LightsailDistribution -> ShowS)
-> (LightsailDistribution -> String)
-> ([LightsailDistribution] -> ShowS)
-> Show LightsailDistribution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LightsailDistribution] -> ShowS
$cshowList :: [LightsailDistribution] -> ShowS
show :: LightsailDistribution -> String
$cshow :: LightsailDistribution -> String
showsPrec :: Int -> LightsailDistribution -> ShowS
$cshowsPrec :: Int -> LightsailDistribution -> ShowS
Prelude.Show, (forall x. LightsailDistribution -> Rep LightsailDistribution x)
-> (forall x. Rep LightsailDistribution x -> LightsailDistribution)
-> Generic LightsailDistribution
forall x. Rep LightsailDistribution x -> LightsailDistribution
forall x. LightsailDistribution -> Rep LightsailDistribution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LightsailDistribution x -> LightsailDistribution
$cfrom :: forall x. LightsailDistribution -> Rep LightsailDistribution x
Prelude.Generic)

-- |
-- Create a value of 'LightsailDistribution' 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', 'lightsailDistribution_status' - The status of the distribution.
--
-- 'origin', 'lightsailDistribution_origin' - An object that describes the origin resource of the distribution, such
-- as a Lightsail instance or load balancer.
--
-- The distribution pulls, caches, and serves content from the origin.
--
-- 'certificateName', 'lightsailDistribution_certificateName' - The name of the SSL\/TLS certificate attached to the distribution, if
-- any.
--
-- 'resourceType', 'lightsailDistribution_resourceType' - The Lightsail resource type (e.g., @Distribution@).
--
-- 'arn', 'lightsailDistribution_arn' - The Amazon Resource Name (ARN) of the distribution.
--
-- 'createdAt', 'lightsailDistribution_createdAt' - The timestamp when the distribution was created.
--
-- 'location', 'lightsailDistribution_location' - An object that describes the location of the distribution, such as the
-- AWS Region and Availability Zone.
--
-- Lightsail distributions are global resources that can reference an
-- origin in any AWS Region, and distribute its content globally. However,
-- all distributions are located in the @us-east-1@ Region.
--
-- 'cacheBehaviorSettings', 'lightsailDistribution_cacheBehaviorSettings' - An object that describes the cache behavior settings of the
-- distribution.
--
-- 'alternativeDomainNames', 'lightsailDistribution_alternativeDomainNames' - The alternate domain names of the distribution.
--
-- 'bundleId', 'lightsailDistribution_bundleId' - The ID of the bundle currently applied to the distribution.
--
-- 'ableToUpdateBundle', 'lightsailDistribution_ableToUpdateBundle' - Indicates whether the bundle that is currently applied to your
-- distribution, specified using the @distributionName@ parameter, can be
-- changed to another bundle.
--
-- Use the @UpdateDistributionBundle@ action to change your distribution\'s
-- bundle.
--
-- 'originPublicDNS', 'lightsailDistribution_originPublicDNS' - The public DNS of the origin.
--
-- 'domainName', 'lightsailDistribution_domainName' - The domain name of the distribution.
--
-- 'name', 'lightsailDistribution_name' - The name of the distribution.
--
-- 'ipAddressType', 'lightsailDistribution_ipAddressType' - The IP address type of the distribution.
--
-- The possible values are @ipv4@ for IPv4 only, and @dualstack@ for IPv4
-- and IPv6.
--
-- 'isEnabled', 'lightsailDistribution_isEnabled' - Indicates whether the distribution is enabled.
--
-- 'supportCode', 'lightsailDistribution_supportCode' - The support code. Include this code in your email to support when you
-- have questions about your Lightsail distribution. This code enables our
-- support team to look up your Lightsail information more easily.
--
-- 'defaultCacheBehavior', 'lightsailDistribution_defaultCacheBehavior' - An object that describes the default cache behavior of the distribution.
--
-- 'cacheBehaviors', 'lightsailDistribution_cacheBehaviors' - An array of objects that describe the per-path cache behavior of the
-- distribution.
--
-- 'tags', 'lightsailDistribution_tags' - The tag keys and optional values for the resource. For more information
-- about tags in Lightsail, see the
-- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags Amazon Lightsail Developer Guide>.
newLightsailDistribution ::
  LightsailDistribution
newLightsailDistribution :: LightsailDistribution
newLightsailDistribution =
  LightsailDistribution' :: Maybe Text
-> Maybe Origin
-> Maybe Text
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe CacheSettings
-> Maybe [Text]
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe IpAddressType
-> Maybe Bool
-> Maybe Text
-> Maybe CacheBehavior
-> Maybe [CacheBehaviorPerPath]
-> Maybe [Tag]
-> LightsailDistribution
LightsailDistribution'
    { $sel:status:LightsailDistribution' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:origin:LightsailDistribution' :: Maybe Origin
origin = Maybe Origin
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateName:LightsailDistribution' :: Maybe Text
certificateName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceType:LightsailDistribution' :: Maybe ResourceType
resourceType = Maybe ResourceType
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:LightsailDistribution' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:LightsailDistribution' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:location:LightsailDistribution' :: Maybe ResourceLocation
location = Maybe ResourceLocation
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheBehaviorSettings:LightsailDistribution' :: Maybe CacheSettings
cacheBehaviorSettings = Maybe CacheSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:alternativeDomainNames:LightsailDistribution' :: Maybe [Text]
alternativeDomainNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:bundleId:LightsailDistribution' :: Maybe Text
bundleId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ableToUpdateBundle:LightsailDistribution' :: Maybe Bool
ableToUpdateBundle = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:originPublicDNS:LightsailDistribution' :: Maybe Text
originPublicDNS = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:LightsailDistribution' :: Maybe Text
domainName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:LightsailDistribution' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddressType:LightsailDistribution' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
forall a. Maybe a
Prelude.Nothing,
      $sel:isEnabled:LightsailDistribution' :: Maybe Bool
isEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:supportCode:LightsailDistribution' :: Maybe Text
supportCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultCacheBehavior:LightsailDistribution' :: Maybe CacheBehavior
defaultCacheBehavior = Maybe CacheBehavior
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheBehaviors:LightsailDistribution' :: Maybe [CacheBehaviorPerPath]
cacheBehaviors = Maybe [CacheBehaviorPerPath]
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:LightsailDistribution' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the distribution.
lightsailDistribution_status :: Lens.Lens' LightsailDistribution (Prelude.Maybe Prelude.Text)
lightsailDistribution_status :: (Maybe Text -> f (Maybe Text))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_status = (LightsailDistribution -> Maybe Text)
-> (LightsailDistribution -> Maybe Text -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe Text
status :: Maybe Text
$sel:status:LightsailDistribution' :: LightsailDistribution -> Maybe Text
status} -> Maybe Text
status) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe Text
a -> LightsailDistribution
s {$sel:status:LightsailDistribution' :: Maybe Text
status = Maybe Text
a} :: LightsailDistribution)

-- | An object that describes the origin resource of the distribution, such
-- as a Lightsail instance or load balancer.
--
-- The distribution pulls, caches, and serves content from the origin.
lightsailDistribution_origin :: Lens.Lens' LightsailDistribution (Prelude.Maybe Origin)
lightsailDistribution_origin :: (Maybe Origin -> f (Maybe Origin))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_origin = (LightsailDistribution -> Maybe Origin)
-> (LightsailDistribution -> Maybe Origin -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe Origin)
     (Maybe Origin)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe Origin
origin :: Maybe Origin
$sel:origin:LightsailDistribution' :: LightsailDistribution -> Maybe Origin
origin} -> Maybe Origin
origin) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe Origin
a -> LightsailDistribution
s {$sel:origin:LightsailDistribution' :: Maybe Origin
origin = Maybe Origin
a} :: LightsailDistribution)

-- | The name of the SSL\/TLS certificate attached to the distribution, if
-- any.
lightsailDistribution_certificateName :: Lens.Lens' LightsailDistribution (Prelude.Maybe Prelude.Text)
lightsailDistribution_certificateName :: (Maybe Text -> f (Maybe Text))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_certificateName = (LightsailDistribution -> Maybe Text)
-> (LightsailDistribution -> Maybe Text -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe Text
certificateName :: Maybe Text
$sel:certificateName:LightsailDistribution' :: LightsailDistribution -> Maybe Text
certificateName} -> Maybe Text
certificateName) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe Text
a -> LightsailDistribution
s {$sel:certificateName:LightsailDistribution' :: Maybe Text
certificateName = Maybe Text
a} :: LightsailDistribution)

-- | The Lightsail resource type (e.g., @Distribution@).
lightsailDistribution_resourceType :: Lens.Lens' LightsailDistribution (Prelude.Maybe ResourceType)
lightsailDistribution_resourceType :: (Maybe ResourceType -> f (Maybe ResourceType))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_resourceType = (LightsailDistribution -> Maybe ResourceType)
-> (LightsailDistribution
    -> Maybe ResourceType -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe ResourceType)
     (Maybe ResourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:LightsailDistribution' :: LightsailDistribution -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe ResourceType
a -> LightsailDistribution
s {$sel:resourceType:LightsailDistribution' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: LightsailDistribution)

-- | The Amazon Resource Name (ARN) of the distribution.
lightsailDistribution_arn :: Lens.Lens' LightsailDistribution (Prelude.Maybe Prelude.Text)
lightsailDistribution_arn :: (Maybe Text -> f (Maybe Text))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_arn = (LightsailDistribution -> Maybe Text)
-> (LightsailDistribution -> Maybe Text -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe Text
arn :: Maybe Text
$sel:arn:LightsailDistribution' :: LightsailDistribution -> Maybe Text
arn} -> Maybe Text
arn) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe Text
a -> LightsailDistribution
s {$sel:arn:LightsailDistribution' :: Maybe Text
arn = Maybe Text
a} :: LightsailDistribution)

-- | The timestamp when the distribution was created.
lightsailDistribution_createdAt :: Lens.Lens' LightsailDistribution (Prelude.Maybe Prelude.UTCTime)
lightsailDistribution_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_createdAt = (LightsailDistribution -> Maybe POSIX)
-> (LightsailDistribution -> Maybe POSIX -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:LightsailDistribution' :: LightsailDistribution -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe POSIX
a -> LightsailDistribution
s {$sel:createdAt:LightsailDistribution' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: LightsailDistribution) ((Maybe POSIX -> f (Maybe POSIX))
 -> LightsailDistribution -> f LightsailDistribution)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> LightsailDistribution
-> f LightsailDistribution
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

-- | An object that describes the location of the distribution, such as the
-- AWS Region and Availability Zone.
--
-- Lightsail distributions are global resources that can reference an
-- origin in any AWS Region, and distribute its content globally. However,
-- all distributions are located in the @us-east-1@ Region.
lightsailDistribution_location :: Lens.Lens' LightsailDistribution (Prelude.Maybe ResourceLocation)
lightsailDistribution_location :: (Maybe ResourceLocation -> f (Maybe ResourceLocation))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_location = (LightsailDistribution -> Maybe ResourceLocation)
-> (LightsailDistribution
    -> Maybe ResourceLocation -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe ResourceLocation)
     (Maybe ResourceLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe ResourceLocation
location :: Maybe ResourceLocation
$sel:location:LightsailDistribution' :: LightsailDistribution -> Maybe ResourceLocation
location} -> Maybe ResourceLocation
location) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe ResourceLocation
a -> LightsailDistribution
s {$sel:location:LightsailDistribution' :: Maybe ResourceLocation
location = Maybe ResourceLocation
a} :: LightsailDistribution)

-- | An object that describes the cache behavior settings of the
-- distribution.
lightsailDistribution_cacheBehaviorSettings :: Lens.Lens' LightsailDistribution (Prelude.Maybe CacheSettings)
lightsailDistribution_cacheBehaviorSettings :: (Maybe CacheSettings -> f (Maybe CacheSettings))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_cacheBehaviorSettings = (LightsailDistribution -> Maybe CacheSettings)
-> (LightsailDistribution
    -> Maybe CacheSettings -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe CacheSettings)
     (Maybe CacheSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe CacheSettings
cacheBehaviorSettings :: Maybe CacheSettings
$sel:cacheBehaviorSettings:LightsailDistribution' :: LightsailDistribution -> Maybe CacheSettings
cacheBehaviorSettings} -> Maybe CacheSettings
cacheBehaviorSettings) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe CacheSettings
a -> LightsailDistribution
s {$sel:cacheBehaviorSettings:LightsailDistribution' :: Maybe CacheSettings
cacheBehaviorSettings = Maybe CacheSettings
a} :: LightsailDistribution)

-- | The alternate domain names of the distribution.
lightsailDistribution_alternativeDomainNames :: Lens.Lens' LightsailDistribution (Prelude.Maybe [Prelude.Text])
lightsailDistribution_alternativeDomainNames :: (Maybe [Text] -> f (Maybe [Text]))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_alternativeDomainNames = (LightsailDistribution -> Maybe [Text])
-> (LightsailDistribution -> Maybe [Text] -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe [Text]
alternativeDomainNames :: Maybe [Text]
$sel:alternativeDomainNames:LightsailDistribution' :: LightsailDistribution -> Maybe [Text]
alternativeDomainNames} -> Maybe [Text]
alternativeDomainNames) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe [Text]
a -> LightsailDistribution
s {$sel:alternativeDomainNames:LightsailDistribution' :: Maybe [Text]
alternativeDomainNames = Maybe [Text]
a} :: LightsailDistribution) ((Maybe [Text] -> f (Maybe [Text]))
 -> LightsailDistribution -> f LightsailDistribution)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> LightsailDistribution
-> f LightsailDistribution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the bundle currently applied to the distribution.
lightsailDistribution_bundleId :: Lens.Lens' LightsailDistribution (Prelude.Maybe Prelude.Text)
lightsailDistribution_bundleId :: (Maybe Text -> f (Maybe Text))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_bundleId = (LightsailDistribution -> Maybe Text)
-> (LightsailDistribution -> Maybe Text -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe Text
bundleId :: Maybe Text
$sel:bundleId:LightsailDistribution' :: LightsailDistribution -> Maybe Text
bundleId} -> Maybe Text
bundleId) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe Text
a -> LightsailDistribution
s {$sel:bundleId:LightsailDistribution' :: Maybe Text
bundleId = Maybe Text
a} :: LightsailDistribution)

-- | Indicates whether the bundle that is currently applied to your
-- distribution, specified using the @distributionName@ parameter, can be
-- changed to another bundle.
--
-- Use the @UpdateDistributionBundle@ action to change your distribution\'s
-- bundle.
lightsailDistribution_ableToUpdateBundle :: Lens.Lens' LightsailDistribution (Prelude.Maybe Prelude.Bool)
lightsailDistribution_ableToUpdateBundle :: (Maybe Bool -> f (Maybe Bool))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_ableToUpdateBundle = (LightsailDistribution -> Maybe Bool)
-> (LightsailDistribution -> Maybe Bool -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe Bool
ableToUpdateBundle :: Maybe Bool
$sel:ableToUpdateBundle:LightsailDistribution' :: LightsailDistribution -> Maybe Bool
ableToUpdateBundle} -> Maybe Bool
ableToUpdateBundle) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe Bool
a -> LightsailDistribution
s {$sel:ableToUpdateBundle:LightsailDistribution' :: Maybe Bool
ableToUpdateBundle = Maybe Bool
a} :: LightsailDistribution)

-- | The public DNS of the origin.
lightsailDistribution_originPublicDNS :: Lens.Lens' LightsailDistribution (Prelude.Maybe Prelude.Text)
lightsailDistribution_originPublicDNS :: (Maybe Text -> f (Maybe Text))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_originPublicDNS = (LightsailDistribution -> Maybe Text)
-> (LightsailDistribution -> Maybe Text -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe Text
originPublicDNS :: Maybe Text
$sel:originPublicDNS:LightsailDistribution' :: LightsailDistribution -> Maybe Text
originPublicDNS} -> Maybe Text
originPublicDNS) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe Text
a -> LightsailDistribution
s {$sel:originPublicDNS:LightsailDistribution' :: Maybe Text
originPublicDNS = Maybe Text
a} :: LightsailDistribution)

-- | The domain name of the distribution.
lightsailDistribution_domainName :: Lens.Lens' LightsailDistribution (Prelude.Maybe Prelude.Text)
lightsailDistribution_domainName :: (Maybe Text -> f (Maybe Text))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_domainName = (LightsailDistribution -> Maybe Text)
-> (LightsailDistribution -> Maybe Text -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe Text
domainName :: Maybe Text
$sel:domainName:LightsailDistribution' :: LightsailDistribution -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe Text
a -> LightsailDistribution
s {$sel:domainName:LightsailDistribution' :: Maybe Text
domainName = Maybe Text
a} :: LightsailDistribution)

-- | The name of the distribution.
lightsailDistribution_name :: Lens.Lens' LightsailDistribution (Prelude.Maybe Prelude.Text)
lightsailDistribution_name :: (Maybe Text -> f (Maybe Text))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_name = (LightsailDistribution -> Maybe Text)
-> (LightsailDistribution -> Maybe Text -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe Text
name :: Maybe Text
$sel:name:LightsailDistribution' :: LightsailDistribution -> Maybe Text
name} -> Maybe Text
name) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe Text
a -> LightsailDistribution
s {$sel:name:LightsailDistribution' :: Maybe Text
name = Maybe Text
a} :: LightsailDistribution)

-- | The IP address type of the distribution.
--
-- The possible values are @ipv4@ for IPv4 only, and @dualstack@ for IPv4
-- and IPv6.
lightsailDistribution_ipAddressType :: Lens.Lens' LightsailDistribution (Prelude.Maybe IpAddressType)
lightsailDistribution_ipAddressType :: (Maybe IpAddressType -> f (Maybe IpAddressType))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_ipAddressType = (LightsailDistribution -> Maybe IpAddressType)
-> (LightsailDistribution
    -> Maybe IpAddressType -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe IpAddressType)
     (Maybe IpAddressType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe IpAddressType
ipAddressType :: Maybe IpAddressType
$sel:ipAddressType:LightsailDistribution' :: LightsailDistribution -> Maybe IpAddressType
ipAddressType} -> Maybe IpAddressType
ipAddressType) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe IpAddressType
a -> LightsailDistribution
s {$sel:ipAddressType:LightsailDistribution' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
a} :: LightsailDistribution)

-- | Indicates whether the distribution is enabled.
lightsailDistribution_isEnabled :: Lens.Lens' LightsailDistribution (Prelude.Maybe Prelude.Bool)
lightsailDistribution_isEnabled :: (Maybe Bool -> f (Maybe Bool))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_isEnabled = (LightsailDistribution -> Maybe Bool)
-> (LightsailDistribution -> Maybe Bool -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe Bool
isEnabled :: Maybe Bool
$sel:isEnabled:LightsailDistribution' :: LightsailDistribution -> Maybe Bool
isEnabled} -> Maybe Bool
isEnabled) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe Bool
a -> LightsailDistribution
s {$sel:isEnabled:LightsailDistribution' :: Maybe Bool
isEnabled = Maybe Bool
a} :: LightsailDistribution)

-- | The support code. Include this code in your email to support when you
-- have questions about your Lightsail distribution. This code enables our
-- support team to look up your Lightsail information more easily.
lightsailDistribution_supportCode :: Lens.Lens' LightsailDistribution (Prelude.Maybe Prelude.Text)
lightsailDistribution_supportCode :: (Maybe Text -> f (Maybe Text))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_supportCode = (LightsailDistribution -> Maybe Text)
-> (LightsailDistribution -> Maybe Text -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe Text
supportCode :: Maybe Text
$sel:supportCode:LightsailDistribution' :: LightsailDistribution -> Maybe Text
supportCode} -> Maybe Text
supportCode) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe Text
a -> LightsailDistribution
s {$sel:supportCode:LightsailDistribution' :: Maybe Text
supportCode = Maybe Text
a} :: LightsailDistribution)

-- | An object that describes the default cache behavior of the distribution.
lightsailDistribution_defaultCacheBehavior :: Lens.Lens' LightsailDistribution (Prelude.Maybe CacheBehavior)
lightsailDistribution_defaultCacheBehavior :: (Maybe CacheBehavior -> f (Maybe CacheBehavior))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_defaultCacheBehavior = (LightsailDistribution -> Maybe CacheBehavior)
-> (LightsailDistribution
    -> Maybe CacheBehavior -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe CacheBehavior)
     (Maybe CacheBehavior)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe CacheBehavior
defaultCacheBehavior :: Maybe CacheBehavior
$sel:defaultCacheBehavior:LightsailDistribution' :: LightsailDistribution -> Maybe CacheBehavior
defaultCacheBehavior} -> Maybe CacheBehavior
defaultCacheBehavior) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe CacheBehavior
a -> LightsailDistribution
s {$sel:defaultCacheBehavior:LightsailDistribution' :: Maybe CacheBehavior
defaultCacheBehavior = Maybe CacheBehavior
a} :: LightsailDistribution)

-- | An array of objects that describe the per-path cache behavior of the
-- distribution.
lightsailDistribution_cacheBehaviors :: Lens.Lens' LightsailDistribution (Prelude.Maybe [CacheBehaviorPerPath])
lightsailDistribution_cacheBehaviors :: (Maybe [CacheBehaviorPerPath] -> f (Maybe [CacheBehaviorPerPath]))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_cacheBehaviors = (LightsailDistribution -> Maybe [CacheBehaviorPerPath])
-> (LightsailDistribution
    -> Maybe [CacheBehaviorPerPath] -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe [CacheBehaviorPerPath])
     (Maybe [CacheBehaviorPerPath])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe [CacheBehaviorPerPath]
cacheBehaviors :: Maybe [CacheBehaviorPerPath]
$sel:cacheBehaviors:LightsailDistribution' :: LightsailDistribution -> Maybe [CacheBehaviorPerPath]
cacheBehaviors} -> Maybe [CacheBehaviorPerPath]
cacheBehaviors) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe [CacheBehaviorPerPath]
a -> LightsailDistribution
s {$sel:cacheBehaviors:LightsailDistribution' :: Maybe [CacheBehaviorPerPath]
cacheBehaviors = Maybe [CacheBehaviorPerPath]
a} :: LightsailDistribution) ((Maybe [CacheBehaviorPerPath] -> f (Maybe [CacheBehaviorPerPath]))
 -> LightsailDistribution -> f LightsailDistribution)
-> ((Maybe [CacheBehaviorPerPath]
     -> f (Maybe [CacheBehaviorPerPath]))
    -> Maybe [CacheBehaviorPerPath]
    -> f (Maybe [CacheBehaviorPerPath]))
-> (Maybe [CacheBehaviorPerPath]
    -> f (Maybe [CacheBehaviorPerPath]))
-> LightsailDistribution
-> f LightsailDistribution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CacheBehaviorPerPath]
  [CacheBehaviorPerPath]
  [CacheBehaviorPerPath]
  [CacheBehaviorPerPath]
-> Iso
     (Maybe [CacheBehaviorPerPath])
     (Maybe [CacheBehaviorPerPath])
     (Maybe [CacheBehaviorPerPath])
     (Maybe [CacheBehaviorPerPath])
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
  [CacheBehaviorPerPath]
  [CacheBehaviorPerPath]
  [CacheBehaviorPerPath]
  [CacheBehaviorPerPath]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The tag keys and optional values for the resource. For more information
-- about tags in Lightsail, see the
-- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags Amazon Lightsail Developer Guide>.
lightsailDistribution_tags :: Lens.Lens' LightsailDistribution (Prelude.Maybe [Tag])
lightsailDistribution_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> LightsailDistribution -> f LightsailDistribution
lightsailDistribution_tags = (LightsailDistribution -> Maybe [Tag])
-> (LightsailDistribution -> Maybe [Tag] -> LightsailDistribution)
-> Lens
     LightsailDistribution
     LightsailDistribution
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LightsailDistribution' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:LightsailDistribution' :: LightsailDistribution -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: LightsailDistribution
s@LightsailDistribution' {} Maybe [Tag]
a -> LightsailDistribution
s {$sel:tags:LightsailDistribution' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: LightsailDistribution) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> LightsailDistribution -> f LightsailDistribution)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> LightsailDistribution
-> f LightsailDistribution
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON LightsailDistribution where
  parseJSON :: Value -> Parser LightsailDistribution
parseJSON =
    String
-> (Object -> Parser LightsailDistribution)
-> Value
-> Parser LightsailDistribution
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"LightsailDistribution"
      ( \Object
x ->
          Maybe Text
-> Maybe Origin
-> Maybe Text
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe CacheSettings
-> Maybe [Text]
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe IpAddressType
-> Maybe Bool
-> Maybe Text
-> Maybe CacheBehavior
-> Maybe [CacheBehaviorPerPath]
-> Maybe [Tag]
-> LightsailDistribution
LightsailDistribution'
            (Maybe Text
 -> Maybe Origin
 -> Maybe Text
 -> Maybe ResourceType
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe ResourceLocation
 -> Maybe CacheSettings
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe IpAddressType
 -> Maybe Bool
 -> Maybe Text
 -> Maybe CacheBehavior
 -> Maybe [CacheBehaviorPerPath]
 -> Maybe [Tag]
 -> LightsailDistribution)
-> Parser (Maybe Text)
-> Parser
     (Maybe Origin
      -> Maybe Text
      -> Maybe ResourceType
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe ResourceLocation
      -> Maybe CacheSettings
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe CacheBehavior
      -> Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag]
      -> LightsailDistribution)
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
"status")
            Parser
  (Maybe Origin
   -> Maybe Text
   -> Maybe ResourceType
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe ResourceLocation
   -> Maybe CacheSettings
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe CacheBehavior
   -> Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag]
   -> LightsailDistribution)
-> Parser (Maybe Origin)
-> Parser
     (Maybe Text
      -> Maybe ResourceType
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe ResourceLocation
      -> Maybe CacheSettings
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe CacheBehavior
      -> Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag]
      -> LightsailDistribution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Origin)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"origin")
            Parser
  (Maybe Text
   -> Maybe ResourceType
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe ResourceLocation
   -> Maybe CacheSettings
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe CacheBehavior
   -> Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag]
   -> LightsailDistribution)
-> Parser (Maybe Text)
-> Parser
     (Maybe ResourceType
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe ResourceLocation
      -> Maybe CacheSettings
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe CacheBehavior
      -> Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag]
      -> LightsailDistribution)
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
"certificateName")
            Parser
  (Maybe ResourceType
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe ResourceLocation
   -> Maybe CacheSettings
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe CacheBehavior
   -> Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag]
   -> LightsailDistribution)
-> Parser (Maybe ResourceType)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe ResourceLocation
      -> Maybe CacheSettings
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe CacheBehavior
      -> Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag]
      -> LightsailDistribution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceType")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe ResourceLocation
   -> Maybe CacheSettings
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe CacheBehavior
   -> Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag]
   -> LightsailDistribution)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe ResourceLocation
      -> Maybe CacheSettings
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe CacheBehavior
      -> Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag]
      -> LightsailDistribution)
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
"arn")
            Parser
  (Maybe POSIX
   -> Maybe ResourceLocation
   -> Maybe CacheSettings
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe CacheBehavior
   -> Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag]
   -> LightsailDistribution)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe ResourceLocation
      -> Maybe CacheSettings
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe CacheBehavior
      -> Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag]
      -> LightsailDistribution)
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
"createdAt")
            Parser
  (Maybe ResourceLocation
   -> Maybe CacheSettings
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe CacheBehavior
   -> Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag]
   -> LightsailDistribution)
-> Parser (Maybe ResourceLocation)
-> Parser
     (Maybe CacheSettings
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe CacheBehavior
      -> Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag]
      -> LightsailDistribution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"location")
            Parser
  (Maybe CacheSettings
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe CacheBehavior
   -> Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag]
   -> LightsailDistribution)
-> Parser (Maybe CacheSettings)
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe CacheBehavior
      -> Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag]
      -> LightsailDistribution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CacheSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cacheBehaviorSettings")
            Parser
  (Maybe [Text]
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe CacheBehavior
   -> Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag]
   -> LightsailDistribution)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe CacheBehavior
      -> Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag]
      -> LightsailDistribution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"alternativeDomainNames"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe CacheBehavior
   -> Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag]
   -> LightsailDistribution)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe CacheBehavior
      -> Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag]
      -> LightsailDistribution)
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
"bundleId")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe CacheBehavior
   -> Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag]
   -> LightsailDistribution)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe CacheBehavior
      -> Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag]
      -> LightsailDistribution)
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
"ableToUpdateBundle")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe CacheBehavior
   -> Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag]
   -> LightsailDistribution)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe CacheBehavior
      -> Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag]
      -> LightsailDistribution)
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
"originPublicDNS")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe CacheBehavior
   -> Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag]
   -> LightsailDistribution)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe IpAddressType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe CacheBehavior
      -> Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag]
      -> LightsailDistribution)
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
"domainName")
            Parser
  (Maybe Text
   -> Maybe IpAddressType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe CacheBehavior
   -> Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag]
   -> LightsailDistribution)
-> Parser (Maybe Text)
-> Parser
     (Maybe IpAddressType
      -> Maybe Bool
      -> Maybe Text
      -> Maybe CacheBehavior
      -> Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag]
      -> LightsailDistribution)
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 IpAddressType
   -> Maybe Bool
   -> Maybe Text
   -> Maybe CacheBehavior
   -> Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag]
   -> LightsailDistribution)
-> Parser (Maybe IpAddressType)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe CacheBehavior
      -> Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag]
      -> LightsailDistribution)
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 Bool
   -> Maybe Text
   -> Maybe CacheBehavior
   -> Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag]
   -> LightsailDistribution)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe CacheBehavior
      -> Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag]
      -> LightsailDistribution)
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
"isEnabled")
            Parser
  (Maybe Text
   -> Maybe CacheBehavior
   -> Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag]
   -> LightsailDistribution)
-> Parser (Maybe Text)
-> Parser
     (Maybe CacheBehavior
      -> Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag]
      -> LightsailDistribution)
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
"supportCode")
            Parser
  (Maybe CacheBehavior
   -> Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag]
   -> LightsailDistribution)
-> Parser (Maybe CacheBehavior)
-> Parser
     (Maybe [CacheBehaviorPerPath]
      -> Maybe [Tag] -> LightsailDistribution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CacheBehavior)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"defaultCacheBehavior")
            Parser
  (Maybe [CacheBehaviorPerPath]
   -> Maybe [Tag] -> LightsailDistribution)
-> Parser (Maybe [CacheBehaviorPerPath])
-> Parser (Maybe [Tag] -> LightsailDistribution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [CacheBehaviorPerPath]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cacheBehaviors" Parser (Maybe (Maybe [CacheBehaviorPerPath]))
-> Maybe [CacheBehaviorPerPath]
-> Parser (Maybe [CacheBehaviorPerPath])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [CacheBehaviorPerPath]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe [Tag] -> LightsailDistribution)
-> Parser (Maybe [Tag]) -> Parser LightsailDistribution
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable LightsailDistribution

instance Prelude.NFData LightsailDistribution