{-# 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.OrganizationSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data OrganizationSummary = OrganizationSummary'
{
OrganizationSummary -> Maybe Text
state :: Prelude.Maybe Prelude.Text,
OrganizationSummary -> Maybe Text
alias :: Prelude.Maybe Prelude.Text,
OrganizationSummary -> Maybe Text
defaultMailDomain :: Prelude.Maybe Prelude.Text,
OrganizationSummary -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
OrganizationSummary -> Maybe Text
organizationId :: Prelude.Maybe Prelude.Text
}
deriving (OrganizationSummary -> OrganizationSummary -> Bool
(OrganizationSummary -> OrganizationSummary -> Bool)
-> (OrganizationSummary -> OrganizationSummary -> Bool)
-> Eq OrganizationSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OrganizationSummary -> OrganizationSummary -> Bool
$c/= :: OrganizationSummary -> OrganizationSummary -> Bool
== :: OrganizationSummary -> OrganizationSummary -> Bool
$c== :: OrganizationSummary -> OrganizationSummary -> Bool
Prelude.Eq, ReadPrec [OrganizationSummary]
ReadPrec OrganizationSummary
Int -> ReadS OrganizationSummary
ReadS [OrganizationSummary]
(Int -> ReadS OrganizationSummary)
-> ReadS [OrganizationSummary]
-> ReadPrec OrganizationSummary
-> ReadPrec [OrganizationSummary]
-> Read OrganizationSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OrganizationSummary]
$creadListPrec :: ReadPrec [OrganizationSummary]
readPrec :: ReadPrec OrganizationSummary
$creadPrec :: ReadPrec OrganizationSummary
readList :: ReadS [OrganizationSummary]
$creadList :: ReadS [OrganizationSummary]
readsPrec :: Int -> ReadS OrganizationSummary
$creadsPrec :: Int -> ReadS OrganizationSummary
Prelude.Read, Int -> OrganizationSummary -> ShowS
[OrganizationSummary] -> ShowS
OrganizationSummary -> String
(Int -> OrganizationSummary -> ShowS)
-> (OrganizationSummary -> String)
-> ([OrganizationSummary] -> ShowS)
-> Show OrganizationSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OrganizationSummary] -> ShowS
$cshowList :: [OrganizationSummary] -> ShowS
show :: OrganizationSummary -> String
$cshow :: OrganizationSummary -> String
showsPrec :: Int -> OrganizationSummary -> ShowS
$cshowsPrec :: Int -> OrganizationSummary -> ShowS
Prelude.Show, (forall x. OrganizationSummary -> Rep OrganizationSummary x)
-> (forall x. Rep OrganizationSummary x -> OrganizationSummary)
-> Generic OrganizationSummary
forall x. Rep OrganizationSummary x -> OrganizationSummary
forall x. OrganizationSummary -> Rep OrganizationSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OrganizationSummary x -> OrganizationSummary
$cfrom :: forall x. OrganizationSummary -> Rep OrganizationSummary x
Prelude.Generic)
newOrganizationSummary ::
OrganizationSummary
newOrganizationSummary :: OrganizationSummary
newOrganizationSummary =
OrganizationSummary' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> OrganizationSummary
OrganizationSummary'
{ $sel:state:OrganizationSummary' :: Maybe Text
state = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:alias:OrganizationSummary' :: Maybe Text
alias = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:defaultMailDomain:OrganizationSummary' :: Maybe Text
defaultMailDomain = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:errorMessage:OrganizationSummary' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:organizationId:OrganizationSummary' :: Maybe Text
organizationId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
organizationSummary_state :: Lens.Lens' OrganizationSummary (Prelude.Maybe Prelude.Text)
organizationSummary_state :: (Maybe Text -> f (Maybe Text))
-> OrganizationSummary -> f OrganizationSummary
organizationSummary_state = (OrganizationSummary -> Maybe Text)
-> (OrganizationSummary -> Maybe Text -> OrganizationSummary)
-> Lens
OrganizationSummary OrganizationSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationSummary' {Maybe Text
state :: Maybe Text
$sel:state:OrganizationSummary' :: OrganizationSummary -> Maybe Text
state} -> Maybe Text
state) (\s :: OrganizationSummary
s@OrganizationSummary' {} Maybe Text
a -> OrganizationSummary
s {$sel:state:OrganizationSummary' :: Maybe Text
state = Maybe Text
a} :: OrganizationSummary)
organizationSummary_alias :: Lens.Lens' OrganizationSummary (Prelude.Maybe Prelude.Text)
organizationSummary_alias :: (Maybe Text -> f (Maybe Text))
-> OrganizationSummary -> f OrganizationSummary
organizationSummary_alias = (OrganizationSummary -> Maybe Text)
-> (OrganizationSummary -> Maybe Text -> OrganizationSummary)
-> Lens
OrganizationSummary OrganizationSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationSummary' {Maybe Text
alias :: Maybe Text
$sel:alias:OrganizationSummary' :: OrganizationSummary -> Maybe Text
alias} -> Maybe Text
alias) (\s :: OrganizationSummary
s@OrganizationSummary' {} Maybe Text
a -> OrganizationSummary
s {$sel:alias:OrganizationSummary' :: Maybe Text
alias = Maybe Text
a} :: OrganizationSummary)
organizationSummary_defaultMailDomain :: Lens.Lens' OrganizationSummary (Prelude.Maybe Prelude.Text)
organizationSummary_defaultMailDomain :: (Maybe Text -> f (Maybe Text))
-> OrganizationSummary -> f OrganizationSummary
organizationSummary_defaultMailDomain = (OrganizationSummary -> Maybe Text)
-> (OrganizationSummary -> Maybe Text -> OrganizationSummary)
-> Lens
OrganizationSummary OrganizationSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationSummary' {Maybe Text
defaultMailDomain :: Maybe Text
$sel:defaultMailDomain:OrganizationSummary' :: OrganizationSummary -> Maybe Text
defaultMailDomain} -> Maybe Text
defaultMailDomain) (\s :: OrganizationSummary
s@OrganizationSummary' {} Maybe Text
a -> OrganizationSummary
s {$sel:defaultMailDomain:OrganizationSummary' :: Maybe Text
defaultMailDomain = Maybe Text
a} :: OrganizationSummary)
organizationSummary_errorMessage :: Lens.Lens' OrganizationSummary (Prelude.Maybe Prelude.Text)
organizationSummary_errorMessage :: (Maybe Text -> f (Maybe Text))
-> OrganizationSummary -> f OrganizationSummary
organizationSummary_errorMessage = (OrganizationSummary -> Maybe Text)
-> (OrganizationSummary -> Maybe Text -> OrganizationSummary)
-> Lens
OrganizationSummary OrganizationSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationSummary' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:OrganizationSummary' :: OrganizationSummary -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: OrganizationSummary
s@OrganizationSummary' {} Maybe Text
a -> OrganizationSummary
s {$sel:errorMessage:OrganizationSummary' :: Maybe Text
errorMessage = Maybe Text
a} :: OrganizationSummary)
organizationSummary_organizationId :: Lens.Lens' OrganizationSummary (Prelude.Maybe Prelude.Text)
organizationSummary_organizationId :: (Maybe Text -> f (Maybe Text))
-> OrganizationSummary -> f OrganizationSummary
organizationSummary_organizationId = (OrganizationSummary -> Maybe Text)
-> (OrganizationSummary -> Maybe Text -> OrganizationSummary)
-> Lens
OrganizationSummary OrganizationSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OrganizationSummary' {Maybe Text
organizationId :: Maybe Text
$sel:organizationId:OrganizationSummary' :: OrganizationSummary -> Maybe Text
organizationId} -> Maybe Text
organizationId) (\s :: OrganizationSummary
s@OrganizationSummary' {} Maybe Text
a -> OrganizationSummary
s {$sel:organizationId:OrganizationSummary' :: Maybe Text
organizationId = Maybe Text
a} :: OrganizationSummary)
instance Core.FromJSON OrganizationSummary where
parseJSON :: Value -> Parser OrganizationSummary
parseJSON =
String
-> (Object -> Parser OrganizationSummary)
-> Value
-> Parser OrganizationSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"OrganizationSummary"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> OrganizationSummary
OrganizationSummary'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> OrganizationSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> OrganizationSummary)
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
"State")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> OrganizationSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> OrganizationSummary)
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
"Alias")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> OrganizationSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> OrganizationSummary)
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
"DefaultMailDomain")
Parser (Maybe Text -> Maybe Text -> OrganizationSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> OrganizationSummary)
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
"ErrorMessage")
Parser (Maybe Text -> OrganizationSummary)
-> Parser (Maybe Text) -> Parser OrganizationSummary
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
"OrganizationId")
)
instance Prelude.Hashable OrganizationSummary
instance Prelude.NFData OrganizationSummary