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