{-# 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.Lens as Lens
import Amazonka.Lightsail.Types.DomainEntry
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 ResourceType
resourceType :: Prelude.Maybe ResourceType,
Domain -> Maybe [DomainEntry]
domainEntries :: Prelude.Maybe [DomainEntry],
Domain -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Domain -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
Domain -> Maybe ResourceLocation
location :: Prelude.Maybe ResourceLocation,
Domain -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Domain -> Maybe Text
supportCode :: Prelude.Maybe Prelude.Text,
Domain -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
}
deriving (Domain -> Domain -> Bool
(Domain -> Domain -> Bool)
-> (Domain -> Domain -> Bool) -> Eq Domain
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]
(Int -> ReadS Domain)
-> ReadS [Domain]
-> ReadPrec Domain
-> ReadPrec [Domain]
-> Read 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
(Int -> Domain -> ShowS)
-> (Domain -> String) -> ([Domain] -> ShowS) -> Show Domain
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. Domain -> Rep Domain x)
-> (forall x. Rep Domain x -> Domain) -> Generic Domain
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' :: Maybe ResourceType
-> Maybe [DomainEntry]
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Domain
Domain'
{ $sel:resourceType:Domain' :: Maybe ResourceType
resourceType = Maybe ResourceType
forall a. Maybe a
Prelude.Nothing,
$sel:domainEntries:Domain' :: Maybe [DomainEntry]
domainEntries = Maybe [DomainEntry]
forall a. Maybe a
Prelude.Nothing,
$sel:arn:Domain' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:Domain' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:location:Domain' :: Maybe ResourceLocation
location = Maybe ResourceLocation
forall a. Maybe a
Prelude.Nothing,
$sel:name:Domain' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:supportCode:Domain' :: Maybe Text
supportCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:Domain' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
}
domain_resourceType :: Lens.Lens' Domain (Prelude.Maybe ResourceType)
domain_resourceType :: (Maybe ResourceType -> f (Maybe ResourceType))
-> Domain -> f Domain
domain_resourceType = (Domain -> Maybe ResourceType)
-> (Domain -> Maybe ResourceType -> Domain)
-> Lens Domain Domain (Maybe ResourceType) (Maybe 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_domainEntries :: Lens.Lens' Domain (Prelude.Maybe [DomainEntry])
domain_domainEntries :: (Maybe [DomainEntry] -> f (Maybe [DomainEntry]))
-> Domain -> f Domain
domain_domainEntries = (Domain -> Maybe [DomainEntry])
-> (Domain -> Maybe [DomainEntry] -> Domain)
-> Lens Domain Domain (Maybe [DomainEntry]) (Maybe [DomainEntry])
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) ((Maybe [DomainEntry] -> f (Maybe [DomainEntry]))
-> Domain -> f Domain)
-> ((Maybe [DomainEntry] -> f (Maybe [DomainEntry]))
-> Maybe [DomainEntry] -> f (Maybe [DomainEntry]))
-> (Maybe [DomainEntry] -> f (Maybe [DomainEntry]))
-> Domain
-> f Domain
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [DomainEntry] [DomainEntry] [DomainEntry] [DomainEntry]
-> Iso
(Maybe [DomainEntry])
(Maybe [DomainEntry])
(Maybe [DomainEntry])
(Maybe [DomainEntry])
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 [DomainEntry] [DomainEntry] [DomainEntry] [DomainEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
domain_arn :: Lens.Lens' Domain (Prelude.Maybe Prelude.Text)
domain_arn :: (Maybe Text -> f (Maybe Text)) -> Domain -> f Domain
domain_arn = (Domain -> Maybe Text)
-> (Domain -> Maybe Text -> Domain)
-> Lens Domain Domain (Maybe Text) (Maybe Text)
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 :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Domain -> f Domain
domain_createdAt = (Domain -> Maybe POSIX)
-> (Domain -> Maybe POSIX -> Domain)
-> Lens Domain Domain (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX)) -> Domain -> f Domain)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Domain
-> f Domain
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
domain_location :: Lens.Lens' Domain (Prelude.Maybe ResourceLocation)
domain_location :: (Maybe ResourceLocation -> f (Maybe ResourceLocation))
-> Domain -> f Domain
domain_location = (Domain -> Maybe ResourceLocation)
-> (Domain -> Maybe ResourceLocation -> Domain)
-> Lens
Domain Domain (Maybe ResourceLocation) (Maybe ResourceLocation)
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 :: (Maybe Text -> f (Maybe Text)) -> Domain -> f Domain
domain_name = (Domain -> Maybe Text)
-> (Domain -> Maybe Text -> Domain)
-> Lens Domain Domain (Maybe Text) (Maybe Text)
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_supportCode :: Lens.Lens' Domain (Prelude.Maybe Prelude.Text)
domain_supportCode :: (Maybe Text -> f (Maybe Text)) -> Domain -> f Domain
domain_supportCode = (Domain -> Maybe Text)
-> (Domain -> Maybe Text -> Domain)
-> Lens Domain Domain (Maybe Text) (Maybe Text)
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 :: (Maybe [Tag] -> f (Maybe [Tag])) -> Domain -> f Domain
domain_tags = (Domain -> Maybe [Tag])
-> (Domain -> Maybe [Tag] -> Domain)
-> Lens Domain Domain (Maybe [Tag]) (Maybe [Tag])
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) ((Maybe [Tag] -> f (Maybe [Tag])) -> Domain -> f Domain)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> Domain
-> f Domain
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON Domain where
parseJSON :: Value -> Parser Domain
parseJSON =
String -> (Object -> Parser Domain) -> Value -> Parser Domain
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Domain"
( \Object
x ->
Maybe ResourceType
-> Maybe [DomainEntry]
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Domain
Domain'
(Maybe ResourceType
-> Maybe [DomainEntry]
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Domain)
-> Parser (Maybe ResourceType)
-> Parser
(Maybe [DomainEntry]
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Domain)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ResourceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceType")
Parser
(Maybe [DomainEntry]
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Domain)
-> Parser (Maybe [DomainEntry])
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Domain)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [DomainEntry]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"domainEntries" Parser (Maybe (Maybe [DomainEntry]))
-> Maybe [DomainEntry] -> Parser (Maybe [DomainEntry])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [DomainEntry]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Domain)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Domain)
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
"arn")
Parser
(Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Domain)
-> Parser (Maybe POSIX)
-> Parser
(Maybe ResourceLocation
-> Maybe Text -> Maybe Text -> Maybe [Tag] -> Domain)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
Parser
(Maybe ResourceLocation
-> Maybe Text -> Maybe Text -> Maybe [Tag] -> Domain)
-> Parser (Maybe ResourceLocation)
-> Parser (Maybe Text -> Maybe Text -> Maybe [Tag] -> Domain)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"location")
Parser (Maybe Text -> Maybe Text -> Maybe [Tag] -> Domain)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [Tag] -> Domain)
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
"name")
Parser (Maybe Text -> Maybe [Tag] -> Domain)
-> Parser (Maybe Text) -> Parser (Maybe [Tag] -> Domain)
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
"supportCode")
Parser (Maybe [Tag] -> Domain)
-> Parser (Maybe [Tag]) -> Parser Domain
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable Domain
instance Prelude.NFData Domain