{-# 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.Route53Domains.Types.DomainSuggestion where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DomainSuggestion = DomainSuggestion'
{
DomainSuggestion -> Maybe Text
availability :: Prelude.Maybe Prelude.Text,
DomainSuggestion -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text
}
deriving (DomainSuggestion -> DomainSuggestion -> Bool
(DomainSuggestion -> DomainSuggestion -> Bool)
-> (DomainSuggestion -> DomainSuggestion -> Bool)
-> Eq DomainSuggestion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainSuggestion -> DomainSuggestion -> Bool
$c/= :: DomainSuggestion -> DomainSuggestion -> Bool
== :: DomainSuggestion -> DomainSuggestion -> Bool
$c== :: DomainSuggestion -> DomainSuggestion -> Bool
Prelude.Eq, ReadPrec [DomainSuggestion]
ReadPrec DomainSuggestion
Int -> ReadS DomainSuggestion
ReadS [DomainSuggestion]
(Int -> ReadS DomainSuggestion)
-> ReadS [DomainSuggestion]
-> ReadPrec DomainSuggestion
-> ReadPrec [DomainSuggestion]
-> Read DomainSuggestion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainSuggestion]
$creadListPrec :: ReadPrec [DomainSuggestion]
readPrec :: ReadPrec DomainSuggestion
$creadPrec :: ReadPrec DomainSuggestion
readList :: ReadS [DomainSuggestion]
$creadList :: ReadS [DomainSuggestion]
readsPrec :: Int -> ReadS DomainSuggestion
$creadsPrec :: Int -> ReadS DomainSuggestion
Prelude.Read, Int -> DomainSuggestion -> ShowS
[DomainSuggestion] -> ShowS
DomainSuggestion -> String
(Int -> DomainSuggestion -> ShowS)
-> (DomainSuggestion -> String)
-> ([DomainSuggestion] -> ShowS)
-> Show DomainSuggestion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainSuggestion] -> ShowS
$cshowList :: [DomainSuggestion] -> ShowS
show :: DomainSuggestion -> String
$cshow :: DomainSuggestion -> String
showsPrec :: Int -> DomainSuggestion -> ShowS
$cshowsPrec :: Int -> DomainSuggestion -> ShowS
Prelude.Show, (forall x. DomainSuggestion -> Rep DomainSuggestion x)
-> (forall x. Rep DomainSuggestion x -> DomainSuggestion)
-> Generic DomainSuggestion
forall x. Rep DomainSuggestion x -> DomainSuggestion
forall x. DomainSuggestion -> Rep DomainSuggestion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DomainSuggestion x -> DomainSuggestion
$cfrom :: forall x. DomainSuggestion -> Rep DomainSuggestion x
Prelude.Generic)
newDomainSuggestion ::
DomainSuggestion
newDomainSuggestion :: DomainSuggestion
newDomainSuggestion =
DomainSuggestion' :: Maybe Text -> Maybe Text -> DomainSuggestion
DomainSuggestion'
{ $sel:availability:DomainSuggestion' :: Maybe Text
availability = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:domainName:DomainSuggestion' :: Maybe Text
domainName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
domainSuggestion_availability :: Lens.Lens' DomainSuggestion (Prelude.Maybe Prelude.Text)
domainSuggestion_availability :: (Maybe Text -> f (Maybe Text))
-> DomainSuggestion -> f DomainSuggestion
domainSuggestion_availability = (DomainSuggestion -> Maybe Text)
-> (DomainSuggestion -> Maybe Text -> DomainSuggestion)
-> Lens DomainSuggestion DomainSuggestion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainSuggestion' {Maybe Text
availability :: Maybe Text
$sel:availability:DomainSuggestion' :: DomainSuggestion -> Maybe Text
availability} -> Maybe Text
availability) (\s :: DomainSuggestion
s@DomainSuggestion' {} Maybe Text
a -> DomainSuggestion
s {$sel:availability:DomainSuggestion' :: Maybe Text
availability = Maybe Text
a} :: DomainSuggestion)
domainSuggestion_domainName :: Lens.Lens' DomainSuggestion (Prelude.Maybe Prelude.Text)
domainSuggestion_domainName :: (Maybe Text -> f (Maybe Text))
-> DomainSuggestion -> f DomainSuggestion
domainSuggestion_domainName = (DomainSuggestion -> Maybe Text)
-> (DomainSuggestion -> Maybe Text -> DomainSuggestion)
-> Lens DomainSuggestion DomainSuggestion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainSuggestion' {Maybe Text
domainName :: Maybe Text
$sel:domainName:DomainSuggestion' :: DomainSuggestion -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: DomainSuggestion
s@DomainSuggestion' {} Maybe Text
a -> DomainSuggestion
s {$sel:domainName:DomainSuggestion' :: Maybe Text
domainName = Maybe Text
a} :: DomainSuggestion)
instance Core.FromJSON DomainSuggestion where
parseJSON :: Value -> Parser DomainSuggestion
parseJSON =
String
-> (Object -> Parser DomainSuggestion)
-> Value
-> Parser DomainSuggestion
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DomainSuggestion"
( \Object
x ->
Maybe Text -> Maybe Text -> DomainSuggestion
DomainSuggestion'
(Maybe Text -> Maybe Text -> DomainSuggestion)
-> Parser (Maybe Text) -> Parser (Maybe Text -> DomainSuggestion)
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
"Availability")
Parser (Maybe Text -> DomainSuggestion)
-> Parser (Maybe Text) -> Parser DomainSuggestion
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
"DomainName")
)
instance Prelude.Hashable DomainSuggestion
instance Prelude.NFData DomainSuggestion