{-# 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.AwsCertificateManagerCertificateDomainValidationOption
-- 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.AwsCertificateManagerCertificateDomainValidationOption where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsCertificateManagerCertificateResourceRecord

-- | Contains information about one of the following:
--
-- -   The initial validation of each domain name that occurs as a result
--     of the @RequestCertificate@ request
--
-- -   The validation of each domain name in the certificate, as it
--     pertains to Certificate Manager managed renewal
--
-- /See:/ 'newAwsCertificateManagerCertificateDomainValidationOption' smart constructor.
data AwsCertificateManagerCertificateDomainValidationOption = AwsCertificateManagerCertificateDomainValidationOption'
  { -- | A list of email addresses that Certificate Manager uses to send domain
    -- validation emails.
    AwsCertificateManagerCertificateDomainValidationOption
-> Maybe [Text]
validationEmails :: Prelude.Maybe [Prelude.Text],
    -- | The method used to validate the domain name.
    AwsCertificateManagerCertificateDomainValidationOption
-> Maybe Text
validationMethod :: Prelude.Maybe Prelude.Text,
    -- | The CNAME record that is added to the DNS database for domain
    -- validation.
    AwsCertificateManagerCertificateDomainValidationOption
-> Maybe AwsCertificateManagerCertificateResourceRecord
resourceRecord :: Prelude.Maybe AwsCertificateManagerCertificateResourceRecord,
    -- | The validation status of the domain name.
    AwsCertificateManagerCertificateDomainValidationOption
-> Maybe Text
validationStatus :: Prelude.Maybe Prelude.Text,
    -- | A fully qualified domain name (FQDN) in the certificate.
    AwsCertificateManagerCertificateDomainValidationOption
-> Maybe Text
domainName :: Prelude.Maybe Prelude.Text,
    -- | The domain name that Certificate Manager uses to send domain validation
    -- emails.
    AwsCertificateManagerCertificateDomainValidationOption
-> Maybe Text
validationDomain :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsCertificateManagerCertificateDomainValidationOption
-> AwsCertificateManagerCertificateDomainValidationOption -> Bool
(AwsCertificateManagerCertificateDomainValidationOption
 -> AwsCertificateManagerCertificateDomainValidationOption -> Bool)
-> (AwsCertificateManagerCertificateDomainValidationOption
    -> AwsCertificateManagerCertificateDomainValidationOption -> Bool)
-> Eq AwsCertificateManagerCertificateDomainValidationOption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsCertificateManagerCertificateDomainValidationOption
-> AwsCertificateManagerCertificateDomainValidationOption -> Bool
$c/= :: AwsCertificateManagerCertificateDomainValidationOption
-> AwsCertificateManagerCertificateDomainValidationOption -> Bool
== :: AwsCertificateManagerCertificateDomainValidationOption
-> AwsCertificateManagerCertificateDomainValidationOption -> Bool
$c== :: AwsCertificateManagerCertificateDomainValidationOption
-> AwsCertificateManagerCertificateDomainValidationOption -> Bool
Prelude.Eq, ReadPrec [AwsCertificateManagerCertificateDomainValidationOption]
ReadPrec AwsCertificateManagerCertificateDomainValidationOption
Int -> ReadS AwsCertificateManagerCertificateDomainValidationOption
ReadS [AwsCertificateManagerCertificateDomainValidationOption]
(Int
 -> ReadS AwsCertificateManagerCertificateDomainValidationOption)
-> ReadS [AwsCertificateManagerCertificateDomainValidationOption]
-> ReadPrec AwsCertificateManagerCertificateDomainValidationOption
-> ReadPrec
     [AwsCertificateManagerCertificateDomainValidationOption]
-> Read AwsCertificateManagerCertificateDomainValidationOption
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsCertificateManagerCertificateDomainValidationOption]
$creadListPrec :: ReadPrec [AwsCertificateManagerCertificateDomainValidationOption]
readPrec :: ReadPrec AwsCertificateManagerCertificateDomainValidationOption
$creadPrec :: ReadPrec AwsCertificateManagerCertificateDomainValidationOption
readList :: ReadS [AwsCertificateManagerCertificateDomainValidationOption]
$creadList :: ReadS [AwsCertificateManagerCertificateDomainValidationOption]
readsPrec :: Int -> ReadS AwsCertificateManagerCertificateDomainValidationOption
$creadsPrec :: Int -> ReadS AwsCertificateManagerCertificateDomainValidationOption
Prelude.Read, Int
-> AwsCertificateManagerCertificateDomainValidationOption -> ShowS
[AwsCertificateManagerCertificateDomainValidationOption] -> ShowS
AwsCertificateManagerCertificateDomainValidationOption -> String
(Int
 -> AwsCertificateManagerCertificateDomainValidationOption -> ShowS)
-> (AwsCertificateManagerCertificateDomainValidationOption
    -> String)
-> ([AwsCertificateManagerCertificateDomainValidationOption]
    -> ShowS)
-> Show AwsCertificateManagerCertificateDomainValidationOption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsCertificateManagerCertificateDomainValidationOption] -> ShowS
$cshowList :: [AwsCertificateManagerCertificateDomainValidationOption] -> ShowS
show :: AwsCertificateManagerCertificateDomainValidationOption -> String
$cshow :: AwsCertificateManagerCertificateDomainValidationOption -> String
showsPrec :: Int
-> AwsCertificateManagerCertificateDomainValidationOption -> ShowS
$cshowsPrec :: Int
-> AwsCertificateManagerCertificateDomainValidationOption -> ShowS
Prelude.Show, (forall x.
 AwsCertificateManagerCertificateDomainValidationOption
 -> Rep AwsCertificateManagerCertificateDomainValidationOption x)
-> (forall x.
    Rep AwsCertificateManagerCertificateDomainValidationOption x
    -> AwsCertificateManagerCertificateDomainValidationOption)
-> Generic AwsCertificateManagerCertificateDomainValidationOption
forall x.
Rep AwsCertificateManagerCertificateDomainValidationOption x
-> AwsCertificateManagerCertificateDomainValidationOption
forall x.
AwsCertificateManagerCertificateDomainValidationOption
-> Rep AwsCertificateManagerCertificateDomainValidationOption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsCertificateManagerCertificateDomainValidationOption x
-> AwsCertificateManagerCertificateDomainValidationOption
$cfrom :: forall x.
AwsCertificateManagerCertificateDomainValidationOption
-> Rep AwsCertificateManagerCertificateDomainValidationOption x
Prelude.Generic)

-- |
-- Create a value of 'AwsCertificateManagerCertificateDomainValidationOption' 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:
--
-- 'validationEmails', 'awsCertificateManagerCertificateDomainValidationOption_validationEmails' - A list of email addresses that Certificate Manager uses to send domain
-- validation emails.
--
-- 'validationMethod', 'awsCertificateManagerCertificateDomainValidationOption_validationMethod' - The method used to validate the domain name.
--
-- 'resourceRecord', 'awsCertificateManagerCertificateDomainValidationOption_resourceRecord' - The CNAME record that is added to the DNS database for domain
-- validation.
--
-- 'validationStatus', 'awsCertificateManagerCertificateDomainValidationOption_validationStatus' - The validation status of the domain name.
--
-- 'domainName', 'awsCertificateManagerCertificateDomainValidationOption_domainName' - A fully qualified domain name (FQDN) in the certificate.
--
-- 'validationDomain', 'awsCertificateManagerCertificateDomainValidationOption_validationDomain' - The domain name that Certificate Manager uses to send domain validation
-- emails.
newAwsCertificateManagerCertificateDomainValidationOption ::
  AwsCertificateManagerCertificateDomainValidationOption
newAwsCertificateManagerCertificateDomainValidationOption :: AwsCertificateManagerCertificateDomainValidationOption
newAwsCertificateManagerCertificateDomainValidationOption =
  AwsCertificateManagerCertificateDomainValidationOption' :: Maybe [Text]
-> Maybe Text
-> Maybe AwsCertificateManagerCertificateResourceRecord
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsCertificateManagerCertificateDomainValidationOption
AwsCertificateManagerCertificateDomainValidationOption'
    { $sel:validationEmails:AwsCertificateManagerCertificateDomainValidationOption' :: Maybe [Text]
validationEmails =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:validationMethod:AwsCertificateManagerCertificateDomainValidationOption' :: Maybe Text
validationMethod =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceRecord:AwsCertificateManagerCertificateDomainValidationOption' :: Maybe AwsCertificateManagerCertificateResourceRecord
resourceRecord =
        Maybe AwsCertificateManagerCertificateResourceRecord
forall a. Maybe a
Prelude.Nothing,
      $sel:validationStatus:AwsCertificateManagerCertificateDomainValidationOption' :: Maybe Text
validationStatus =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainName:AwsCertificateManagerCertificateDomainValidationOption' :: Maybe Text
domainName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:validationDomain:AwsCertificateManagerCertificateDomainValidationOption' :: Maybe Text
validationDomain =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A list of email addresses that Certificate Manager uses to send domain
-- validation emails.
awsCertificateManagerCertificateDomainValidationOption_validationEmails :: Lens.Lens' AwsCertificateManagerCertificateDomainValidationOption (Prelude.Maybe [Prelude.Text])
awsCertificateManagerCertificateDomainValidationOption_validationEmails :: (Maybe [Text] -> f (Maybe [Text]))
-> AwsCertificateManagerCertificateDomainValidationOption
-> f AwsCertificateManagerCertificateDomainValidationOption
awsCertificateManagerCertificateDomainValidationOption_validationEmails = (AwsCertificateManagerCertificateDomainValidationOption
 -> Maybe [Text])
-> (AwsCertificateManagerCertificateDomainValidationOption
    -> Maybe [Text]
    -> AwsCertificateManagerCertificateDomainValidationOption)
-> Lens
     AwsCertificateManagerCertificateDomainValidationOption
     AwsCertificateManagerCertificateDomainValidationOption
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCertificateManagerCertificateDomainValidationOption' {Maybe [Text]
validationEmails :: Maybe [Text]
$sel:validationEmails:AwsCertificateManagerCertificateDomainValidationOption' :: AwsCertificateManagerCertificateDomainValidationOption
-> Maybe [Text]
validationEmails} -> Maybe [Text]
validationEmails) (\s :: AwsCertificateManagerCertificateDomainValidationOption
s@AwsCertificateManagerCertificateDomainValidationOption' {} Maybe [Text]
a -> AwsCertificateManagerCertificateDomainValidationOption
s {$sel:validationEmails:AwsCertificateManagerCertificateDomainValidationOption' :: Maybe [Text]
validationEmails = Maybe [Text]
a} :: AwsCertificateManagerCertificateDomainValidationOption) ((Maybe [Text] -> f (Maybe [Text]))
 -> AwsCertificateManagerCertificateDomainValidationOption
 -> f AwsCertificateManagerCertificateDomainValidationOption)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AwsCertificateManagerCertificateDomainValidationOption
-> f AwsCertificateManagerCertificateDomainValidationOption
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 method used to validate the domain name.
awsCertificateManagerCertificateDomainValidationOption_validationMethod :: Lens.Lens' AwsCertificateManagerCertificateDomainValidationOption (Prelude.Maybe Prelude.Text)
awsCertificateManagerCertificateDomainValidationOption_validationMethod :: (Maybe Text -> f (Maybe Text))
-> AwsCertificateManagerCertificateDomainValidationOption
-> f AwsCertificateManagerCertificateDomainValidationOption
awsCertificateManagerCertificateDomainValidationOption_validationMethod = (AwsCertificateManagerCertificateDomainValidationOption
 -> Maybe Text)
-> (AwsCertificateManagerCertificateDomainValidationOption
    -> Maybe Text
    -> AwsCertificateManagerCertificateDomainValidationOption)
-> Lens
     AwsCertificateManagerCertificateDomainValidationOption
     AwsCertificateManagerCertificateDomainValidationOption
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCertificateManagerCertificateDomainValidationOption' {Maybe Text
validationMethod :: Maybe Text
$sel:validationMethod:AwsCertificateManagerCertificateDomainValidationOption' :: AwsCertificateManagerCertificateDomainValidationOption
-> Maybe Text
validationMethod} -> Maybe Text
validationMethod) (\s :: AwsCertificateManagerCertificateDomainValidationOption
s@AwsCertificateManagerCertificateDomainValidationOption' {} Maybe Text
a -> AwsCertificateManagerCertificateDomainValidationOption
s {$sel:validationMethod:AwsCertificateManagerCertificateDomainValidationOption' :: Maybe Text
validationMethod = Maybe Text
a} :: AwsCertificateManagerCertificateDomainValidationOption)

-- | The CNAME record that is added to the DNS database for domain
-- validation.
awsCertificateManagerCertificateDomainValidationOption_resourceRecord :: Lens.Lens' AwsCertificateManagerCertificateDomainValidationOption (Prelude.Maybe AwsCertificateManagerCertificateResourceRecord)
awsCertificateManagerCertificateDomainValidationOption_resourceRecord :: (Maybe AwsCertificateManagerCertificateResourceRecord
 -> f (Maybe AwsCertificateManagerCertificateResourceRecord))
-> AwsCertificateManagerCertificateDomainValidationOption
-> f AwsCertificateManagerCertificateDomainValidationOption
awsCertificateManagerCertificateDomainValidationOption_resourceRecord = (AwsCertificateManagerCertificateDomainValidationOption
 -> Maybe AwsCertificateManagerCertificateResourceRecord)
-> (AwsCertificateManagerCertificateDomainValidationOption
    -> Maybe AwsCertificateManagerCertificateResourceRecord
    -> AwsCertificateManagerCertificateDomainValidationOption)
-> Lens
     AwsCertificateManagerCertificateDomainValidationOption
     AwsCertificateManagerCertificateDomainValidationOption
     (Maybe AwsCertificateManagerCertificateResourceRecord)
     (Maybe AwsCertificateManagerCertificateResourceRecord)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCertificateManagerCertificateDomainValidationOption' {Maybe AwsCertificateManagerCertificateResourceRecord
resourceRecord :: Maybe AwsCertificateManagerCertificateResourceRecord
$sel:resourceRecord:AwsCertificateManagerCertificateDomainValidationOption' :: AwsCertificateManagerCertificateDomainValidationOption
-> Maybe AwsCertificateManagerCertificateResourceRecord
resourceRecord} -> Maybe AwsCertificateManagerCertificateResourceRecord
resourceRecord) (\s :: AwsCertificateManagerCertificateDomainValidationOption
s@AwsCertificateManagerCertificateDomainValidationOption' {} Maybe AwsCertificateManagerCertificateResourceRecord
a -> AwsCertificateManagerCertificateDomainValidationOption
s {$sel:resourceRecord:AwsCertificateManagerCertificateDomainValidationOption' :: Maybe AwsCertificateManagerCertificateResourceRecord
resourceRecord = Maybe AwsCertificateManagerCertificateResourceRecord
a} :: AwsCertificateManagerCertificateDomainValidationOption)

-- | The validation status of the domain name.
awsCertificateManagerCertificateDomainValidationOption_validationStatus :: Lens.Lens' AwsCertificateManagerCertificateDomainValidationOption (Prelude.Maybe Prelude.Text)
awsCertificateManagerCertificateDomainValidationOption_validationStatus :: (Maybe Text -> f (Maybe Text))
-> AwsCertificateManagerCertificateDomainValidationOption
-> f AwsCertificateManagerCertificateDomainValidationOption
awsCertificateManagerCertificateDomainValidationOption_validationStatus = (AwsCertificateManagerCertificateDomainValidationOption
 -> Maybe Text)
-> (AwsCertificateManagerCertificateDomainValidationOption
    -> Maybe Text
    -> AwsCertificateManagerCertificateDomainValidationOption)
-> Lens
     AwsCertificateManagerCertificateDomainValidationOption
     AwsCertificateManagerCertificateDomainValidationOption
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCertificateManagerCertificateDomainValidationOption' {Maybe Text
validationStatus :: Maybe Text
$sel:validationStatus:AwsCertificateManagerCertificateDomainValidationOption' :: AwsCertificateManagerCertificateDomainValidationOption
-> Maybe Text
validationStatus} -> Maybe Text
validationStatus) (\s :: AwsCertificateManagerCertificateDomainValidationOption
s@AwsCertificateManagerCertificateDomainValidationOption' {} Maybe Text
a -> AwsCertificateManagerCertificateDomainValidationOption
s {$sel:validationStatus:AwsCertificateManagerCertificateDomainValidationOption' :: Maybe Text
validationStatus = Maybe Text
a} :: AwsCertificateManagerCertificateDomainValidationOption)

-- | A fully qualified domain name (FQDN) in the certificate.
awsCertificateManagerCertificateDomainValidationOption_domainName :: Lens.Lens' AwsCertificateManagerCertificateDomainValidationOption (Prelude.Maybe Prelude.Text)
awsCertificateManagerCertificateDomainValidationOption_domainName :: (Maybe Text -> f (Maybe Text))
-> AwsCertificateManagerCertificateDomainValidationOption
-> f AwsCertificateManagerCertificateDomainValidationOption
awsCertificateManagerCertificateDomainValidationOption_domainName = (AwsCertificateManagerCertificateDomainValidationOption
 -> Maybe Text)
-> (AwsCertificateManagerCertificateDomainValidationOption
    -> Maybe Text
    -> AwsCertificateManagerCertificateDomainValidationOption)
-> Lens
     AwsCertificateManagerCertificateDomainValidationOption
     AwsCertificateManagerCertificateDomainValidationOption
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCertificateManagerCertificateDomainValidationOption' {Maybe Text
domainName :: Maybe Text
$sel:domainName:AwsCertificateManagerCertificateDomainValidationOption' :: AwsCertificateManagerCertificateDomainValidationOption
-> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: AwsCertificateManagerCertificateDomainValidationOption
s@AwsCertificateManagerCertificateDomainValidationOption' {} Maybe Text
a -> AwsCertificateManagerCertificateDomainValidationOption
s {$sel:domainName:AwsCertificateManagerCertificateDomainValidationOption' :: Maybe Text
domainName = Maybe Text
a} :: AwsCertificateManagerCertificateDomainValidationOption)

-- | The domain name that Certificate Manager uses to send domain validation
-- emails.
awsCertificateManagerCertificateDomainValidationOption_validationDomain :: Lens.Lens' AwsCertificateManagerCertificateDomainValidationOption (Prelude.Maybe Prelude.Text)
awsCertificateManagerCertificateDomainValidationOption_validationDomain :: (Maybe Text -> f (Maybe Text))
-> AwsCertificateManagerCertificateDomainValidationOption
-> f AwsCertificateManagerCertificateDomainValidationOption
awsCertificateManagerCertificateDomainValidationOption_validationDomain = (AwsCertificateManagerCertificateDomainValidationOption
 -> Maybe Text)
-> (AwsCertificateManagerCertificateDomainValidationOption
    -> Maybe Text
    -> AwsCertificateManagerCertificateDomainValidationOption)
-> Lens
     AwsCertificateManagerCertificateDomainValidationOption
     AwsCertificateManagerCertificateDomainValidationOption
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsCertificateManagerCertificateDomainValidationOption' {Maybe Text
validationDomain :: Maybe Text
$sel:validationDomain:AwsCertificateManagerCertificateDomainValidationOption' :: AwsCertificateManagerCertificateDomainValidationOption
-> Maybe Text
validationDomain} -> Maybe Text
validationDomain) (\s :: AwsCertificateManagerCertificateDomainValidationOption
s@AwsCertificateManagerCertificateDomainValidationOption' {} Maybe Text
a -> AwsCertificateManagerCertificateDomainValidationOption
s {$sel:validationDomain:AwsCertificateManagerCertificateDomainValidationOption' :: Maybe Text
validationDomain = Maybe Text
a} :: AwsCertificateManagerCertificateDomainValidationOption)

instance
  Core.FromJSON
    AwsCertificateManagerCertificateDomainValidationOption
  where
  parseJSON :: Value
-> Parser AwsCertificateManagerCertificateDomainValidationOption
parseJSON =
    String
-> (Object
    -> Parser AwsCertificateManagerCertificateDomainValidationOption)
-> Value
-> Parser AwsCertificateManagerCertificateDomainValidationOption
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsCertificateManagerCertificateDomainValidationOption"
      ( \Object
x ->
          Maybe [Text]
-> Maybe Text
-> Maybe AwsCertificateManagerCertificateResourceRecord
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> AwsCertificateManagerCertificateDomainValidationOption
AwsCertificateManagerCertificateDomainValidationOption'
            (Maybe [Text]
 -> Maybe Text
 -> Maybe AwsCertificateManagerCertificateResourceRecord
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> AwsCertificateManagerCertificateDomainValidationOption)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe AwsCertificateManagerCertificateResourceRecord
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AwsCertificateManagerCertificateDomainValidationOption)
forall (f :: * -> *) a b. Functor 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
"ValidationEmails"
                            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 AwsCertificateManagerCertificateResourceRecord
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AwsCertificateManagerCertificateDomainValidationOption)
-> Parser (Maybe Text)
-> Parser
     (Maybe AwsCertificateManagerCertificateResourceRecord
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AwsCertificateManagerCertificateDomainValidationOption)
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
"ValidationMethod")
              Parser
  (Maybe AwsCertificateManagerCertificateResourceRecord
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AwsCertificateManagerCertificateDomainValidationOption)
-> Parser (Maybe AwsCertificateManagerCertificateResourceRecord)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> AwsCertificateManagerCertificateDomainValidationOption)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Parser (Maybe AwsCertificateManagerCertificateResourceRecord)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceRecord")
              Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> AwsCertificateManagerCertificateDomainValidationOption)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> AwsCertificateManagerCertificateDomainValidationOption)
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
"ValidationStatus")
              Parser
  (Maybe Text
   -> Maybe Text
   -> AwsCertificateManagerCertificateDomainValidationOption)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> AwsCertificateManagerCertificateDomainValidationOption)
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
   -> AwsCertificateManagerCertificateDomainValidationOption)
-> Parser (Maybe Text)
-> Parser AwsCertificateManagerCertificateDomainValidationOption
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
"ValidationDomain")
      )

instance
  Prelude.Hashable
    AwsCertificateManagerCertificateDomainValidationOption

instance
  Prelude.NFData
    AwsCertificateManagerCertificateDomainValidationOption

instance
  Core.ToJSON
    AwsCertificateManagerCertificateDomainValidationOption
  where
  toJSON :: AwsCertificateManagerCertificateDomainValidationOption -> Value
toJSON
    AwsCertificateManagerCertificateDomainValidationOption' {Maybe [Text]
Maybe Text
Maybe AwsCertificateManagerCertificateResourceRecord
validationDomain :: Maybe Text
domainName :: Maybe Text
validationStatus :: Maybe Text
resourceRecord :: Maybe AwsCertificateManagerCertificateResourceRecord
validationMethod :: Maybe Text
validationEmails :: Maybe [Text]
$sel:validationDomain:AwsCertificateManagerCertificateDomainValidationOption' :: AwsCertificateManagerCertificateDomainValidationOption
-> Maybe Text
$sel:domainName:AwsCertificateManagerCertificateDomainValidationOption' :: AwsCertificateManagerCertificateDomainValidationOption
-> Maybe Text
$sel:validationStatus:AwsCertificateManagerCertificateDomainValidationOption' :: AwsCertificateManagerCertificateDomainValidationOption
-> Maybe Text
$sel:resourceRecord:AwsCertificateManagerCertificateDomainValidationOption' :: AwsCertificateManagerCertificateDomainValidationOption
-> Maybe AwsCertificateManagerCertificateResourceRecord
$sel:validationMethod:AwsCertificateManagerCertificateDomainValidationOption' :: AwsCertificateManagerCertificateDomainValidationOption
-> Maybe Text
$sel:validationEmails:AwsCertificateManagerCertificateDomainValidationOption' :: AwsCertificateManagerCertificateDomainValidationOption
-> Maybe [Text]
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"ValidationEmails" 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]
validationEmails,
              (Text
"ValidationMethod" 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
validationMethod,
              (Text
"ResourceRecord" Text -> AwsCertificateManagerCertificateResourceRecord -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
                (AwsCertificateManagerCertificateResourceRecord -> Pair)
-> Maybe AwsCertificateManagerCertificateResourceRecord
-> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AwsCertificateManagerCertificateResourceRecord
resourceRecord,
              (Text
"ValidationStatus" 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
validationStatus,
              (Text
"DomainName" 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
domainName,
              (Text
"ValidationDomain" 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
validationDomain
            ]
        )