{-# 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.DomainEntry where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DomainEntry = DomainEntry'
{
DomainEntry -> Maybe Bool
isAlias :: Prelude.Maybe Prelude.Bool,
DomainEntry -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
DomainEntry -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
DomainEntry -> Maybe (HashMap Text Text)
options :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
DomainEntry -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
DomainEntry -> Maybe Text
target :: Prelude.Maybe Prelude.Text
}
deriving (DomainEntry -> DomainEntry -> Bool
(DomainEntry -> DomainEntry -> Bool)
-> (DomainEntry -> DomainEntry -> Bool) -> Eq DomainEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainEntry -> DomainEntry -> Bool
$c/= :: DomainEntry -> DomainEntry -> Bool
== :: DomainEntry -> DomainEntry -> Bool
$c== :: DomainEntry -> DomainEntry -> Bool
Prelude.Eq, ReadPrec [DomainEntry]
ReadPrec DomainEntry
Int -> ReadS DomainEntry
ReadS [DomainEntry]
(Int -> ReadS DomainEntry)
-> ReadS [DomainEntry]
-> ReadPrec DomainEntry
-> ReadPrec [DomainEntry]
-> Read DomainEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainEntry]
$creadListPrec :: ReadPrec [DomainEntry]
readPrec :: ReadPrec DomainEntry
$creadPrec :: ReadPrec DomainEntry
readList :: ReadS [DomainEntry]
$creadList :: ReadS [DomainEntry]
readsPrec :: Int -> ReadS DomainEntry
$creadsPrec :: Int -> ReadS DomainEntry
Prelude.Read, Int -> DomainEntry -> ShowS
[DomainEntry] -> ShowS
DomainEntry -> String
(Int -> DomainEntry -> ShowS)
-> (DomainEntry -> String)
-> ([DomainEntry] -> ShowS)
-> Show DomainEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainEntry] -> ShowS
$cshowList :: [DomainEntry] -> ShowS
show :: DomainEntry -> String
$cshow :: DomainEntry -> String
showsPrec :: Int -> DomainEntry -> ShowS
$cshowsPrec :: Int -> DomainEntry -> ShowS
Prelude.Show, (forall x. DomainEntry -> Rep DomainEntry x)
-> (forall x. Rep DomainEntry x -> DomainEntry)
-> Generic DomainEntry
forall x. Rep DomainEntry x -> DomainEntry
forall x. DomainEntry -> Rep DomainEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DomainEntry x -> DomainEntry
$cfrom :: forall x. DomainEntry -> Rep DomainEntry x
Prelude.Generic)
newDomainEntry ::
DomainEntry
newDomainEntry :: DomainEntry
newDomainEntry =
DomainEntry' :: Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> DomainEntry
DomainEntry'
{ $sel:isAlias:DomainEntry' :: Maybe Bool
isAlias = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:name:DomainEntry' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:DomainEntry' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:options:DomainEntry' :: Maybe (HashMap Text Text)
options = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:type':DomainEntry' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:target:DomainEntry' :: Maybe Text
target = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
domainEntry_isAlias :: Lens.Lens' DomainEntry (Prelude.Maybe Prelude.Bool)
domainEntry_isAlias :: (Maybe Bool -> f (Maybe Bool)) -> DomainEntry -> f DomainEntry
domainEntry_isAlias = (DomainEntry -> Maybe Bool)
-> (DomainEntry -> Maybe Bool -> DomainEntry)
-> Lens DomainEntry DomainEntry (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainEntry' {Maybe Bool
isAlias :: Maybe Bool
$sel:isAlias:DomainEntry' :: DomainEntry -> Maybe Bool
isAlias} -> Maybe Bool
isAlias) (\s :: DomainEntry
s@DomainEntry' {} Maybe Bool
a -> DomainEntry
s {$sel:isAlias:DomainEntry' :: Maybe Bool
isAlias = Maybe Bool
a} :: DomainEntry)
domainEntry_name :: Lens.Lens' DomainEntry (Prelude.Maybe Prelude.Text)
domainEntry_name :: (Maybe Text -> f (Maybe Text)) -> DomainEntry -> f DomainEntry
domainEntry_name = (DomainEntry -> Maybe Text)
-> (DomainEntry -> Maybe Text -> DomainEntry)
-> Lens DomainEntry DomainEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainEntry' {Maybe Text
name :: Maybe Text
$sel:name:DomainEntry' :: DomainEntry -> Maybe Text
name} -> Maybe Text
name) (\s :: DomainEntry
s@DomainEntry' {} Maybe Text
a -> DomainEntry
s {$sel:name:DomainEntry' :: Maybe Text
name = Maybe Text
a} :: DomainEntry)
domainEntry_id :: Lens.Lens' DomainEntry (Prelude.Maybe Prelude.Text)
domainEntry_id :: (Maybe Text -> f (Maybe Text)) -> DomainEntry -> f DomainEntry
domainEntry_id = (DomainEntry -> Maybe Text)
-> (DomainEntry -> Maybe Text -> DomainEntry)
-> Lens DomainEntry DomainEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainEntry' {Maybe Text
id :: Maybe Text
$sel:id:DomainEntry' :: DomainEntry -> Maybe Text
id} -> Maybe Text
id) (\s :: DomainEntry
s@DomainEntry' {} Maybe Text
a -> DomainEntry
s {$sel:id:DomainEntry' :: Maybe Text
id = Maybe Text
a} :: DomainEntry)
domainEntry_options :: Lens.Lens' DomainEntry (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
domainEntry_options :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DomainEntry -> f DomainEntry
domainEntry_options = (DomainEntry -> Maybe (HashMap Text Text))
-> (DomainEntry -> Maybe (HashMap Text Text) -> DomainEntry)
-> Lens
DomainEntry
DomainEntry
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainEntry' {Maybe (HashMap Text Text)
options :: Maybe (HashMap Text Text)
$sel:options:DomainEntry' :: DomainEntry -> Maybe (HashMap Text Text)
options} -> Maybe (HashMap Text Text)
options) (\s :: DomainEntry
s@DomainEntry' {} Maybe (HashMap Text Text)
a -> DomainEntry
s {$sel:options:DomainEntry' :: Maybe (HashMap Text Text)
options = Maybe (HashMap Text Text)
a} :: DomainEntry) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DomainEntry -> f DomainEntry)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DomainEntry
-> f DomainEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text 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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
domainEntry_type :: Lens.Lens' DomainEntry (Prelude.Maybe Prelude.Text)
domainEntry_type :: (Maybe Text -> f (Maybe Text)) -> DomainEntry -> f DomainEntry
domainEntry_type = (DomainEntry -> Maybe Text)
-> (DomainEntry -> Maybe Text -> DomainEntry)
-> Lens DomainEntry DomainEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainEntry' {Maybe Text
type' :: Maybe Text
$sel:type':DomainEntry' :: DomainEntry -> Maybe Text
type'} -> Maybe Text
type') (\s :: DomainEntry
s@DomainEntry' {} Maybe Text
a -> DomainEntry
s {$sel:type':DomainEntry' :: Maybe Text
type' = Maybe Text
a} :: DomainEntry)
domainEntry_target :: Lens.Lens' DomainEntry (Prelude.Maybe Prelude.Text)
domainEntry_target :: (Maybe Text -> f (Maybe Text)) -> DomainEntry -> f DomainEntry
domainEntry_target = (DomainEntry -> Maybe Text)
-> (DomainEntry -> Maybe Text -> DomainEntry)
-> Lens DomainEntry DomainEntry (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainEntry' {Maybe Text
target :: Maybe Text
$sel:target:DomainEntry' :: DomainEntry -> Maybe Text
target} -> Maybe Text
target) (\s :: DomainEntry
s@DomainEntry' {} Maybe Text
a -> DomainEntry
s {$sel:target:DomainEntry' :: Maybe Text
target = Maybe Text
a} :: DomainEntry)
instance Core.FromJSON DomainEntry where
parseJSON :: Value -> Parser DomainEntry
parseJSON =
String
-> (Object -> Parser DomainEntry) -> Value -> Parser DomainEntry
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DomainEntry"
( \Object
x ->
Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> DomainEntry
DomainEntry'
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> DomainEntry)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> DomainEntry)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"isAlias")
Parser
(Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> DomainEntry)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> DomainEntry)
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 (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> DomainEntry)
-> Parser (Maybe Text)
-> Parser
(Maybe (HashMap Text Text)
-> Maybe Text -> Maybe Text -> DomainEntry)
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
"id")
Parser
(Maybe (HashMap Text Text)
-> Maybe Text -> Maybe Text -> DomainEntry)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Maybe Text -> Maybe Text -> DomainEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"options" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Text -> Maybe Text -> DomainEntry)
-> Parser (Maybe Text) -> Parser (Maybe Text -> DomainEntry)
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
"type")
Parser (Maybe Text -> DomainEntry)
-> Parser (Maybe Text) -> Parser DomainEntry
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
"target")
)
instance Prelude.Hashable DomainEntry
instance Prelude.NFData DomainEntry
instance Core.ToJSON DomainEntry where
toJSON :: DomainEntry -> Value
toJSON DomainEntry' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
target :: Maybe Text
type' :: Maybe Text
options :: Maybe (HashMap Text Text)
id :: Maybe Text
name :: Maybe Text
isAlias :: Maybe Bool
$sel:target:DomainEntry' :: DomainEntry -> Maybe Text
$sel:type':DomainEntry' :: DomainEntry -> Maybe Text
$sel:options:DomainEntry' :: DomainEntry -> Maybe (HashMap Text Text)
$sel:id:DomainEntry' :: DomainEntry -> Maybe Text
$sel:name:DomainEntry' :: DomainEntry -> Maybe Text
$sel:isAlias:DomainEntry' :: DomainEntry -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"isAlias" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
isAlias,
(Text
"name" 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
name,
(Text
"id" 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
id,
(Text
"options" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
options,
(Text
"type" 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
type',
(Text
"target" 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
target
]
)