module Stratosphere.Organizations.Account (
Account(..), mkAccount
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data Account
=
Account {Account -> ()
haddock_workaround_ :: (),
Account -> Value Text
accountName :: (Value Prelude.Text),
Account -> Value Text
email :: (Value Prelude.Text),
Account -> Maybe (ValueList Text)
parentIds :: (Prelude.Maybe (ValueList Prelude.Text)),
Account -> Maybe (Value Text)
roleName :: (Prelude.Maybe (Value Prelude.Text)),
Account -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
deriving stock (Account -> Account -> Bool
(Account -> Account -> Bool)
-> (Account -> Account -> Bool) -> Eq Account
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Account -> Account -> Bool
== :: Account -> Account -> Bool
$c/= :: Account -> Account -> Bool
/= :: Account -> Account -> Bool
Prelude.Eq, Int -> Account -> ShowS
[Account] -> ShowS
Account -> String
(Int -> Account -> ShowS)
-> (Account -> String) -> ([Account] -> ShowS) -> Show Account
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Account -> ShowS
showsPrec :: Int -> Account -> ShowS
$cshow :: Account -> String
show :: Account -> String
$cshowList :: [Account] -> ShowS
showList :: [Account] -> ShowS
Prelude.Show)
mkAccount :: Value Prelude.Text -> Value Prelude.Text -> Account
mkAccount :: Value Text -> Value Text -> Account
mkAccount Value Text
accountName Value Text
email
= Account
{haddock_workaround_ :: ()
haddock_workaround_ = (), accountName :: Value Text
accountName = Value Text
accountName,
email :: Value Text
email = Value Text
email, parentIds :: Maybe (ValueList Text)
parentIds = Maybe (ValueList Text)
forall a. Maybe a
Prelude.Nothing,
roleName :: Maybe (Value Text)
roleName = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Account where
toResourceProperties :: Account -> ResourceProperties
toResourceProperties Account {Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Account -> ()
accountName :: Account -> Value Text
email :: Account -> Value Text
parentIds :: Account -> Maybe (ValueList Text)
roleName :: Account -> Maybe (Value Text)
tags :: Account -> Maybe [Tag]
haddock_workaround_ :: ()
accountName :: Value Text
email :: Value Text
parentIds :: Maybe (ValueList Text)
roleName :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::Organizations::Account",
supportsTags :: Bool
supportsTags = Bool
Prelude.True,
properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"AccountName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
accountName, Key
"Email" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
email]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> ValueList Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"ParentIds" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
parentIds,
Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"RoleName" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
roleName,
Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))}
instance JSON.ToJSON Account where
toJSON :: Account -> Value
toJSON Account {Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Account -> ()
accountName :: Account -> Value Text
email :: Account -> Value Text
parentIds :: Account -> Maybe (ValueList Text)
roleName :: Account -> Maybe (Value Text)
tags :: Account -> Maybe [Tag]
haddock_workaround_ :: ()
accountName :: Value Text
email :: Value Text
parentIds :: Maybe (ValueList Text)
roleName :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
= [(Key, Value)] -> Value
JSON.object
([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
[Key
"AccountName" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
accountName, Key
"Email" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
email]
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Key -> ValueList Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"ParentIds" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
parentIds,
Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"RoleName" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
roleName,
Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])))
instance Property "AccountName" Account where
type PropertyType "AccountName" Account = Value Prelude.Text
set :: PropertyType "AccountName" Account -> Account -> Account
set PropertyType "AccountName" Account
newValue Account {Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Account -> ()
accountName :: Account -> Value Text
email :: Account -> Value Text
parentIds :: Account -> Maybe (ValueList Text)
roleName :: Account -> Maybe (Value Text)
tags :: Account -> Maybe [Tag]
haddock_workaround_ :: ()
accountName :: Value Text
email :: Value Text
parentIds :: Maybe (ValueList Text)
roleName :: Maybe (Value Text)
tags :: Maybe [Tag]
..} = Account {accountName :: Value Text
accountName = PropertyType "AccountName" Account
Value Text
newValue, Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
email :: Value Text
parentIds :: Maybe (ValueList Text)
roleName :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
email :: Value Text
parentIds :: Maybe (ValueList Text)
roleName :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "Email" Account where
type PropertyType "Email" Account = Value Prelude.Text
set :: PropertyType "Email" Account -> Account -> Account
set PropertyType "Email" Account
newValue Account {Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Account -> ()
accountName :: Account -> Value Text
email :: Account -> Value Text
parentIds :: Account -> Maybe (ValueList Text)
roleName :: Account -> Maybe (Value Text)
tags :: Account -> Maybe [Tag]
haddock_workaround_ :: ()
accountName :: Value Text
email :: Value Text
parentIds :: Maybe (ValueList Text)
roleName :: Maybe (Value Text)
tags :: Maybe [Tag]
..} = Account {email :: Value Text
email = PropertyType "Email" Account
Value Text
newValue, Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
accountName :: Value Text
parentIds :: Maybe (ValueList Text)
roleName :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
accountName :: Value Text
parentIds :: Maybe (ValueList Text)
roleName :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "ParentIds" Account where
type PropertyType "ParentIds" Account = ValueList Prelude.Text
set :: PropertyType "ParentIds" Account -> Account -> Account
set PropertyType "ParentIds" Account
newValue Account {Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Account -> ()
accountName :: Account -> Value Text
email :: Account -> Value Text
parentIds :: Account -> Maybe (ValueList Text)
roleName :: Account -> Maybe (Value Text)
tags :: Account -> Maybe [Tag]
haddock_workaround_ :: ()
accountName :: Value Text
email :: Value Text
parentIds :: Maybe (ValueList Text)
roleName :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
= Account {parentIds :: Maybe (ValueList Text)
parentIds = ValueList Text -> Maybe (ValueList Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ParentIds" Account
ValueList Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
accountName :: Value Text
email :: Value Text
roleName :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
accountName :: Value Text
email :: Value Text
roleName :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "RoleName" Account where
type PropertyType "RoleName" Account = Value Prelude.Text
set :: PropertyType "RoleName" Account -> Account -> Account
set PropertyType "RoleName" Account
newValue Account {Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Account -> ()
accountName :: Account -> Value Text
email :: Account -> Value Text
parentIds :: Account -> Maybe (ValueList Text)
roleName :: Account -> Maybe (Value Text)
tags :: Account -> Maybe [Tag]
haddock_workaround_ :: ()
accountName :: Value Text
email :: Value Text
parentIds :: Maybe (ValueList Text)
roleName :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
= Account {roleName :: Maybe (Value Text)
roleName = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "RoleName" Account
Value Text
newValue, Maybe [Tag]
Maybe (ValueList Text)
()
Value Text
haddock_workaround_ :: ()
accountName :: Value Text
email :: Value Text
parentIds :: Maybe (ValueList Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
accountName :: Value Text
email :: Value Text
parentIds :: Maybe (ValueList Text)
tags :: Maybe [Tag]
..}
instance Property "Tags" Account where
type PropertyType "Tags" Account = [Tag]
set :: PropertyType "Tags" Account -> Account -> Account
set PropertyType "Tags" Account
newValue Account {Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Account -> ()
accountName :: Account -> Value Text
email :: Account -> Value Text
parentIds :: Account -> Maybe (ValueList Text)
roleName :: Account -> Maybe (Value Text)
tags :: Account -> Maybe [Tag]
haddock_workaround_ :: ()
accountName :: Value Text
email :: Value Text
parentIds :: Maybe (ValueList Text)
roleName :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
= Account {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" Account
newValue, Maybe (ValueList Text)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
accountName :: Value Text
email :: Value Text
parentIds :: Maybe (ValueList Text)
roleName :: Maybe (Value Text)
haddock_workaround_ :: ()
accountName :: Value Text
email :: Value Text
parentIds :: Maybe (ValueList Text)
roleName :: Maybe (Value Text)
..}