module Stratosphere.Organizations.Policy (
Policy(..), mkPolicy
) 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 Policy
=
Policy {Policy -> ()
haddock_workaround_ :: (),
Policy -> Object
content :: JSON.Object,
Policy -> Maybe (Value Text)
description :: (Prelude.Maybe (Value Prelude.Text)),
Policy -> Value Text
name :: (Value Prelude.Text),
Policy -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag]),
Policy -> Maybe (ValueList Text)
targetIds :: (Prelude.Maybe (ValueList Prelude.Text)),
Policy -> Value Text
type' :: (Value Prelude.Text)}
deriving stock (Policy -> Policy -> Bool
(Policy -> Policy -> Bool)
-> (Policy -> Policy -> Bool) -> Eq Policy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Policy -> Policy -> Bool
== :: Policy -> Policy -> Bool
$c/= :: Policy -> Policy -> Bool
/= :: Policy -> Policy -> Bool
Prelude.Eq, Int -> Policy -> ShowS
[Policy] -> ShowS
Policy -> String
(Int -> Policy -> ShowS)
-> (Policy -> String) -> ([Policy] -> ShowS) -> Show Policy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Policy -> ShowS
showsPrec :: Int -> Policy -> ShowS
$cshow :: Policy -> String
show :: Policy -> String
$cshowList :: [Policy] -> ShowS
showList :: [Policy] -> ShowS
Prelude.Show)
mkPolicy ::
JSON.Object -> Value Prelude.Text -> Value Prelude.Text -> Policy
mkPolicy :: Object -> Value Text -> Value Text -> Policy
mkPolicy Object
content Value Text
name Value Text
type'
= Policy
{haddock_workaround_ :: ()
haddock_workaround_ = (), content :: Object
content = Object
content, name :: Value Text
name = Value Text
name,
type' :: Value Text
type' = Value Text
type', description :: Maybe (Value Text)
description = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing, targetIds :: Maybe (ValueList Text)
targetIds = Maybe (ValueList Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Policy where
toResourceProperties :: Policy -> ResourceProperties
toResourceProperties Policy {Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: Policy -> ()
content :: Policy -> Object
description :: Policy -> Maybe (Value Text)
name :: Policy -> Value Text
tags :: Policy -> Maybe [Tag]
targetIds :: Policy -> Maybe (ValueList Text)
type' :: Policy -> Value Text
haddock_workaround_ :: ()
content :: Object
description :: Maybe (Value Text)
name :: Value Text
tags :: Maybe [Tag]
targetIds :: Maybe (ValueList Text)
type' :: Value Text
..}
= ResourceProperties
{awsType :: Text
awsType = Text
"AWS::Organizations::Policy",
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
"Content" Key -> Object -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Object
content, Key
"Name" 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
name,
Key
"Type" 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
type']
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[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
"Description" (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)
description,
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,
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
"TargetIds" (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)
targetIds]))}
instance JSON.ToJSON Policy where
toJSON :: Policy -> Value
toJSON Policy {Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: Policy -> ()
content :: Policy -> Object
description :: Policy -> Maybe (Value Text)
name :: Policy -> Value Text
tags :: Policy -> Maybe [Tag]
targetIds :: Policy -> Maybe (ValueList Text)
type' :: Policy -> Value Text
haddock_workaround_ :: ()
content :: Object
description :: Maybe (Value Text)
name :: Value Text
tags :: Maybe [Tag]
targetIds :: Maybe (ValueList Text)
type' :: Value Text
..}
= [(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
"Content" Key -> Object -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Object
content, Key
"Name" 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
name,
Key
"Type" 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
type']
([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[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
"Description" (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)
description,
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,
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
"TargetIds" (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)
targetIds])))
instance Property "Content" Policy where
type PropertyType "Content" Policy = JSON.Object
set :: PropertyType "Content" Policy -> Policy -> Policy
set PropertyType "Content" Policy
newValue Policy {Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: Policy -> ()
content :: Policy -> Object
description :: Policy -> Maybe (Value Text)
name :: Policy -> Value Text
tags :: Policy -> Maybe [Tag]
targetIds :: Policy -> Maybe (ValueList Text)
type' :: Policy -> Value Text
haddock_workaround_ :: ()
content :: Object
description :: Maybe (Value Text)
name :: Value Text
tags :: Maybe [Tag]
targetIds :: Maybe (ValueList Text)
type' :: Value Text
..} = Policy {content :: Object
content = Object
PropertyType "Content" Policy
newValue, Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
name :: Value Text
tags :: Maybe [Tag]
targetIds :: Maybe (ValueList Text)
type' :: Value Text
haddock_workaround_ :: ()
description :: Maybe (Value Text)
name :: Value Text
tags :: Maybe [Tag]
targetIds :: Maybe (ValueList Text)
type' :: Value Text
..}
instance Property "Description" Policy where
type PropertyType "Description" Policy = Value Prelude.Text
set :: PropertyType "Description" Policy -> Policy -> Policy
set PropertyType "Description" Policy
newValue Policy {Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: Policy -> ()
content :: Policy -> Object
description :: Policy -> Maybe (Value Text)
name :: Policy -> Value Text
tags :: Policy -> Maybe [Tag]
targetIds :: Policy -> Maybe (ValueList Text)
type' :: Policy -> Value Text
haddock_workaround_ :: ()
content :: Object
description :: Maybe (Value Text)
name :: Value Text
tags :: Maybe [Tag]
targetIds :: Maybe (ValueList Text)
type' :: Value Text
..}
= Policy {description :: Maybe (Value Text)
description = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Description" Policy
Value Text
newValue, Maybe [Tag]
Maybe (ValueList Text)
()
Object
Value Text
haddock_workaround_ :: ()
content :: Object
name :: Value Text
tags :: Maybe [Tag]
targetIds :: Maybe (ValueList Text)
type' :: Value Text
haddock_workaround_ :: ()
content :: Object
name :: Value Text
tags :: Maybe [Tag]
targetIds :: Maybe (ValueList Text)
type' :: Value Text
..}
instance Property "Name" Policy where
type PropertyType "Name" Policy = Value Prelude.Text
set :: PropertyType "Name" Policy -> Policy -> Policy
set PropertyType "Name" Policy
newValue Policy {Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: Policy -> ()
content :: Policy -> Object
description :: Policy -> Maybe (Value Text)
name :: Policy -> Value Text
tags :: Policy -> Maybe [Tag]
targetIds :: Policy -> Maybe (ValueList Text)
type' :: Policy -> Value Text
haddock_workaround_ :: ()
content :: Object
description :: Maybe (Value Text)
name :: Value Text
tags :: Maybe [Tag]
targetIds :: Maybe (ValueList Text)
type' :: Value Text
..} = Policy {name :: Value Text
name = PropertyType "Name" Policy
Value Text
newValue, Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: ()
content :: Object
description :: Maybe (Value Text)
tags :: Maybe [Tag]
targetIds :: Maybe (ValueList Text)
type' :: Value Text
haddock_workaround_ :: ()
content :: Object
description :: Maybe (Value Text)
tags :: Maybe [Tag]
targetIds :: Maybe (ValueList Text)
type' :: Value Text
..}
instance Property "Tags" Policy where
type PropertyType "Tags" Policy = [Tag]
set :: PropertyType "Tags" Policy -> Policy -> Policy
set PropertyType "Tags" Policy
newValue Policy {Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: Policy -> ()
content :: Policy -> Object
description :: Policy -> Maybe (Value Text)
name :: Policy -> Value Text
tags :: Policy -> Maybe [Tag]
targetIds :: Policy -> Maybe (ValueList Text)
type' :: Policy -> Value Text
haddock_workaround_ :: ()
content :: Object
description :: Maybe (Value Text)
name :: Value Text
tags :: Maybe [Tag]
targetIds :: Maybe (ValueList Text)
type' :: Value Text
..}
= Policy {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" Policy
newValue, Maybe (ValueList Text)
Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: ()
content :: Object
description :: Maybe (Value Text)
name :: Value Text
targetIds :: Maybe (ValueList Text)
type' :: Value Text
haddock_workaround_ :: ()
content :: Object
description :: Maybe (Value Text)
name :: Value Text
targetIds :: Maybe (ValueList Text)
type' :: Value Text
..}
instance Property "TargetIds" Policy where
type PropertyType "TargetIds" Policy = ValueList Prelude.Text
set :: PropertyType "TargetIds" Policy -> Policy -> Policy
set PropertyType "TargetIds" Policy
newValue Policy {Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: Policy -> ()
content :: Policy -> Object
description :: Policy -> Maybe (Value Text)
name :: Policy -> Value Text
tags :: Policy -> Maybe [Tag]
targetIds :: Policy -> Maybe (ValueList Text)
type' :: Policy -> Value Text
haddock_workaround_ :: ()
content :: Object
description :: Maybe (Value Text)
name :: Value Text
tags :: Maybe [Tag]
targetIds :: Maybe (ValueList Text)
type' :: Value Text
..}
= Policy {targetIds :: Maybe (ValueList Text)
targetIds = ValueList Text -> Maybe (ValueList Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "TargetIds" Policy
ValueList Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: ()
content :: Object
description :: Maybe (Value Text)
name :: Value Text
tags :: Maybe [Tag]
type' :: Value Text
haddock_workaround_ :: ()
content :: Object
description :: Maybe (Value Text)
name :: Value Text
tags :: Maybe [Tag]
type' :: Value Text
..}
instance Property "Type" Policy where
type PropertyType "Type" Policy = Value Prelude.Text
set :: PropertyType "Type" Policy -> Policy -> Policy
set PropertyType "Type" Policy
newValue Policy {Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: Policy -> ()
content :: Policy -> Object
description :: Policy -> Maybe (Value Text)
name :: Policy -> Value Text
tags :: Policy -> Maybe [Tag]
targetIds :: Policy -> Maybe (ValueList Text)
type' :: Policy -> Value Text
haddock_workaround_ :: ()
content :: Object
description :: Maybe (Value Text)
name :: Value Text
tags :: Maybe [Tag]
targetIds :: Maybe (ValueList Text)
type' :: Value Text
..} = Policy {type' :: Value Text
type' = PropertyType "Type" Policy
Value Text
newValue, Maybe [Tag]
Maybe (ValueList Text)
Maybe (Value Text)
()
Object
Value Text
haddock_workaround_ :: ()
content :: Object
description :: Maybe (Value Text)
name :: Value Text
tags :: Maybe [Tag]
targetIds :: Maybe (ValueList Text)
haddock_workaround_ :: ()
content :: Object
description :: Maybe (Value Text)
name :: Value Text
tags :: Maybe [Tag]
targetIds :: Maybe (ValueList Text)
..}