module Stratosphere.RAM.Permission (
        Permission(..), mkPermission
    ) 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 Permission
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ram-permission.html>
    Permission {Permission -> ()
haddock_workaround_ :: (),
                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ram-permission.html#cfn-ram-permission-name>
                Permission -> Value Text
name :: (Value Prelude.Text),
                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ram-permission.html#cfn-ram-permission-policytemplate>
                Permission -> Object
policyTemplate :: JSON.Object,
                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ram-permission.html#cfn-ram-permission-resourcetype>
                Permission -> Value Text
resourceType :: (Value Prelude.Text),
                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ram-permission.html#cfn-ram-permission-tags>
                Permission -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (Permission -> Permission -> Bool
(Permission -> Permission -> Bool)
-> (Permission -> Permission -> Bool) -> Eq Permission
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Permission -> Permission -> Bool
== :: Permission -> Permission -> Bool
$c/= :: Permission -> Permission -> Bool
/= :: Permission -> Permission -> Bool
Prelude.Eq, Int -> Permission -> ShowS
[Permission] -> ShowS
Permission -> String
(Int -> Permission -> ShowS)
-> (Permission -> String)
-> ([Permission] -> ShowS)
-> Show Permission
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Permission -> ShowS
showsPrec :: Int -> Permission -> ShowS
$cshow :: Permission -> String
show :: Permission -> String
$cshowList :: [Permission] -> ShowS
showList :: [Permission] -> ShowS
Prelude.Show)
mkPermission ::
  Value Prelude.Text
  -> JSON.Object -> Value Prelude.Text -> Permission
mkPermission :: Value Text -> Object -> Value Text -> Permission
mkPermission Value Text
name Object
policyTemplate Value Text
resourceType
  = Permission
      {haddock_workaround_ :: ()
haddock_workaround_ = (), name :: Value Text
name = Value Text
name,
       policyTemplate :: Object
policyTemplate = Object
policyTemplate, resourceType :: Value Text
resourceType = Value Text
resourceType,
       tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Permission where
  toResourceProperties :: Permission -> ResourceProperties
toResourceProperties Permission {Maybe [Tag]
()
Object
Value Text
haddock_workaround_ :: Permission -> ()
name :: Permission -> Value Text
policyTemplate :: Permission -> Object
resourceType :: Permission -> Value Text
tags :: Permission -> Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
policyTemplate :: Object
resourceType :: Value Text
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::RAM::Permission", 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
"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
"PolicyTemplate" 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
policyTemplate,
                            Key
"ResourceType" 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
resourceType]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [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 Permission where
  toJSON :: Permission -> Value
toJSON Permission {Maybe [Tag]
()
Object
Value Text
haddock_workaround_ :: Permission -> ()
name :: Permission -> Value Text
policyTemplate :: Permission -> Object
resourceType :: Permission -> Value Text
tags :: Permission -> Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
policyTemplate :: Object
resourceType :: 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
"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
"PolicyTemplate" 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
policyTemplate,
               Key
"ResourceType" 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
resourceType]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [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 "Name" Permission where
  type PropertyType "Name" Permission = Value Prelude.Text
  set :: PropertyType "Name" Permission -> Permission -> Permission
set PropertyType "Name" Permission
newValue Permission {Maybe [Tag]
()
Object
Value Text
haddock_workaround_ :: Permission -> ()
name :: Permission -> Value Text
policyTemplate :: Permission -> Object
resourceType :: Permission -> Value Text
tags :: Permission -> Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
policyTemplate :: Object
resourceType :: Value Text
tags :: Maybe [Tag]
..} = Permission {name :: Value Text
name = PropertyType "Name" Permission
Value Text
newValue, Maybe [Tag]
()
Object
Value Text
haddock_workaround_ :: ()
policyTemplate :: Object
resourceType :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
policyTemplate :: Object
resourceType :: Value Text
tags :: Maybe [Tag]
..}
instance Property "PolicyTemplate" Permission where
  type PropertyType "PolicyTemplate" Permission = JSON.Object
  set :: PropertyType "PolicyTemplate" Permission
-> Permission -> Permission
set PropertyType "PolicyTemplate" Permission
newValue Permission {Maybe [Tag]
()
Object
Value Text
haddock_workaround_ :: Permission -> ()
name :: Permission -> Value Text
policyTemplate :: Permission -> Object
resourceType :: Permission -> Value Text
tags :: Permission -> Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
policyTemplate :: Object
resourceType :: Value Text
tags :: Maybe [Tag]
..}
    = Permission {policyTemplate :: Object
policyTemplate = Object
PropertyType "PolicyTemplate" Permission
newValue, Maybe [Tag]
()
Value Text
haddock_workaround_ :: ()
name :: Value Text
resourceType :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
resourceType :: Value Text
tags :: Maybe [Tag]
..}
instance Property "ResourceType" Permission where
  type PropertyType "ResourceType" Permission = Value Prelude.Text
  set :: PropertyType "ResourceType" Permission -> Permission -> Permission
set PropertyType "ResourceType" Permission
newValue Permission {Maybe [Tag]
()
Object
Value Text
haddock_workaround_ :: Permission -> ()
name :: Permission -> Value Text
policyTemplate :: Permission -> Object
resourceType :: Permission -> Value Text
tags :: Permission -> Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
policyTemplate :: Object
resourceType :: Value Text
tags :: Maybe [Tag]
..}
    = Permission {resourceType :: Value Text
resourceType = PropertyType "ResourceType" Permission
Value Text
newValue, Maybe [Tag]
()
Object
Value Text
haddock_workaround_ :: ()
name :: Value Text
policyTemplate :: Object
tags :: Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
policyTemplate :: Object
tags :: Maybe [Tag]
..}
instance Property "Tags" Permission where
  type PropertyType "Tags" Permission = [Tag]
  set :: PropertyType "Tags" Permission -> Permission -> Permission
set PropertyType "Tags" Permission
newValue Permission {Maybe [Tag]
()
Object
Value Text
haddock_workaround_ :: Permission -> ()
name :: Permission -> Value Text
policyTemplate :: Permission -> Object
resourceType :: Permission -> Value Text
tags :: Permission -> Maybe [Tag]
haddock_workaround_ :: ()
name :: Value Text
policyTemplate :: Object
resourceType :: Value Text
tags :: Maybe [Tag]
..}
    = Permission {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" Permission
newValue, ()
Object
Value Text
haddock_workaround_ :: ()
name :: Value Text
policyTemplate :: Object
resourceType :: Value Text
haddock_workaround_ :: ()
name :: Value Text
policyTemplate :: Object
resourceType :: Value Text
..}