{-# 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.Amplify.Types.DomainAssociation where
import Amazonka.Amplify.Types.DomainStatus
import Amazonka.Amplify.Types.SubDomain
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DomainAssociation = DomainAssociation'
{
DomainAssociation -> Maybe Text
certificateVerificationDNSRecord :: Prelude.Maybe Prelude.Text,
DomainAssociation -> Maybe [Text]
autoSubDomainCreationPatterns :: Prelude.Maybe [Prelude.Text],
DomainAssociation -> Maybe Text
autoSubDomainIAMRole :: Prelude.Maybe Prelude.Text,
DomainAssociation -> Text
domainAssociationArn :: Prelude.Text,
DomainAssociation -> Text
domainName :: Prelude.Text,
DomainAssociation -> Bool
enableAutoSubDomain :: Prelude.Bool,
DomainAssociation -> DomainStatus
domainStatus :: DomainStatus,
DomainAssociation -> Text
statusReason :: Prelude.Text,
DomainAssociation -> [SubDomain]
subDomains :: [SubDomain]
}
deriving (DomainAssociation -> DomainAssociation -> Bool
(DomainAssociation -> DomainAssociation -> Bool)
-> (DomainAssociation -> DomainAssociation -> Bool)
-> Eq DomainAssociation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainAssociation -> DomainAssociation -> Bool
$c/= :: DomainAssociation -> DomainAssociation -> Bool
== :: DomainAssociation -> DomainAssociation -> Bool
$c== :: DomainAssociation -> DomainAssociation -> Bool
Prelude.Eq, ReadPrec [DomainAssociation]
ReadPrec DomainAssociation
Int -> ReadS DomainAssociation
ReadS [DomainAssociation]
(Int -> ReadS DomainAssociation)
-> ReadS [DomainAssociation]
-> ReadPrec DomainAssociation
-> ReadPrec [DomainAssociation]
-> Read DomainAssociation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainAssociation]
$creadListPrec :: ReadPrec [DomainAssociation]
readPrec :: ReadPrec DomainAssociation
$creadPrec :: ReadPrec DomainAssociation
readList :: ReadS [DomainAssociation]
$creadList :: ReadS [DomainAssociation]
readsPrec :: Int -> ReadS DomainAssociation
$creadsPrec :: Int -> ReadS DomainAssociation
Prelude.Read, Int -> DomainAssociation -> ShowS
[DomainAssociation] -> ShowS
DomainAssociation -> String
(Int -> DomainAssociation -> ShowS)
-> (DomainAssociation -> String)
-> ([DomainAssociation] -> ShowS)
-> Show DomainAssociation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainAssociation] -> ShowS
$cshowList :: [DomainAssociation] -> ShowS
show :: DomainAssociation -> String
$cshow :: DomainAssociation -> String
showsPrec :: Int -> DomainAssociation -> ShowS
$cshowsPrec :: Int -> DomainAssociation -> ShowS
Prelude.Show, (forall x. DomainAssociation -> Rep DomainAssociation x)
-> (forall x. Rep DomainAssociation x -> DomainAssociation)
-> Generic DomainAssociation
forall x. Rep DomainAssociation x -> DomainAssociation
forall x. DomainAssociation -> Rep DomainAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DomainAssociation x -> DomainAssociation
$cfrom :: forall x. DomainAssociation -> Rep DomainAssociation x
Prelude.Generic)
newDomainAssociation ::
Prelude.Text ->
Prelude.Text ->
Prelude.Bool ->
DomainStatus ->
Prelude.Text ->
DomainAssociation
newDomainAssociation :: Text -> Text -> Bool -> DomainStatus -> Text -> DomainAssociation
newDomainAssociation
Text
pDomainAssociationArn_
Text
pDomainName_
Bool
pEnableAutoSubDomain_
DomainStatus
pDomainStatus_
Text
pStatusReason_ =
DomainAssociation' :: Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Text
-> Text
-> Bool
-> DomainStatus
-> Text
-> [SubDomain]
-> DomainAssociation
DomainAssociation'
{ $sel:certificateVerificationDNSRecord:DomainAssociation' :: Maybe Text
certificateVerificationDNSRecord =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:autoSubDomainCreationPatterns:DomainAssociation' :: Maybe [Text]
autoSubDomainCreationPatterns = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:autoSubDomainIAMRole:DomainAssociation' :: Maybe Text
autoSubDomainIAMRole = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:domainAssociationArn:DomainAssociation' :: Text
domainAssociationArn = Text
pDomainAssociationArn_,
$sel:domainName:DomainAssociation' :: Text
domainName = Text
pDomainName_,
$sel:enableAutoSubDomain:DomainAssociation' :: Bool
enableAutoSubDomain = Bool
pEnableAutoSubDomain_,
$sel:domainStatus:DomainAssociation' :: DomainStatus
domainStatus = DomainStatus
pDomainStatus_,
$sel:statusReason:DomainAssociation' :: Text
statusReason = Text
pStatusReason_,
$sel:subDomains:DomainAssociation' :: [SubDomain]
subDomains = [SubDomain]
forall a. Monoid a => a
Prelude.mempty
}
domainAssociation_certificateVerificationDNSRecord :: Lens.Lens' DomainAssociation (Prelude.Maybe Prelude.Text)
domainAssociation_certificateVerificationDNSRecord :: (Maybe Text -> f (Maybe Text))
-> DomainAssociation -> f DomainAssociation
domainAssociation_certificateVerificationDNSRecord = (DomainAssociation -> Maybe Text)
-> (DomainAssociation -> Maybe Text -> DomainAssociation)
-> Lens
DomainAssociation DomainAssociation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainAssociation' {Maybe Text
certificateVerificationDNSRecord :: Maybe Text
$sel:certificateVerificationDNSRecord:DomainAssociation' :: DomainAssociation -> Maybe Text
certificateVerificationDNSRecord} -> Maybe Text
certificateVerificationDNSRecord) (\s :: DomainAssociation
s@DomainAssociation' {} Maybe Text
a -> DomainAssociation
s {$sel:certificateVerificationDNSRecord:DomainAssociation' :: Maybe Text
certificateVerificationDNSRecord = Maybe Text
a} :: DomainAssociation)
domainAssociation_autoSubDomainCreationPatterns :: Lens.Lens' DomainAssociation (Prelude.Maybe [Prelude.Text])
domainAssociation_autoSubDomainCreationPatterns :: (Maybe [Text] -> f (Maybe [Text]))
-> DomainAssociation -> f DomainAssociation
domainAssociation_autoSubDomainCreationPatterns = (DomainAssociation -> Maybe [Text])
-> (DomainAssociation -> Maybe [Text] -> DomainAssociation)
-> Lens
DomainAssociation DomainAssociation (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainAssociation' {Maybe [Text]
autoSubDomainCreationPatterns :: Maybe [Text]
$sel:autoSubDomainCreationPatterns:DomainAssociation' :: DomainAssociation -> Maybe [Text]
autoSubDomainCreationPatterns} -> Maybe [Text]
autoSubDomainCreationPatterns) (\s :: DomainAssociation
s@DomainAssociation' {} Maybe [Text]
a -> DomainAssociation
s {$sel:autoSubDomainCreationPatterns:DomainAssociation' :: Maybe [Text]
autoSubDomainCreationPatterns = Maybe [Text]
a} :: DomainAssociation) ((Maybe [Text] -> f (Maybe [Text]))
-> DomainAssociation -> f DomainAssociation)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DomainAssociation
-> f DomainAssociation
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
domainAssociation_autoSubDomainIAMRole :: Lens.Lens' DomainAssociation (Prelude.Maybe Prelude.Text)
domainAssociation_autoSubDomainIAMRole :: (Maybe Text -> f (Maybe Text))
-> DomainAssociation -> f DomainAssociation
domainAssociation_autoSubDomainIAMRole = (DomainAssociation -> Maybe Text)
-> (DomainAssociation -> Maybe Text -> DomainAssociation)
-> Lens
DomainAssociation DomainAssociation (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainAssociation' {Maybe Text
autoSubDomainIAMRole :: Maybe Text
$sel:autoSubDomainIAMRole:DomainAssociation' :: DomainAssociation -> Maybe Text
autoSubDomainIAMRole} -> Maybe Text
autoSubDomainIAMRole) (\s :: DomainAssociation
s@DomainAssociation' {} Maybe Text
a -> DomainAssociation
s {$sel:autoSubDomainIAMRole:DomainAssociation' :: Maybe Text
autoSubDomainIAMRole = Maybe Text
a} :: DomainAssociation)
domainAssociation_domainAssociationArn :: Lens.Lens' DomainAssociation Prelude.Text
domainAssociation_domainAssociationArn :: (Text -> f Text) -> DomainAssociation -> f DomainAssociation
domainAssociation_domainAssociationArn = (DomainAssociation -> Text)
-> (DomainAssociation -> Text -> DomainAssociation)
-> Lens DomainAssociation DomainAssociation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainAssociation' {Text
domainAssociationArn :: Text
$sel:domainAssociationArn:DomainAssociation' :: DomainAssociation -> Text
domainAssociationArn} -> Text
domainAssociationArn) (\s :: DomainAssociation
s@DomainAssociation' {} Text
a -> DomainAssociation
s {$sel:domainAssociationArn:DomainAssociation' :: Text
domainAssociationArn = Text
a} :: DomainAssociation)
domainAssociation_domainName :: Lens.Lens' DomainAssociation Prelude.Text
domainAssociation_domainName :: (Text -> f Text) -> DomainAssociation -> f DomainAssociation
domainAssociation_domainName = (DomainAssociation -> Text)
-> (DomainAssociation -> Text -> DomainAssociation)
-> Lens DomainAssociation DomainAssociation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainAssociation' {Text
domainName :: Text
$sel:domainName:DomainAssociation' :: DomainAssociation -> Text
domainName} -> Text
domainName) (\s :: DomainAssociation
s@DomainAssociation' {} Text
a -> DomainAssociation
s {$sel:domainName:DomainAssociation' :: Text
domainName = Text
a} :: DomainAssociation)
domainAssociation_enableAutoSubDomain :: Lens.Lens' DomainAssociation Prelude.Bool
domainAssociation_enableAutoSubDomain :: (Bool -> f Bool) -> DomainAssociation -> f DomainAssociation
domainAssociation_enableAutoSubDomain = (DomainAssociation -> Bool)
-> (DomainAssociation -> Bool -> DomainAssociation)
-> Lens DomainAssociation DomainAssociation Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainAssociation' {Bool
enableAutoSubDomain :: Bool
$sel:enableAutoSubDomain:DomainAssociation' :: DomainAssociation -> Bool
enableAutoSubDomain} -> Bool
enableAutoSubDomain) (\s :: DomainAssociation
s@DomainAssociation' {} Bool
a -> DomainAssociation
s {$sel:enableAutoSubDomain:DomainAssociation' :: Bool
enableAutoSubDomain = Bool
a} :: DomainAssociation)
domainAssociation_domainStatus :: Lens.Lens' DomainAssociation DomainStatus
domainAssociation_domainStatus :: (DomainStatus -> f DomainStatus)
-> DomainAssociation -> f DomainAssociation
domainAssociation_domainStatus = (DomainAssociation -> DomainStatus)
-> (DomainAssociation -> DomainStatus -> DomainAssociation)
-> Lens
DomainAssociation DomainAssociation DomainStatus DomainStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainAssociation' {DomainStatus
domainStatus :: DomainStatus
$sel:domainStatus:DomainAssociation' :: DomainAssociation -> DomainStatus
domainStatus} -> DomainStatus
domainStatus) (\s :: DomainAssociation
s@DomainAssociation' {} DomainStatus
a -> DomainAssociation
s {$sel:domainStatus:DomainAssociation' :: DomainStatus
domainStatus = DomainStatus
a} :: DomainAssociation)
domainAssociation_statusReason :: Lens.Lens' DomainAssociation Prelude.Text
domainAssociation_statusReason :: (Text -> f Text) -> DomainAssociation -> f DomainAssociation
domainAssociation_statusReason = (DomainAssociation -> Text)
-> (DomainAssociation -> Text -> DomainAssociation)
-> Lens DomainAssociation DomainAssociation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainAssociation' {Text
statusReason :: Text
$sel:statusReason:DomainAssociation' :: DomainAssociation -> Text
statusReason} -> Text
statusReason) (\s :: DomainAssociation
s@DomainAssociation' {} Text
a -> DomainAssociation
s {$sel:statusReason:DomainAssociation' :: Text
statusReason = Text
a} :: DomainAssociation)
domainAssociation_subDomains :: Lens.Lens' DomainAssociation [SubDomain]
domainAssociation_subDomains :: ([SubDomain] -> f [SubDomain])
-> DomainAssociation -> f DomainAssociation
domainAssociation_subDomains = (DomainAssociation -> [SubDomain])
-> (DomainAssociation -> [SubDomain] -> DomainAssociation)
-> Lens DomainAssociation DomainAssociation [SubDomain] [SubDomain]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainAssociation' {[SubDomain]
subDomains :: [SubDomain]
$sel:subDomains:DomainAssociation' :: DomainAssociation -> [SubDomain]
subDomains} -> [SubDomain]
subDomains) (\s :: DomainAssociation
s@DomainAssociation' {} [SubDomain]
a -> DomainAssociation
s {$sel:subDomains:DomainAssociation' :: [SubDomain]
subDomains = [SubDomain]
a} :: DomainAssociation) (([SubDomain] -> f [SubDomain])
-> DomainAssociation -> f DomainAssociation)
-> (([SubDomain] -> f [SubDomain]) -> [SubDomain] -> f [SubDomain])
-> ([SubDomain] -> f [SubDomain])
-> DomainAssociation
-> f DomainAssociation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SubDomain] -> f [SubDomain]) -> [SubDomain] -> f [SubDomain]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON DomainAssociation where
parseJSON :: Value -> Parser DomainAssociation
parseJSON =
String
-> (Object -> Parser DomainAssociation)
-> Value
-> Parser DomainAssociation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DomainAssociation"
( \Object
x ->
Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Text
-> Text
-> Bool
-> DomainStatus
-> Text
-> [SubDomain]
-> DomainAssociation
DomainAssociation'
(Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Text
-> Text
-> Bool
-> DomainStatus
-> Text
-> [SubDomain]
-> DomainAssociation)
-> Parser (Maybe Text)
-> Parser
(Maybe [Text]
-> Maybe Text
-> Text
-> Text
-> Bool
-> DomainStatus
-> Text
-> [SubDomain]
-> DomainAssociation)
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
"certificateVerificationDNSRecord")
Parser
(Maybe [Text]
-> Maybe Text
-> Text
-> Text
-> Bool
-> DomainStatus
-> Text
-> [SubDomain]
-> DomainAssociation)
-> Parser (Maybe [Text])
-> Parser
(Maybe Text
-> Text
-> Text
-> Bool
-> DomainStatus
-> Text
-> [SubDomain]
-> DomainAssociation)
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
"autoSubDomainCreationPatterns"
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
-> Text
-> Text
-> Bool
-> DomainStatus
-> Text
-> [SubDomain]
-> DomainAssociation)
-> Parser (Maybe Text)
-> Parser
(Text
-> Text
-> Bool
-> DomainStatus
-> Text
-> [SubDomain]
-> DomainAssociation)
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
"autoSubDomainIAMRole")
Parser
(Text
-> Text
-> Bool
-> DomainStatus
-> Text
-> [SubDomain]
-> DomainAssociation)
-> Parser Text
-> Parser
(Text
-> Bool
-> DomainStatus
-> Text
-> [SubDomain]
-> DomainAssociation)
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
"domainAssociationArn")
Parser
(Text
-> Bool
-> DomainStatus
-> Text
-> [SubDomain]
-> DomainAssociation)
-> Parser Text
-> Parser
(Bool -> DomainStatus -> Text -> [SubDomain] -> DomainAssociation)
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")
Parser
(Bool -> DomainStatus -> Text -> [SubDomain] -> DomainAssociation)
-> Parser Bool
-> Parser
(DomainStatus -> Text -> [SubDomain] -> DomainAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"enableAutoSubDomain")
Parser (DomainStatus -> Text -> [SubDomain] -> DomainAssociation)
-> Parser DomainStatus
-> Parser (Text -> [SubDomain] -> DomainAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DomainStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"domainStatus")
Parser (Text -> [SubDomain] -> DomainAssociation)
-> Parser Text -> Parser ([SubDomain] -> DomainAssociation)
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
"statusReason")
Parser ([SubDomain] -> DomainAssociation)
-> Parser [SubDomain] -> Parser DomainAssociation
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [SubDomain])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"subDomains" Parser (Maybe [SubDomain]) -> [SubDomain] -> Parser [SubDomain]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [SubDomain]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable DomainAssociation
instance Prelude.NFData DomainAssociation