{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CertificateManager.Types.DomainValidation where
import Amazonka.CertificateManager.Types.DomainStatus
import Amazonka.CertificateManager.Types.ResourceRecord
import Amazonka.CertificateManager.Types.ValidationMethod
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DomainValidation = DomainValidation'
{
DomainValidation -> Maybe [Text]
validationEmails :: Prelude.Maybe [Prelude.Text],
DomainValidation -> Maybe ValidationMethod
validationMethod :: Prelude.Maybe ValidationMethod,
DomainValidation -> Maybe ResourceRecord
resourceRecord :: Prelude.Maybe ResourceRecord,
DomainValidation -> Maybe DomainStatus
validationStatus :: Prelude.Maybe DomainStatus,
DomainValidation -> Maybe Text
validationDomain :: Prelude.Maybe Prelude.Text,
DomainValidation -> Text
domainName :: Prelude.Text
}
deriving (DomainValidation -> DomainValidation -> Bool
(DomainValidation -> DomainValidation -> Bool)
-> (DomainValidation -> DomainValidation -> Bool)
-> Eq DomainValidation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainValidation -> DomainValidation -> Bool
$c/= :: DomainValidation -> DomainValidation -> Bool
== :: DomainValidation -> DomainValidation -> Bool
$c== :: DomainValidation -> DomainValidation -> Bool
Prelude.Eq, ReadPrec [DomainValidation]
ReadPrec DomainValidation
Int -> ReadS DomainValidation
ReadS [DomainValidation]
(Int -> ReadS DomainValidation)
-> ReadS [DomainValidation]
-> ReadPrec DomainValidation
-> ReadPrec [DomainValidation]
-> Read DomainValidation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainValidation]
$creadListPrec :: ReadPrec [DomainValidation]
readPrec :: ReadPrec DomainValidation
$creadPrec :: ReadPrec DomainValidation
readList :: ReadS [DomainValidation]
$creadList :: ReadS [DomainValidation]
readsPrec :: Int -> ReadS DomainValidation
$creadsPrec :: Int -> ReadS DomainValidation
Prelude.Read, Int -> DomainValidation -> ShowS
[DomainValidation] -> ShowS
DomainValidation -> String
(Int -> DomainValidation -> ShowS)
-> (DomainValidation -> String)
-> ([DomainValidation] -> ShowS)
-> Show DomainValidation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainValidation] -> ShowS
$cshowList :: [DomainValidation] -> ShowS
show :: DomainValidation -> String
$cshow :: DomainValidation -> String
showsPrec :: Int -> DomainValidation -> ShowS
$cshowsPrec :: Int -> DomainValidation -> ShowS
Prelude.Show, (forall x. DomainValidation -> Rep DomainValidation x)
-> (forall x. Rep DomainValidation x -> DomainValidation)
-> Generic DomainValidation
forall x. Rep DomainValidation x -> DomainValidation
forall x. DomainValidation -> Rep DomainValidation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DomainValidation x -> DomainValidation
$cfrom :: forall x. DomainValidation -> Rep DomainValidation x
Prelude.Generic)
newDomainValidation ::
Prelude.Text ->
DomainValidation
newDomainValidation :: Text -> DomainValidation
newDomainValidation Text
pDomainName_ =
DomainValidation' :: Maybe [Text]
-> Maybe ValidationMethod
-> Maybe ResourceRecord
-> Maybe DomainStatus
-> Maybe Text
-> Text
-> DomainValidation
DomainValidation'
{ $sel:validationEmails:DomainValidation' :: Maybe [Text]
validationEmails =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:validationMethod:DomainValidation' :: Maybe ValidationMethod
validationMethod = Maybe ValidationMethod
forall a. Maybe a
Prelude.Nothing,
$sel:resourceRecord:DomainValidation' :: Maybe ResourceRecord
resourceRecord = Maybe ResourceRecord
forall a. Maybe a
Prelude.Nothing,
$sel:validationStatus:DomainValidation' :: Maybe DomainStatus
validationStatus = Maybe DomainStatus
forall a. Maybe a
Prelude.Nothing,
$sel:validationDomain:DomainValidation' :: Maybe Text
validationDomain = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:domainName:DomainValidation' :: Text
domainName = Text
pDomainName_
}
domainValidation_validationEmails :: Lens.Lens' DomainValidation (Prelude.Maybe [Prelude.Text])
domainValidation_validationEmails :: (Maybe [Text] -> f (Maybe [Text]))
-> DomainValidation -> f DomainValidation
domainValidation_validationEmails = (DomainValidation -> Maybe [Text])
-> (DomainValidation -> Maybe [Text] -> DomainValidation)
-> Lens
DomainValidation DomainValidation (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainValidation' {Maybe [Text]
validationEmails :: Maybe [Text]
$sel:validationEmails:DomainValidation' :: DomainValidation -> Maybe [Text]
validationEmails} -> Maybe [Text]
validationEmails) (\s :: DomainValidation
s@DomainValidation' {} Maybe [Text]
a -> DomainValidation
s {$sel:validationEmails:DomainValidation' :: Maybe [Text]
validationEmails = Maybe [Text]
a} :: DomainValidation) ((Maybe [Text] -> f (Maybe [Text]))
-> DomainValidation -> f DomainValidation)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DomainValidation
-> f DomainValidation
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
domainValidation_validationMethod :: Lens.Lens' DomainValidation (Prelude.Maybe ValidationMethod)
domainValidation_validationMethod :: (Maybe ValidationMethod -> f (Maybe ValidationMethod))
-> DomainValidation -> f DomainValidation
domainValidation_validationMethod = (DomainValidation -> Maybe ValidationMethod)
-> (DomainValidation -> Maybe ValidationMethod -> DomainValidation)
-> Lens
DomainValidation
DomainValidation
(Maybe ValidationMethod)
(Maybe ValidationMethod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainValidation' {Maybe ValidationMethod
validationMethod :: Maybe ValidationMethod
$sel:validationMethod:DomainValidation' :: DomainValidation -> Maybe ValidationMethod
validationMethod} -> Maybe ValidationMethod
validationMethod) (\s :: DomainValidation
s@DomainValidation' {} Maybe ValidationMethod
a -> DomainValidation
s {$sel:validationMethod:DomainValidation' :: Maybe ValidationMethod
validationMethod = Maybe ValidationMethod
a} :: DomainValidation)
domainValidation_resourceRecord :: Lens.Lens' DomainValidation (Prelude.Maybe ResourceRecord)
domainValidation_resourceRecord :: (Maybe ResourceRecord -> f (Maybe ResourceRecord))
-> DomainValidation -> f DomainValidation
domainValidation_resourceRecord = (DomainValidation -> Maybe ResourceRecord)
-> (DomainValidation -> Maybe ResourceRecord -> DomainValidation)
-> Lens
DomainValidation
DomainValidation
(Maybe ResourceRecord)
(Maybe ResourceRecord)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainValidation' {Maybe ResourceRecord
resourceRecord :: Maybe ResourceRecord
$sel:resourceRecord:DomainValidation' :: DomainValidation -> Maybe ResourceRecord
resourceRecord} -> Maybe ResourceRecord
resourceRecord) (\s :: DomainValidation
s@DomainValidation' {} Maybe ResourceRecord
a -> DomainValidation
s {$sel:resourceRecord:DomainValidation' :: Maybe ResourceRecord
resourceRecord = Maybe ResourceRecord
a} :: DomainValidation)
domainValidation_validationStatus :: Lens.Lens' DomainValidation (Prelude.Maybe DomainStatus)
domainValidation_validationStatus :: (Maybe DomainStatus -> f (Maybe DomainStatus))
-> DomainValidation -> f DomainValidation
domainValidation_validationStatus = (DomainValidation -> Maybe DomainStatus)
-> (DomainValidation -> Maybe DomainStatus -> DomainValidation)
-> Lens
DomainValidation
DomainValidation
(Maybe DomainStatus)
(Maybe DomainStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainValidation' {Maybe DomainStatus
validationStatus :: Maybe DomainStatus
$sel:validationStatus:DomainValidation' :: DomainValidation -> Maybe DomainStatus
validationStatus} -> Maybe DomainStatus
validationStatus) (\s :: DomainValidation
s@DomainValidation' {} Maybe DomainStatus
a -> DomainValidation
s {$sel:validationStatus:DomainValidation' :: Maybe DomainStatus
validationStatus = Maybe DomainStatus
a} :: DomainValidation)
domainValidation_validationDomain :: Lens.Lens' DomainValidation (Prelude.Maybe Prelude.Text)
domainValidation_validationDomain :: (Maybe Text -> f (Maybe Text))
-> DomainValidation -> f DomainValidation
domainValidation_validationDomain = (DomainValidation -> Maybe Text)
-> (DomainValidation -> Maybe Text -> DomainValidation)
-> Lens DomainValidation DomainValidation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainValidation' {Maybe Text
validationDomain :: Maybe Text
$sel:validationDomain:DomainValidation' :: DomainValidation -> Maybe Text
validationDomain} -> Maybe Text
validationDomain) (\s :: DomainValidation
s@DomainValidation' {} Maybe Text
a -> DomainValidation
s {$sel:validationDomain:DomainValidation' :: Maybe Text
validationDomain = Maybe Text
a} :: DomainValidation)
domainValidation_domainName :: Lens.Lens' DomainValidation Prelude.Text
domainValidation_domainName :: (Text -> f Text) -> DomainValidation -> f DomainValidation
domainValidation_domainName = (DomainValidation -> Text)
-> (DomainValidation -> Text -> DomainValidation)
-> Lens DomainValidation DomainValidation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainValidation' {Text
domainName :: Text
$sel:domainName:DomainValidation' :: DomainValidation -> Text
domainName} -> Text
domainName) (\s :: DomainValidation
s@DomainValidation' {} Text
a -> DomainValidation
s {$sel:domainName:DomainValidation' :: Text
domainName = Text
a} :: DomainValidation)
instance Core.FromJSON DomainValidation where
parseJSON :: Value -> Parser DomainValidation
parseJSON =
String
-> (Object -> Parser DomainValidation)
-> Value
-> Parser DomainValidation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DomainValidation"
( \Object
x ->
Maybe [Text]
-> Maybe ValidationMethod
-> Maybe ResourceRecord
-> Maybe DomainStatus
-> Maybe Text
-> Text
-> DomainValidation
DomainValidation'
(Maybe [Text]
-> Maybe ValidationMethod
-> Maybe ResourceRecord
-> Maybe DomainStatus
-> Maybe Text
-> Text
-> DomainValidation)
-> Parser (Maybe [Text])
-> Parser
(Maybe ValidationMethod
-> Maybe ResourceRecord
-> Maybe DomainStatus
-> Maybe Text
-> Text
-> DomainValidation)
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 ValidationMethod
-> Maybe ResourceRecord
-> Maybe DomainStatus
-> Maybe Text
-> Text
-> DomainValidation)
-> Parser (Maybe ValidationMethod)
-> Parser
(Maybe ResourceRecord
-> Maybe DomainStatus -> Maybe Text -> Text -> DomainValidation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ValidationMethod)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ValidationMethod")
Parser
(Maybe ResourceRecord
-> Maybe DomainStatus -> Maybe Text -> Text -> DomainValidation)
-> Parser (Maybe ResourceRecord)
-> Parser
(Maybe DomainStatus -> Maybe Text -> Text -> DomainValidation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceRecord)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceRecord")
Parser
(Maybe DomainStatus -> Maybe Text -> Text -> DomainValidation)
-> Parser (Maybe DomainStatus)
-> Parser (Maybe Text -> Text -> DomainValidation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DomainStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ValidationStatus")
Parser (Maybe Text -> Text -> DomainValidation)
-> Parser (Maybe Text) -> Parser (Text -> DomainValidation)
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")
Parser (Text -> DomainValidation)
-> Parser Text -> Parser DomainValidation
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DomainName")
)
instance Prelude.Hashable DomainValidation
instance Prelude.NFData DomainValidation