{-# 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.SecurityHub.Types.AwsCloudFrontDistributionViewerCertificate
-- 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.SecurityHub.Types.AwsCloudFrontDistributionViewerCertificate where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides information about the TLS\/SSL configuration that the
-- distribution uses to communicate with viewers.
--
-- /See:/ 'newAwsCloudFrontDistributionViewerCertificate' smart constructor.
data AwsCloudFrontDistributionViewerCertificate = AwsCloudFrontDistributionViewerCertificate'
  { -- | The viewers that the distribution accepts HTTPS connections from.
    AwsCloudFrontDistributionViewerCertificate -> Maybe Text
sslSupportMethod :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the ACM certificate. Used if the certificate is stored in
    -- ACM. If you provide an ACM certificate ARN, you must also provide
    -- @MinimumCertificateVersion@ and @SslSupportMethod@.
    AwsCloudFrontDistributionViewerCertificate -> Maybe Text
acmCertificateArn :: Prelude.Maybe Prelude.Text,
    -- | The source of the certificate identified by @Certificate@. Note that in
    -- CloudFront, this attribute is deprecated.
    AwsCloudFrontDistributionViewerCertificate -> Maybe Text
certificateSource :: Prelude.Maybe Prelude.Text,
    -- | The security policy that CloudFront uses for HTTPS connections with
    -- viewers. If @SslSupportMethod@ is @sni-only@, then
    -- @MinimumProtocolVersion@ must be @TLSv1@ or higher.
    AwsCloudFrontDistributionViewerCertificate -> Maybe Text
minimumProtocolVersion :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the certificate. Note that in CloudFront, this
    -- attribute is deprecated.
    AwsCloudFrontDistributionViewerCertificate -> Maybe Text
certificate :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the IAM certificate. Used if the certificate is stored
    -- in IAM. If you provide @IamCertificateId@, then you also must provide
    -- @MinimumProtocolVersion@ and @SslSupportMethod@.
    AwsCloudFrontDistributionViewerCertificate -> Maybe Text
iamCertificateId :: Prelude.Maybe Prelude.Text,
    -- | Whether the distribution uses the CloudFront domain name. If set to
    -- @false@, then you provide either @AcmCertificateArn@ or
    -- @IamCertificateId@.
    AwsCloudFrontDistributionViewerCertificate -> Maybe Bool
cloudFrontDefaultCertificate :: Prelude.Maybe Prelude.Bool
  }
  deriving (AwsCloudFrontDistributionViewerCertificate
-> AwsCloudFrontDistributionViewerCertificate -> Bool
(AwsCloudFrontDistributionViewerCertificate
 -> AwsCloudFrontDistributionViewerCertificate -> Bool)
-> (AwsCloudFrontDistributionViewerCertificate
    -> AwsCloudFrontDistributionViewerCertificate -> Bool)
-> Eq AwsCloudFrontDistributionViewerCertificate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsCloudFrontDistributionViewerCertificate
-> AwsCloudFrontDistributionViewerCertificate -> Bool
$c/= :: AwsCloudFrontDistributionViewerCertificate
-> AwsCloudFrontDistributionViewerCertificate -> Bool
== :: AwsCloudFrontDistributionViewerCertificate
-> AwsCloudFrontDistributionViewerCertificate -> Bool
$c== :: AwsCloudFrontDistributionViewerCertificate
-> AwsCloudFrontDistributionViewerCertificate -> Bool
Prelude.Eq, ReadPrec [AwsCloudFrontDistributionViewerCertificate]
ReadPrec AwsCloudFrontDistributionViewerCertificate
Int -> ReadS AwsCloudFrontDistributionViewerCertificate
ReadS [AwsCloudFrontDistributionViewerCertificate]
(Int -> ReadS AwsCloudFrontDistributionViewerCertificate)
-> ReadS [AwsCloudFrontDistributionViewerCertificate]
-> ReadPrec AwsCloudFrontDistributionViewerCertificate
-> ReadPrec [AwsCloudFrontDistributionViewerCertificate]
-> Read AwsCloudFrontDistributionViewerCertificate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsCloudFrontDistributionViewerCertificate]
$creadListPrec :: ReadPrec [AwsCloudFrontDistributionViewerCertificate]
readPrec :: ReadPrec AwsCloudFrontDistributionViewerCertificate
$creadPrec :: ReadPrec AwsCloudFrontDistributionViewerCertificate
readList :: ReadS [AwsCloudFrontDistributionViewerCertificate]
$creadList :: ReadS [AwsCloudFrontDistributionViewerCertificate]
readsPrec :: Int -> ReadS AwsCloudFrontDistributionViewerCertificate
$creadsPrec :: Int -> ReadS AwsCloudFrontDistributionViewerCertificate
Prelude.Read, Int -> AwsCloudFrontDistributionViewerCertificate -> ShowS
[AwsCloudFrontDistributionViewerCertificate] -> ShowS
AwsCloudFrontDistributionViewerCertificate -> String
(Int -> AwsCloudFrontDistributionViewerCertificate -> ShowS)
-> (AwsCloudFrontDistributionViewerCertificate -> String)
-> ([AwsCloudFrontDistributionViewerCertificate] -> ShowS)
-> Show AwsCloudFrontDistributionViewerCertificate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsCloudFrontDistributionViewerCertificate] -> ShowS
$cshowList :: [AwsCloudFrontDistributionViewerCertificate] -> ShowS
show :: AwsCloudFrontDistributionViewerCertificate -> String
$cshow :: AwsCloudFrontDistributionViewerCertificate -> String
showsPrec :: Int -> AwsCloudFrontDistributionViewerCertificate -> ShowS
$cshowsPrec :: Int -> AwsCloudFrontDistributionViewerCertificate -> ShowS
Prelude.Show, (forall x.
 AwsCloudFrontDistributionViewerCertificate
 -> Rep AwsCloudFrontDistributionViewerCertificate x)
-> (forall x.
    Rep AwsCloudFrontDistributionViewerCertificate x
    -> AwsCloudFrontDistributionViewerCertificate)
-> Generic AwsCloudFrontDistributionViewerCertificate
forall x.
Rep AwsCloudFrontDistributionViewerCertificate x
-> AwsCloudFrontDistributionViewerCertificate
forall x.
AwsCloudFrontDistributionViewerCertificate
-> Rep AwsCloudFrontDistributionViewerCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsCloudFrontDistributionViewerCertificate x
-> AwsCloudFrontDistributionViewerCertificate
$cfrom :: forall x.
AwsCloudFrontDistributionViewerCertificate
-> Rep AwsCloudFrontDistributionViewerCertificate x
Prelude.Generic)

-- |
-- Create a value of 'AwsCloudFrontDistributionViewerCertificate' 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:
--
-- 'sslSupportMethod', 'awsCloudFrontDistributionViewerCertificate_sslSupportMethod' - The viewers that the distribution accepts HTTPS connections from.
--
-- 'acmCertificateArn', 'awsCloudFrontDistributionViewerCertificate_acmCertificateArn' - The ARN of the ACM certificate. Used if the certificate is stored in
-- ACM. If you provide an ACM certificate ARN, you must also provide
-- @MinimumCertificateVersion@ and @SslSupportMethod@.
--
-- 'certificateSource', 'awsCloudFrontDistributionViewerCertificate_certificateSource' - The source of the certificate identified by @Certificate@. Note that in
-- CloudFront, this attribute is deprecated.
--
-- 'minimumProtocolVersion', 'awsCloudFrontDistributionViewerCertificate_minimumProtocolVersion' - The security policy that CloudFront uses for HTTPS connections with
-- viewers. If @SslSupportMethod@ is @sni-only@, then
-- @MinimumProtocolVersion@ must be @TLSv1@ or higher.
--
-- 'certificate', 'awsCloudFrontDistributionViewerCertificate_certificate' - The identifier of the certificate. Note that in CloudFront, this
-- attribute is deprecated.
--
-- 'iamCertificateId', 'awsCloudFrontDistributionViewerCertificate_iamCertificateId' - The identifier of the IAM certificate. Used if the certificate is stored
-- in IAM. If you provide @IamCertificateId@, then you also must provide
-- @MinimumProtocolVersion@ and @SslSupportMethod@.
--
-- 'cloudFrontDefaultCertificate', 'awsCloudFrontDistributionViewerCertificate_cloudFrontDefaultCertificate' - Whether the distribution uses the CloudFront domain name. If set to
-- @false@, then you provide either @AcmCertificateArn@ or
-- @IamCertificateId@.
newAwsCloudFrontDistributionViewerCertificate ::
  AwsCloudFrontDistributionViewerCertificate
newAwsCloudFrontDistributionViewerCertificate :: AwsCloudFrontDistributionViewerCertificate
newAwsCloudFrontDistributionViewerCertificate =
  AwsCloudFrontDistributionViewerCertificate' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> AwsCloudFrontDistributionViewerCertificate
AwsCloudFrontDistributionViewerCertificate'
    { $sel:sslSupportMethod:AwsCloudFrontDistributionViewerCertificate' :: Maybe Text
sslSupportMethod =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:acmCertificateArn:AwsCloudFrontDistributionViewerCertificate' :: Maybe Text
acmCertificateArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateSource:AwsCloudFrontDistributionViewerCertificate' :: Maybe Text
certificateSource =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:minimumProtocolVersion:AwsCloudFrontDistributionViewerCertificate' :: Maybe Text
minimumProtocolVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificate:AwsCloudFrontDistributionViewerCertificate' :: Maybe Text
certificate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:iamCertificateId:AwsCloudFrontDistributionViewerCertificate' :: Maybe Text
iamCertificateId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cloudFrontDefaultCertificate:AwsCloudFrontDistributionViewerCertificate' :: Maybe Bool
cloudFrontDefaultCertificate =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | The viewers that the distribution accepts HTTPS connections from.
awsCloudFrontDistributionViewerCertificate_sslSupportMethod :: Lens.Lens' AwsCloudFrontDistributionViewerCertificate (Prelude.Maybe Prelude.Text)
awsCloudFrontDistributionViewerCertificate_sslSupportMethod :: (Maybe Text -> f (Maybe Text))
-> AwsCloudFrontDistributionViewerCertificate
-> f AwsCloudFrontDistributionViewerCertificate
awsCloudFrontDistributionViewerCertificate_sslSupportMethod = (AwsCloudFrontDistributionViewerCertificate -> Maybe Text)
-> (AwsCloudFrontDistributionViewerCertificate
    -> Maybe Text -> AwsCloudFrontDistributionViewerCertificate)
-> Lens
     AwsCloudFrontDistributionViewerCertificate
     AwsCloudFrontDistributionViewerCertificate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudFrontDistributionViewerCertificate' {Maybe Text
sslSupportMethod :: Maybe Text
$sel:sslSupportMethod:AwsCloudFrontDistributionViewerCertificate' :: AwsCloudFrontDistributionViewerCertificate -> Maybe Text
sslSupportMethod} -> Maybe Text
sslSupportMethod) (\s :: AwsCloudFrontDistributionViewerCertificate
s@AwsCloudFrontDistributionViewerCertificate' {} Maybe Text
a -> AwsCloudFrontDistributionViewerCertificate
s {$sel:sslSupportMethod:AwsCloudFrontDistributionViewerCertificate' :: Maybe Text
sslSupportMethod = Maybe Text
a} :: AwsCloudFrontDistributionViewerCertificate)

-- | The ARN of the ACM certificate. Used if the certificate is stored in
-- ACM. If you provide an ACM certificate ARN, you must also provide
-- @MinimumCertificateVersion@ and @SslSupportMethod@.
awsCloudFrontDistributionViewerCertificate_acmCertificateArn :: Lens.Lens' AwsCloudFrontDistributionViewerCertificate (Prelude.Maybe Prelude.Text)
awsCloudFrontDistributionViewerCertificate_acmCertificateArn :: (Maybe Text -> f (Maybe Text))
-> AwsCloudFrontDistributionViewerCertificate
-> f AwsCloudFrontDistributionViewerCertificate
awsCloudFrontDistributionViewerCertificate_acmCertificateArn = (AwsCloudFrontDistributionViewerCertificate -> Maybe Text)
-> (AwsCloudFrontDistributionViewerCertificate
    -> Maybe Text -> AwsCloudFrontDistributionViewerCertificate)
-> Lens
     AwsCloudFrontDistributionViewerCertificate
     AwsCloudFrontDistributionViewerCertificate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudFrontDistributionViewerCertificate' {Maybe Text
acmCertificateArn :: Maybe Text
$sel:acmCertificateArn:AwsCloudFrontDistributionViewerCertificate' :: AwsCloudFrontDistributionViewerCertificate -> Maybe Text
acmCertificateArn} -> Maybe Text
acmCertificateArn) (\s :: AwsCloudFrontDistributionViewerCertificate
s@AwsCloudFrontDistributionViewerCertificate' {} Maybe Text
a -> AwsCloudFrontDistributionViewerCertificate
s {$sel:acmCertificateArn:AwsCloudFrontDistributionViewerCertificate' :: Maybe Text
acmCertificateArn = Maybe Text
a} :: AwsCloudFrontDistributionViewerCertificate)

-- | The source of the certificate identified by @Certificate@. Note that in
-- CloudFront, this attribute is deprecated.
awsCloudFrontDistributionViewerCertificate_certificateSource :: Lens.Lens' AwsCloudFrontDistributionViewerCertificate (Prelude.Maybe Prelude.Text)
awsCloudFrontDistributionViewerCertificate_certificateSource :: (Maybe Text -> f (Maybe Text))
-> AwsCloudFrontDistributionViewerCertificate
-> f AwsCloudFrontDistributionViewerCertificate
awsCloudFrontDistributionViewerCertificate_certificateSource = (AwsCloudFrontDistributionViewerCertificate -> Maybe Text)
-> (AwsCloudFrontDistributionViewerCertificate
    -> Maybe Text -> AwsCloudFrontDistributionViewerCertificate)
-> Lens
     AwsCloudFrontDistributionViewerCertificate
     AwsCloudFrontDistributionViewerCertificate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudFrontDistributionViewerCertificate' {Maybe Text
certificateSource :: Maybe Text
$sel:certificateSource:AwsCloudFrontDistributionViewerCertificate' :: AwsCloudFrontDistributionViewerCertificate -> Maybe Text
certificateSource} -> Maybe Text
certificateSource) (\s :: AwsCloudFrontDistributionViewerCertificate
s@AwsCloudFrontDistributionViewerCertificate' {} Maybe Text
a -> AwsCloudFrontDistributionViewerCertificate
s {$sel:certificateSource:AwsCloudFrontDistributionViewerCertificate' :: Maybe Text
certificateSource = Maybe Text
a} :: AwsCloudFrontDistributionViewerCertificate)

-- | The security policy that CloudFront uses for HTTPS connections with
-- viewers. If @SslSupportMethod@ is @sni-only@, then
-- @MinimumProtocolVersion@ must be @TLSv1@ or higher.
awsCloudFrontDistributionViewerCertificate_minimumProtocolVersion :: Lens.Lens' AwsCloudFrontDistributionViewerCertificate (Prelude.Maybe Prelude.Text)
awsCloudFrontDistributionViewerCertificate_minimumProtocolVersion :: (Maybe Text -> f (Maybe Text))
-> AwsCloudFrontDistributionViewerCertificate
-> f AwsCloudFrontDistributionViewerCertificate
awsCloudFrontDistributionViewerCertificate_minimumProtocolVersion = (AwsCloudFrontDistributionViewerCertificate -> Maybe Text)
-> (AwsCloudFrontDistributionViewerCertificate
    -> Maybe Text -> AwsCloudFrontDistributionViewerCertificate)
-> Lens
     AwsCloudFrontDistributionViewerCertificate
     AwsCloudFrontDistributionViewerCertificate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudFrontDistributionViewerCertificate' {Maybe Text
minimumProtocolVersion :: Maybe Text
$sel:minimumProtocolVersion:AwsCloudFrontDistributionViewerCertificate' :: AwsCloudFrontDistributionViewerCertificate -> Maybe Text
minimumProtocolVersion} -> Maybe Text
minimumProtocolVersion) (\s :: AwsCloudFrontDistributionViewerCertificate
s@AwsCloudFrontDistributionViewerCertificate' {} Maybe Text
a -> AwsCloudFrontDistributionViewerCertificate
s {$sel:minimumProtocolVersion:AwsCloudFrontDistributionViewerCertificate' :: Maybe Text
minimumProtocolVersion = Maybe Text
a} :: AwsCloudFrontDistributionViewerCertificate)

-- | The identifier of the certificate. Note that in CloudFront, this
-- attribute is deprecated.
awsCloudFrontDistributionViewerCertificate_certificate :: Lens.Lens' AwsCloudFrontDistributionViewerCertificate (Prelude.Maybe Prelude.Text)
awsCloudFrontDistributionViewerCertificate_certificate :: (Maybe Text -> f (Maybe Text))
-> AwsCloudFrontDistributionViewerCertificate
-> f AwsCloudFrontDistributionViewerCertificate
awsCloudFrontDistributionViewerCertificate_certificate = (AwsCloudFrontDistributionViewerCertificate -> Maybe Text)
-> (AwsCloudFrontDistributionViewerCertificate
    -> Maybe Text -> AwsCloudFrontDistributionViewerCertificate)
-> Lens
     AwsCloudFrontDistributionViewerCertificate
     AwsCloudFrontDistributionViewerCertificate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudFrontDistributionViewerCertificate' {Maybe Text
certificate :: Maybe Text
$sel:certificate:AwsCloudFrontDistributionViewerCertificate' :: AwsCloudFrontDistributionViewerCertificate -> Maybe Text
certificate} -> Maybe Text
certificate) (\s :: AwsCloudFrontDistributionViewerCertificate
s@AwsCloudFrontDistributionViewerCertificate' {} Maybe Text
a -> AwsCloudFrontDistributionViewerCertificate
s {$sel:certificate:AwsCloudFrontDistributionViewerCertificate' :: Maybe Text
certificate = Maybe Text
a} :: AwsCloudFrontDistributionViewerCertificate)

-- | The identifier of the IAM certificate. Used if the certificate is stored
-- in IAM. If you provide @IamCertificateId@, then you also must provide
-- @MinimumProtocolVersion@ and @SslSupportMethod@.
awsCloudFrontDistributionViewerCertificate_iamCertificateId :: Lens.Lens' AwsCloudFrontDistributionViewerCertificate (Prelude.Maybe Prelude.Text)
awsCloudFrontDistributionViewerCertificate_iamCertificateId :: (Maybe Text -> f (Maybe Text))
-> AwsCloudFrontDistributionViewerCertificate
-> f AwsCloudFrontDistributionViewerCertificate
awsCloudFrontDistributionViewerCertificate_iamCertificateId = (AwsCloudFrontDistributionViewerCertificate -> Maybe Text)
-> (AwsCloudFrontDistributionViewerCertificate
    -> Maybe Text -> AwsCloudFrontDistributionViewerCertificate)
-> Lens
     AwsCloudFrontDistributionViewerCertificate
     AwsCloudFrontDistributionViewerCertificate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudFrontDistributionViewerCertificate' {Maybe Text
iamCertificateId :: Maybe Text
$sel:iamCertificateId:AwsCloudFrontDistributionViewerCertificate' :: AwsCloudFrontDistributionViewerCertificate -> Maybe Text
iamCertificateId} -> Maybe Text
iamCertificateId) (\s :: AwsCloudFrontDistributionViewerCertificate
s@AwsCloudFrontDistributionViewerCertificate' {} Maybe Text
a -> AwsCloudFrontDistributionViewerCertificate
s {$sel:iamCertificateId:AwsCloudFrontDistributionViewerCertificate' :: Maybe Text
iamCertificateId = Maybe Text
a} :: AwsCloudFrontDistributionViewerCertificate)

-- | Whether the distribution uses the CloudFront domain name. If set to
-- @false@, then you provide either @AcmCertificateArn@ or
-- @IamCertificateId@.
awsCloudFrontDistributionViewerCertificate_cloudFrontDefaultCertificate :: Lens.Lens' AwsCloudFrontDistributionViewerCertificate (Prelude.Maybe Prelude.Bool)
awsCloudFrontDistributionViewerCertificate_cloudFrontDefaultCertificate :: (Maybe Bool -> f (Maybe Bool))
-> AwsCloudFrontDistributionViewerCertificate
-> f AwsCloudFrontDistributionViewerCertificate
awsCloudFrontDistributionViewerCertificate_cloudFrontDefaultCertificate = (AwsCloudFrontDistributionViewerCertificate -> Maybe Bool)
-> (AwsCloudFrontDistributionViewerCertificate
    -> Maybe Bool -> AwsCloudFrontDistributionViewerCertificate)
-> Lens
     AwsCloudFrontDistributionViewerCertificate
     AwsCloudFrontDistributionViewerCertificate
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCloudFrontDistributionViewerCertificate' {Maybe Bool
cloudFrontDefaultCertificate :: Maybe Bool
$sel:cloudFrontDefaultCertificate:AwsCloudFrontDistributionViewerCertificate' :: AwsCloudFrontDistributionViewerCertificate -> Maybe Bool
cloudFrontDefaultCertificate} -> Maybe Bool
cloudFrontDefaultCertificate) (\s :: AwsCloudFrontDistributionViewerCertificate
s@AwsCloudFrontDistributionViewerCertificate' {} Maybe Bool
a -> AwsCloudFrontDistributionViewerCertificate
s {$sel:cloudFrontDefaultCertificate:AwsCloudFrontDistributionViewerCertificate' :: Maybe Bool
cloudFrontDefaultCertificate = Maybe Bool
a} :: AwsCloudFrontDistributionViewerCertificate)

instance
  Core.FromJSON
    AwsCloudFrontDistributionViewerCertificate
  where
  parseJSON :: Value -> Parser AwsCloudFrontDistributionViewerCertificate
parseJSON =
    String
-> (Object -> Parser AwsCloudFrontDistributionViewerCertificate)
-> Value
-> Parser AwsCloudFrontDistributionViewerCertificate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsCloudFrontDistributionViewerCertificate"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> AwsCloudFrontDistributionViewerCertificate
AwsCloudFrontDistributionViewerCertificate'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> AwsCloudFrontDistributionViewerCertificate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> AwsCloudFrontDistributionViewerCertificate)
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
"SslSupportMethod")
              Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> AwsCloudFrontDistributionViewerCertificate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> AwsCloudFrontDistributionViewerCertificate)
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
"AcmCertificateArn")
              Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> AwsCloudFrontDistributionViewerCertificate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> AwsCloudFrontDistributionViewerCertificate)
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
"CertificateSource")
              Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> AwsCloudFrontDistributionViewerCertificate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> AwsCloudFrontDistributionViewerCertificate)
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
"MinimumProtocolVersion")
              Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> AwsCloudFrontDistributionViewerCertificate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool -> AwsCloudFrontDistributionViewerCertificate)
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
"Certificate")
              Parser
  (Maybe Text
   -> Maybe Bool -> AwsCloudFrontDistributionViewerCertificate)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool -> AwsCloudFrontDistributionViewerCertificate)
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
"IamCertificateId")
              Parser (Maybe Bool -> AwsCloudFrontDistributionViewerCertificate)
-> Parser (Maybe Bool)
-> Parser AwsCloudFrontDistributionViewerCertificate
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
"CloudFrontDefaultCertificate")
      )

instance
  Prelude.Hashable
    AwsCloudFrontDistributionViewerCertificate

instance
  Prelude.NFData
    AwsCloudFrontDistributionViewerCertificate

instance
  Core.ToJSON
    AwsCloudFrontDistributionViewerCertificate
  where
  toJSON :: AwsCloudFrontDistributionViewerCertificate -> Value
toJSON
    AwsCloudFrontDistributionViewerCertificate' {Maybe Bool
Maybe Text
cloudFrontDefaultCertificate :: Maybe Bool
iamCertificateId :: Maybe Text
certificate :: Maybe Text
minimumProtocolVersion :: Maybe Text
certificateSource :: Maybe Text
acmCertificateArn :: Maybe Text
sslSupportMethod :: Maybe Text
$sel:cloudFrontDefaultCertificate:AwsCloudFrontDistributionViewerCertificate' :: AwsCloudFrontDistributionViewerCertificate -> Maybe Bool
$sel:iamCertificateId:AwsCloudFrontDistributionViewerCertificate' :: AwsCloudFrontDistributionViewerCertificate -> Maybe Text
$sel:certificate:AwsCloudFrontDistributionViewerCertificate' :: AwsCloudFrontDistributionViewerCertificate -> Maybe Text
$sel:minimumProtocolVersion:AwsCloudFrontDistributionViewerCertificate' :: AwsCloudFrontDistributionViewerCertificate -> Maybe Text
$sel:certificateSource:AwsCloudFrontDistributionViewerCertificate' :: AwsCloudFrontDistributionViewerCertificate -> Maybe Text
$sel:acmCertificateArn:AwsCloudFrontDistributionViewerCertificate' :: AwsCloudFrontDistributionViewerCertificate -> Maybe Text
$sel:sslSupportMethod:AwsCloudFrontDistributionViewerCertificate' :: AwsCloudFrontDistributionViewerCertificate -> Maybe Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"SslSupportMethod" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sslSupportMethod,
              (Text
"AcmCertificateArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
acmCertificateArn,
              (Text
"CertificateSource" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
certificateSource,
              (Text
"MinimumProtocolVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
minimumProtocolVersion,
              (Text
"Certificate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
certificate,
              (Text
"IamCertificateId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
iamCertificateId,
              (Text
"CloudFrontDefaultCertificate" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
cloudFrontDefaultCertificate
            ]
        )