{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 [PolicyTypeSummary]
availablePolicyTypes :: Prelude.Maybe [PolicyTypeSummary],
Organization -> Maybe OrganizationFeatureSet
featureSet :: Prelude.Maybe OrganizationFeatureSet,
Organization -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Organization -> Maybe Text
masterAccountArn :: Prelude.Maybe Prelude.Text,
Organization -> Maybe (Sensitive Text)
masterAccountEmail :: Prelude.Maybe (Data.Sensitive Prelude.Text),
Organization -> Maybe Text
masterAccountId :: Prelude.Maybe Prelude.Text
}
deriving (Organization -> Organization -> Bool
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
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. 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'
{ $sel:arn:Organization' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:availablePolicyTypes:Organization' :: Maybe [PolicyTypeSummary]
availablePolicyTypes = forall a. Maybe a
Prelude.Nothing,
$sel:featureSet:Organization' :: Maybe OrganizationFeatureSet
featureSet = forall a. Maybe a
Prelude.Nothing,
$sel:id:Organization' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
$sel:masterAccountArn:Organization' :: Maybe Text
masterAccountArn = forall a. Maybe a
Prelude.Nothing,
$sel:masterAccountEmail:Organization' :: Maybe (Sensitive Text)
masterAccountEmail = forall a. Maybe a
Prelude.Nothing,
$sel:masterAccountId:Organization' :: Maybe Text
masterAccountId = forall a. Maybe a
Prelude.Nothing
}
organization_arn :: Lens.Lens' Organization (Prelude.Maybe Prelude.Text)
organization_arn :: Lens' Organization (Maybe Text)
organization_arn = 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_availablePolicyTypes :: Lens.Lens' Organization (Prelude.Maybe [PolicyTypeSummary])
organization_availablePolicyTypes :: Lens' Organization (Maybe [PolicyTypeSummary])
organization_availablePolicyTypes = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
organization_featureSet :: Lens.Lens' Organization (Prelude.Maybe OrganizationFeatureSet)
organization_featureSet :: Lens' Organization (Maybe OrganizationFeatureSet)
organization_featureSet = 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)
organization_id :: Lens.Lens' Organization (Prelude.Maybe Prelude.Text)
organization_id :: Lens' Organization (Maybe Text)
organization_id = 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_masterAccountArn :: Lens.Lens' Organization (Prelude.Maybe Prelude.Text)
organization_masterAccountArn :: Lens' Organization (Maybe Text)
organization_masterAccountArn = 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 :: Lens' Organization (Maybe Text)
organization_masterAccountEmail = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
organization_masterAccountId :: Lens.Lens' Organization (Prelude.Maybe Prelude.Text)
organization_masterAccountId :: Lens' Organization (Maybe Text)
organization_masterAccountId = 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)
instance Data.FromJSON Organization where
parseJSON :: Value -> Parser Organization
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Organization"
( \Object
x ->
Maybe Text
-> Maybe [PolicyTypeSummary]
-> Maybe OrganizationFeatureSet
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Organization
Organization'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AvailablePolicyTypes"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"FeatureSet")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Id")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MasterAccountArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MasterAccountEmail")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MasterAccountId")
)
instance Prelude.Hashable Organization where
hashWithSalt :: Int -> Organization -> Int
hashWithSalt Int
_salt Organization' {Maybe [PolicyTypeSummary]
Maybe Text
Maybe (Sensitive Text)
Maybe OrganizationFeatureSet
masterAccountId :: Maybe Text
masterAccountEmail :: Maybe (Sensitive Text)
masterAccountArn :: Maybe Text
id :: Maybe Text
featureSet :: Maybe OrganizationFeatureSet
availablePolicyTypes :: Maybe [PolicyTypeSummary]
arn :: Maybe Text
$sel:masterAccountId:Organization' :: Organization -> Maybe Text
$sel:masterAccountEmail:Organization' :: Organization -> Maybe (Sensitive Text)
$sel:masterAccountArn:Organization' :: Organization -> Maybe Text
$sel:id:Organization' :: Organization -> Maybe Text
$sel:featureSet:Organization' :: Organization -> Maybe OrganizationFeatureSet
$sel:availablePolicyTypes:Organization' :: Organization -> Maybe [PolicyTypeSummary]
$sel:arn:Organization' :: Organization -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [PolicyTypeSummary]
availablePolicyTypes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OrganizationFeatureSet
featureSet
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
masterAccountArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
masterAccountEmail
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
masterAccountId
instance Prelude.NFData Organization where
rnf :: Organization -> ()
rnf Organization' {Maybe [PolicyTypeSummary]
Maybe Text
Maybe (Sensitive Text)
Maybe OrganizationFeatureSet
masterAccountId :: Maybe Text
masterAccountEmail :: Maybe (Sensitive Text)
masterAccountArn :: Maybe Text
id :: Maybe Text
featureSet :: Maybe OrganizationFeatureSet
availablePolicyTypes :: Maybe [PolicyTypeSummary]
arn :: Maybe Text
$sel:masterAccountId:Organization' :: Organization -> Maybe Text
$sel:masterAccountEmail:Organization' :: Organization -> Maybe (Sensitive Text)
$sel:masterAccountArn:Organization' :: Organization -> Maybe Text
$sel:id:Organization' :: Organization -> Maybe Text
$sel:featureSet:Organization' :: Organization -> Maybe OrganizationFeatureSet
$sel:availablePolicyTypes:Organization' :: Organization -> Maybe [PolicyTypeSummary]
$sel:arn:Organization' :: Organization -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [PolicyTypeSummary]
availablePolicyTypes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OrganizationFeatureSet
featureSet
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
masterAccountArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
masterAccountEmail
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
masterAccountId