{-# 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.Organizations.Types.Organization where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Organizations.Types.OrganizationFeatureSet
import Amazonka.Organizations.Types.PolicyTypeSummary
import qualified Amazonka.Prelude as Prelude
data Organization = Organization'
{
Organization -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Organization -> Maybe Text
masterAccountId :: Prelude.Maybe Prelude.Text,
Organization -> Maybe Text
masterAccountArn :: Prelude.Maybe Prelude.Text,
Organization -> Maybe (Sensitive Text)
masterAccountEmail :: Prelude.Maybe (Core.Sensitive Prelude.Text),
Organization -> Maybe [PolicyTypeSummary]
availablePolicyTypes :: Prelude.Maybe [PolicyTypeSummary],
Organization -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Organization -> Maybe OrganizationFeatureSet
featureSet :: Prelude.Maybe OrganizationFeatureSet
}
deriving (Organization -> Organization -> Bool
(Organization -> Organization -> Bool)
-> (Organization -> Organization -> Bool) -> Eq Organization
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Organization -> Organization -> Bool
$c/= :: Organization -> Organization -> Bool
== :: Organization -> Organization -> Bool
$c== :: Organization -> Organization -> Bool
Prelude.Eq, Int -> Organization -> ShowS
[Organization] -> ShowS
Organization -> String
(Int -> Organization -> ShowS)
-> (Organization -> String)
-> ([Organization] -> ShowS)
-> Show Organization
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Organization] -> ShowS
$cshowList :: [Organization] -> ShowS
show :: Organization -> String
$cshow :: Organization -> String
showsPrec :: Int -> Organization -> ShowS
$cshowsPrec :: Int -> Organization -> ShowS
Prelude.Show, (forall x. Organization -> Rep Organization x)
-> (forall x. Rep Organization x -> Organization)
-> Generic Organization
forall x. Rep Organization x -> Organization
forall x. Organization -> Rep Organization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Organization x -> Organization
$cfrom :: forall x. Organization -> Rep Organization x
Prelude.Generic)
newOrganization ::
Organization
newOrganization :: Organization
newOrganization =
Organization' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe [PolicyTypeSummary]
-> Maybe Text
-> Maybe OrganizationFeatureSet
-> Organization
Organization'
{ $sel:arn:Organization' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:masterAccountId:Organization' :: Maybe Text
masterAccountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:masterAccountArn:Organization' :: Maybe Text
masterAccountArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:masterAccountEmail:Organization' :: Maybe (Sensitive Text)
masterAccountEmail = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:availablePolicyTypes:Organization' :: Maybe [PolicyTypeSummary]
availablePolicyTypes = Maybe [PolicyTypeSummary]
forall a. Maybe a
Prelude.Nothing,
$sel:id:Organization' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:featureSet:Organization' :: Maybe OrganizationFeatureSet
featureSet = Maybe OrganizationFeatureSet
forall a. Maybe a
Prelude.Nothing
}
organization_arn :: Lens.Lens' Organization (Prelude.Maybe Prelude.Text)
organization_arn :: (Maybe Text -> f (Maybe Text)) -> Organization -> f Organization
organization_arn = (Organization -> Maybe Text)
-> (Organization -> Maybe Text -> Organization)
-> Lens Organization Organization (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Organization' {Maybe Text
arn :: Maybe Text
$sel:arn:Organization' :: Organization -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Organization
s@Organization' {} Maybe Text
a -> Organization
s {$sel:arn:Organization' :: Maybe Text
arn = Maybe Text
a} :: Organization)
organization_masterAccountId :: Lens.Lens' Organization (Prelude.Maybe Prelude.Text)
organization_masterAccountId :: (Maybe Text -> f (Maybe Text)) -> Organization -> f Organization
organization_masterAccountId = (Organization -> Maybe Text)
-> (Organization -> Maybe Text -> Organization)
-> Lens Organization Organization (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Organization' {Maybe Text
masterAccountId :: Maybe Text
$sel:masterAccountId:Organization' :: Organization -> Maybe Text
masterAccountId} -> Maybe Text
masterAccountId) (\s :: Organization
s@Organization' {} Maybe Text
a -> Organization
s {$sel:masterAccountId:Organization' :: Maybe Text
masterAccountId = Maybe Text
a} :: Organization)
organization_masterAccountArn :: Lens.Lens' Organization (Prelude.Maybe Prelude.Text)
organization_masterAccountArn :: (Maybe Text -> f (Maybe Text)) -> Organization -> f Organization
organization_masterAccountArn = (Organization -> Maybe Text)
-> (Organization -> Maybe Text -> Organization)
-> Lens Organization Organization (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Organization' {Maybe Text
masterAccountArn :: Maybe Text
$sel:masterAccountArn:Organization' :: Organization -> Maybe Text
masterAccountArn} -> Maybe Text
masterAccountArn) (\s :: Organization
s@Organization' {} Maybe Text
a -> Organization
s {$sel:masterAccountArn:Organization' :: Maybe Text
masterAccountArn = Maybe Text
a} :: Organization)
organization_masterAccountEmail :: Lens.Lens' Organization (Prelude.Maybe Prelude.Text)
organization_masterAccountEmail :: (Maybe Text -> f (Maybe Text)) -> Organization -> f Organization
organization_masterAccountEmail = (Organization -> Maybe (Sensitive Text))
-> (Organization -> Maybe (Sensitive Text) -> Organization)
-> Lens
Organization
Organization
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Organization' {Maybe (Sensitive Text)
masterAccountEmail :: Maybe (Sensitive Text)
$sel:masterAccountEmail:Organization' :: Organization -> Maybe (Sensitive Text)
masterAccountEmail} -> Maybe (Sensitive Text)
masterAccountEmail) (\s :: Organization
s@Organization' {} Maybe (Sensitive Text)
a -> Organization
s {$sel:masterAccountEmail:Organization' :: Maybe (Sensitive Text)
masterAccountEmail = Maybe (Sensitive Text)
a} :: Organization) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> Organization -> f Organization)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Organization
-> f Organization
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
organization_availablePolicyTypes :: Lens.Lens' Organization (Prelude.Maybe [PolicyTypeSummary])
organization_availablePolicyTypes :: (Maybe [PolicyTypeSummary] -> f (Maybe [PolicyTypeSummary]))
-> Organization -> f Organization
organization_availablePolicyTypes = (Organization -> Maybe [PolicyTypeSummary])
-> (Organization -> Maybe [PolicyTypeSummary] -> Organization)
-> Lens
Organization
Organization
(Maybe [PolicyTypeSummary])
(Maybe [PolicyTypeSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Organization' {Maybe [PolicyTypeSummary]
availablePolicyTypes :: Maybe [PolicyTypeSummary]
$sel:availablePolicyTypes:Organization' :: Organization -> Maybe [PolicyTypeSummary]
availablePolicyTypes} -> Maybe [PolicyTypeSummary]
availablePolicyTypes) (\s :: Organization
s@Organization' {} Maybe [PolicyTypeSummary]
a -> Organization
s {$sel:availablePolicyTypes:Organization' :: Maybe [PolicyTypeSummary]
availablePolicyTypes = Maybe [PolicyTypeSummary]
a} :: Organization) ((Maybe [PolicyTypeSummary] -> f (Maybe [PolicyTypeSummary]))
-> Organization -> f Organization)
-> ((Maybe [PolicyTypeSummary] -> f (Maybe [PolicyTypeSummary]))
-> Maybe [PolicyTypeSummary] -> f (Maybe [PolicyTypeSummary]))
-> (Maybe [PolicyTypeSummary] -> f (Maybe [PolicyTypeSummary]))
-> Organization
-> f Organization
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[PolicyTypeSummary]
[PolicyTypeSummary]
[PolicyTypeSummary]
[PolicyTypeSummary]
-> Iso
(Maybe [PolicyTypeSummary])
(Maybe [PolicyTypeSummary])
(Maybe [PolicyTypeSummary])
(Maybe [PolicyTypeSummary])
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
[PolicyTypeSummary]
[PolicyTypeSummary]
[PolicyTypeSummary]
[PolicyTypeSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
organization_id :: Lens.Lens' Organization (Prelude.Maybe Prelude.Text)
organization_id :: (Maybe Text -> f (Maybe Text)) -> Organization -> f Organization
organization_id = (Organization -> Maybe Text)
-> (Organization -> Maybe Text -> Organization)
-> Lens Organization Organization (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Organization' {Maybe Text
id :: Maybe Text
$sel:id:Organization' :: Organization -> Maybe Text
id} -> Maybe Text
id) (\s :: Organization
s@Organization' {} Maybe Text
a -> Organization
s {$sel:id:Organization' :: Maybe Text
id = Maybe Text
a} :: Organization)
organization_featureSet :: Lens.Lens' Organization (Prelude.Maybe OrganizationFeatureSet)
organization_featureSet :: (Maybe OrganizationFeatureSet -> f (Maybe OrganizationFeatureSet))
-> Organization -> f Organization
organization_featureSet = (Organization -> Maybe OrganizationFeatureSet)
-> (Organization -> Maybe OrganizationFeatureSet -> Organization)
-> Lens
Organization
Organization
(Maybe OrganizationFeatureSet)
(Maybe OrganizationFeatureSet)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Organization' {Maybe OrganizationFeatureSet
featureSet :: Maybe OrganizationFeatureSet
$sel:featureSet:Organization' :: Organization -> Maybe OrganizationFeatureSet
featureSet} -> Maybe OrganizationFeatureSet
featureSet) (\s :: Organization
s@Organization' {} Maybe OrganizationFeatureSet
a -> Organization
s {$sel:featureSet:Organization' :: Maybe OrganizationFeatureSet
featureSet = Maybe OrganizationFeatureSet
a} :: Organization)
instance Core.FromJSON Organization where
parseJSON :: Value -> Parser Organization
parseJSON =
String
-> (Object -> Parser Organization) -> Value -> Parser Organization
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Organization"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe [PolicyTypeSummary]
-> Maybe Text
-> Maybe OrganizationFeatureSet
-> Organization
Organization'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe [PolicyTypeSummary]
-> Maybe Text
-> Maybe OrganizationFeatureSet
-> Organization)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe [PolicyTypeSummary]
-> Maybe Text
-> Maybe OrganizationFeatureSet
-> Organization)
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
"Arn")
Parser
(Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe [PolicyTypeSummary]
-> Maybe Text
-> Maybe OrganizationFeatureSet
-> Organization)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe (Sensitive Text)
-> Maybe [PolicyTypeSummary]
-> Maybe Text
-> Maybe OrganizationFeatureSet
-> Organization)
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
"MasterAccountId")
Parser
(Maybe Text
-> Maybe (Sensitive Text)
-> Maybe [PolicyTypeSummary]
-> Maybe Text
-> Maybe OrganizationFeatureSet
-> Organization)
-> Parser (Maybe Text)
-> Parser
(Maybe (Sensitive Text)
-> Maybe [PolicyTypeSummary]
-> Maybe Text
-> Maybe OrganizationFeatureSet
-> Organization)
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
"MasterAccountArn")
Parser
(Maybe (Sensitive Text)
-> Maybe [PolicyTypeSummary]
-> Maybe Text
-> Maybe OrganizationFeatureSet
-> Organization)
-> Parser (Maybe (Sensitive Text))
-> Parser
(Maybe [PolicyTypeSummary]
-> Maybe Text -> Maybe OrganizationFeatureSet -> Organization)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MasterAccountEmail")
Parser
(Maybe [PolicyTypeSummary]
-> Maybe Text -> Maybe OrganizationFeatureSet -> Organization)
-> Parser (Maybe [PolicyTypeSummary])
-> Parser
(Maybe Text -> Maybe OrganizationFeatureSet -> Organization)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [PolicyTypeSummary]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AvailablePolicyTypes"
Parser (Maybe (Maybe [PolicyTypeSummary]))
-> Maybe [PolicyTypeSummary] -> Parser (Maybe [PolicyTypeSummary])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [PolicyTypeSummary]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe Text -> Maybe OrganizationFeatureSet -> Organization)
-> Parser (Maybe Text)
-> Parser (Maybe OrganizationFeatureSet -> Organization)
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 OrganizationFeatureSet -> Organization)
-> Parser (Maybe OrganizationFeatureSet) -> Parser Organization
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OrganizationFeatureSet)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FeatureSet")
)
instance Prelude.Hashable Organization
instance Prelude.NFData Organization