{-# 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.WorkMail.Types.Domain where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Domain = Domain'
{
Domain -> Maybe Text
hostedZoneId :: Prelude.Maybe Prelude.Text,
Domain -> Maybe Text
domainName :: Prelude.Maybe Prelude.Text
}
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 Text -> Maybe Text -> Domain
Domain'
{ $sel:hostedZoneId:Domain' :: Maybe Text
hostedZoneId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:domainName:Domain' :: Maybe Text
domainName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
domain_hostedZoneId :: Lens.Lens' Domain (Prelude.Maybe Prelude.Text)
domain_hostedZoneId :: (Maybe Text -> f (Maybe Text)) -> Domain -> f Domain
domain_hostedZoneId = (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
hostedZoneId :: Maybe Text
$sel:hostedZoneId:Domain' :: Domain -> Maybe Text
hostedZoneId} -> Maybe Text
hostedZoneId) (\s :: Domain
s@Domain' {} Maybe Text
a -> Domain
s {$sel:hostedZoneId:Domain' :: Maybe Text
hostedZoneId = Maybe Text
a} :: Domain)
domain_domainName :: Lens.Lens' Domain (Prelude.Maybe Prelude.Text)
domain_domainName :: (Maybe Text -> f (Maybe Text)) -> Domain -> f Domain
domain_domainName = (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
domainName :: Maybe Text
$sel:domainName:Domain' :: Domain -> Maybe Text
domainName} -> Maybe Text
domainName) (\s :: Domain
s@Domain' {} Maybe Text
a -> Domain
s {$sel:domainName:Domain' :: Maybe Text
domainName = Maybe Text
a} :: Domain)
instance Prelude.Hashable Domain
instance Prelude.NFData Domain
instance Core.ToJSON Domain where
toJSON :: Domain -> Value
toJSON Domain' {Maybe Text
domainName :: Maybe Text
hostedZoneId :: Maybe Text
$sel:domainName:Domain' :: Domain -> Maybe Text
$sel:hostedZoneId:Domain' :: Domain -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"HostedZoneId" 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
hostedZoneId,
(Text
"DomainName" 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
domainName
]
)