{-# 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.Lightsail.Types.Domain where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lightsail.Types.DomainEntry
import Amazonka.Lightsail.Types.RegisteredDomainDelegationInfo
import Amazonka.Lightsail.Types.ResourceLocation
import Amazonka.Lightsail.Types.ResourceType
import Amazonka.Lightsail.Types.Tag
import qualified Amazonka.Prelude as Prelude
data Domain = Domain'
{
Domain -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Domain -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
Domain -> Maybe [DomainEntry]
domainEntries :: Prelude.Maybe [DomainEntry],
Domain -> Maybe ResourceLocation
location :: Prelude.Maybe ResourceLocation,
Domain -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Domain -> Maybe RegisteredDomainDelegationInfo
registeredDomainDelegationInfo :: Prelude.Maybe RegisteredDomainDelegationInfo,
Domain -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
Domain -> Maybe Text
supportCode :: Prelude.Maybe Prelude.Text,
Domain -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
}
deriving (Domain -> Domain -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Domain -> Domain -> Bool
$c/= :: Domain -> Domain -> Bool
== :: Domain -> Domain -> Bool
$c== :: Domain -> Domain -> Bool
Prelude.Eq, ReadPrec [Domain]
ReadPrec Domain
Int -> ReadS Domain
ReadS [Domain]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Domain]
$creadListPrec :: ReadPrec [Domain]
readPrec :: ReadPrec Domain
$creadPrec :: ReadPrec Domain
readList :: ReadS [Domain]
$creadList :: ReadS [Domain]
readsPrec :: Int -> ReadS Domain
$creadsPrec :: Int -> ReadS Domain
Prelude.Read, Int -> Domain -> ShowS
[Domain] -> ShowS
Domain -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Domain] -> ShowS
$cshowList :: [Domain] -> ShowS
show :: Domain -> String
$cshow :: Domain -> String
showsPrec :: Int -> Domain -> ShowS
$cshowsPrec :: Int -> Domain -> ShowS
Prelude.Show, forall x. Rep Domain x -> Domain
forall x. Domain -> Rep Domain x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Domain x -> Domain
$cfrom :: forall x. Domain -> Rep Domain x
Prelude.Generic)
newDomain ::
Domain
newDomain :: Domain
newDomain =
Domain'
{ $sel:arn:Domain' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:Domain' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
$sel:domainEntries:Domain' :: Maybe [DomainEntry]
domainEntries = forall a. Maybe a
Prelude.Nothing,
$sel:location:Domain' :: Maybe ResourceLocation
location = forall a. Maybe a
Prelude.Nothing,
$sel:name:Domain' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:registeredDomainDelegationInfo:Domain' :: Maybe RegisteredDomainDelegationInfo
registeredDomainDelegationInfo = forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:Domain' :: Maybe ResourceType
resourceType = forall a. Maybe a
Prelude.Nothing,
$sel:supportCode:Domain' :: Maybe Text
supportCode = forall a. Maybe a
Prelude.Nothing,
$sel:tags:Domain' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing
}
domain_arn :: Lens.Lens' Domain (Prelude.Maybe Prelude.Text)
domain_arn :: Lens' Domain (Maybe Text)
domain_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Domain' {Maybe Text
arn :: Maybe Text
$sel:arn:Domain' :: Domain -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Domain
s@Domain' {} Maybe Text
a -> Domain
s {$sel:arn:Domain' :: Maybe Text
arn = Maybe Text
a} :: Domain)
domain_createdAt :: Lens.Lens' Domain (Prelude.Maybe Prelude.UTCTime)
domain_createdAt :: Lens' Domain (Maybe UTCTime)
domain_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Domain' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Domain' :: Domain -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Domain
s@Domain' {} Maybe POSIX
a -> Domain
s {$sel:createdAt:Domain' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: Domain) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
domain_domainEntries :: Lens.Lens' Domain (Prelude.Maybe [DomainEntry])
domain_domainEntries :: Lens' Domain (Maybe [DomainEntry])
domain_domainEntries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Domain' {Maybe [DomainEntry]
domainEntries :: Maybe [DomainEntry]
$sel:domainEntries:Domain' :: Domain -> Maybe [DomainEntry]
domainEntries} -> Maybe [DomainEntry]
domainEntries) (\s :: Domain
s@Domain' {} Maybe [DomainEntry]
a -> Domain
s {$sel:domainEntries:Domain' :: Maybe [DomainEntry]
domainEntries = Maybe [DomainEntry]
a} :: Domain) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
domain_location :: Lens.Lens' Domain (Prelude.Maybe ResourceLocation)
domain_location :: Lens' Domain (Maybe ResourceLocation)
domain_location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Domain' {Maybe ResourceLocation
location :: Maybe ResourceLocation
$sel:location:Domain' :: Domain -> Maybe ResourceLocation
location} -> Maybe ResourceLocation
location) (\s :: Domain
s@Domain' {} Maybe ResourceLocation
a -> Domain
s {$sel:location:Domain' :: Maybe ResourceLocation
location = Maybe ResourceLocation
a} :: Domain)
domain_name :: Lens.Lens' Domain (Prelude.Maybe Prelude.Text)
domain_name :: Lens' Domain (Maybe Text)
domain_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Domain' {Maybe Text
name :: Maybe Text
$sel:name:Domain' :: Domain -> Maybe Text
name} -> Maybe Text
name) (\s :: Domain
s@Domain' {} Maybe Text
a -> Domain
s {$sel:name:Domain' :: Maybe Text
name = Maybe Text
a} :: Domain)
domain_registeredDomainDelegationInfo :: Lens.Lens' Domain (Prelude.Maybe RegisteredDomainDelegationInfo)
domain_registeredDomainDelegationInfo :: Lens' Domain (Maybe RegisteredDomainDelegationInfo)
domain_registeredDomainDelegationInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Domain' {Maybe RegisteredDomainDelegationInfo
registeredDomainDelegationInfo :: Maybe RegisteredDomainDelegationInfo
$sel:registeredDomainDelegationInfo:Domain' :: Domain -> Maybe RegisteredDomainDelegationInfo
registeredDomainDelegationInfo} -> Maybe RegisteredDomainDelegationInfo
registeredDomainDelegationInfo) (\s :: Domain
s@Domain' {} Maybe RegisteredDomainDelegationInfo
a -> Domain
s {$sel:registeredDomainDelegationInfo:Domain' :: Maybe RegisteredDomainDelegationInfo
registeredDomainDelegationInfo = Maybe RegisteredDomainDelegationInfo
a} :: Domain)
domain_resourceType :: Lens.Lens' Domain (Prelude.Maybe ResourceType)
domain_resourceType :: Lens' Domain (Maybe ResourceType)
domain_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Domain' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:Domain' :: Domain -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: Domain
s@Domain' {} Maybe ResourceType
a -> Domain
s {$sel:resourceType:Domain' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: Domain)
domain_supportCode :: Lens.Lens' Domain (Prelude.Maybe Prelude.Text)
domain_supportCode :: Lens' Domain (Maybe Text)
domain_supportCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Domain' {Maybe Text
supportCode :: Maybe Text
$sel:supportCode:Domain' :: Domain -> Maybe Text
supportCode} -> Maybe Text
supportCode) (\s :: Domain
s@Domain' {} Maybe Text
a -> Domain
s {$sel:supportCode:Domain' :: Maybe Text
supportCode = Maybe Text
a} :: Domain)
domain_tags :: Lens.Lens' Domain (Prelude.Maybe [Tag])
domain_tags :: Lens' Domain (Maybe [Tag])
domain_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Domain' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:Domain' :: Domain -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: Domain
s@Domain' {} Maybe [Tag]
a -> Domain
s {$sel:tags:Domain' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: Domain) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON Domain where
parseJSON :: Value -> Parser Domain
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Domain"
( \Object
x ->
Maybe Text
-> Maybe POSIX
-> Maybe [DomainEntry]
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe RegisteredDomainDelegationInfo
-> Maybe ResourceType
-> Maybe Text
-> Maybe [Tag]
-> Domain
Domain'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"createdAt")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"domainEntries" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"location")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"registeredDomainDelegationInfo")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"resourceType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"supportCode")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable Domain where
hashWithSalt :: Int -> Domain -> Int
hashWithSalt Int
_salt Domain' {Maybe [DomainEntry]
Maybe [Tag]
Maybe Text
Maybe POSIX
Maybe RegisteredDomainDelegationInfo
Maybe ResourceLocation
Maybe ResourceType
tags :: Maybe [Tag]
supportCode :: Maybe Text
resourceType :: Maybe ResourceType
registeredDomainDelegationInfo :: Maybe RegisteredDomainDelegationInfo
name :: Maybe Text
location :: Maybe ResourceLocation
domainEntries :: Maybe [DomainEntry]
createdAt :: Maybe POSIX
arn :: Maybe Text
$sel:tags:Domain' :: Domain -> Maybe [Tag]
$sel:supportCode:Domain' :: Domain -> Maybe Text
$sel:resourceType:Domain' :: Domain -> Maybe ResourceType
$sel:registeredDomainDelegationInfo:Domain' :: Domain -> Maybe RegisteredDomainDelegationInfo
$sel:name:Domain' :: Domain -> Maybe Text
$sel:location:Domain' :: Domain -> Maybe ResourceLocation
$sel:domainEntries:Domain' :: Domain -> Maybe [DomainEntry]
$sel:createdAt:Domain' :: Domain -> Maybe POSIX
$sel:arn:Domain' :: Domain -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [DomainEntry]
domainEntries
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceLocation
location
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RegisteredDomainDelegationInfo
registeredDomainDelegationInfo
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceType
resourceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
supportCode
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
instance Prelude.NFData Domain where
rnf :: Domain -> ()
rnf Domain' {Maybe [DomainEntry]
Maybe [Tag]
Maybe Text
Maybe POSIX
Maybe RegisteredDomainDelegationInfo
Maybe ResourceLocation
Maybe ResourceType
tags :: Maybe [Tag]
supportCode :: Maybe Text
resourceType :: Maybe ResourceType
registeredDomainDelegationInfo :: Maybe RegisteredDomainDelegationInfo
name :: Maybe Text
location :: Maybe ResourceLocation
domainEntries :: Maybe [DomainEntry]
createdAt :: Maybe POSIX
arn :: Maybe Text
$sel:tags:Domain' :: Domain -> Maybe [Tag]
$sel:supportCode:Domain' :: Domain -> Maybe Text
$sel:resourceType:Domain' :: Domain -> Maybe ResourceType
$sel:registeredDomainDelegationInfo:Domain' :: Domain -> Maybe RegisteredDomainDelegationInfo
$sel:name:Domain' :: Domain -> Maybe Text
$sel:location:Domain' :: Domain -> Maybe ResourceLocation
$sel:domainEntries:Domain' :: Domain -> Maybe [DomainEntry]
$sel:createdAt:Domain' :: Domain -> Maybe POSIX
$sel:arn:Domain' :: Domain -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [DomainEntry]
domainEntries
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceLocation
location
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RegisteredDomainDelegationInfo
registeredDomainDelegationInfo
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceType
resourceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
supportCode
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags