module Stratosphere.QuickSight.DataSource.ResourcePermissionProperty (
        ResourcePermissionProperty(..), mkResourcePermissionProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ResourcePermissionProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-datasource-resourcepermission.html>
    ResourcePermissionProperty {ResourcePermissionProperty -> ()
haddock_workaround_ :: (),
                                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-datasource-resourcepermission.html#cfn-quicksight-datasource-resourcepermission-actions>
                                ResourcePermissionProperty -> ValueList Text
actions :: (ValueList Prelude.Text),
                                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-datasource-resourcepermission.html#cfn-quicksight-datasource-resourcepermission-principal>
                                ResourcePermissionProperty -> Value Text
principal :: (Value Prelude.Text),
                                -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-quicksight-datasource-resourcepermission.html#cfn-quicksight-datasource-resourcepermission-resource>
                                ResourcePermissionProperty -> Maybe (Value Text)
resource :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (ResourcePermissionProperty -> ResourcePermissionProperty -> Bool
(ResourcePermissionProperty -> ResourcePermissionProperty -> Bool)
-> (ResourcePermissionProperty
    -> ResourcePermissionProperty -> Bool)
-> Eq ResourcePermissionProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ResourcePermissionProperty -> ResourcePermissionProperty -> Bool
== :: ResourcePermissionProperty -> ResourcePermissionProperty -> Bool
$c/= :: ResourcePermissionProperty -> ResourcePermissionProperty -> Bool
/= :: ResourcePermissionProperty -> ResourcePermissionProperty -> Bool
Prelude.Eq, Int -> ResourcePermissionProperty -> ShowS
[ResourcePermissionProperty] -> ShowS
ResourcePermissionProperty -> String
(Int -> ResourcePermissionProperty -> ShowS)
-> (ResourcePermissionProperty -> String)
-> ([ResourcePermissionProperty] -> ShowS)
-> Show ResourcePermissionProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ResourcePermissionProperty -> ShowS
showsPrec :: Int -> ResourcePermissionProperty -> ShowS
$cshow :: ResourcePermissionProperty -> String
show :: ResourcePermissionProperty -> String
$cshowList :: [ResourcePermissionProperty] -> ShowS
showList :: [ResourcePermissionProperty] -> ShowS
Prelude.Show)
mkResourcePermissionProperty ::
  ValueList Prelude.Text
  -> Value Prelude.Text -> ResourcePermissionProperty
mkResourcePermissionProperty :: ValueList Text -> Value Text -> ResourcePermissionProperty
mkResourcePermissionProperty ValueList Text
actions Value Text
principal
  = ResourcePermissionProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), actions :: ValueList Text
actions = ValueList Text
actions,
       principal :: Value Text
principal = Value Text
principal, resource :: Maybe (Value Text)
resource = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ResourcePermissionProperty where
  toResourceProperties :: ResourcePermissionProperty -> ResourceProperties
toResourceProperties ResourcePermissionProperty {Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: ResourcePermissionProperty -> ()
actions :: ResourcePermissionProperty -> ValueList Text
principal :: ResourcePermissionProperty -> Value Text
resource :: ResourcePermissionProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
actions :: ValueList Text
principal :: Value Text
resource :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::QuickSight::DataSource.ResourcePermission",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         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
"Actions" 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..= ValueList Text
actions, Key
"Principal" 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
principal]
                           ([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
"Resource" (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)
resource]))}
instance JSON.ToJSON ResourcePermissionProperty where
  toJSON :: ResourcePermissionProperty -> Value
toJSON ResourcePermissionProperty {Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: ResourcePermissionProperty -> ()
actions :: ResourcePermissionProperty -> ValueList Text
principal :: ResourcePermissionProperty -> Value Text
resource :: ResourcePermissionProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
actions :: ValueList Text
principal :: Value Text
resource :: Maybe (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
"Actions" 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..= ValueList Text
actions, Key
"Principal" 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
principal]
              ([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
"Resource" (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)
resource])))
instance Property "Actions" ResourcePermissionProperty where
  type PropertyType "Actions" ResourcePermissionProperty = ValueList Prelude.Text
  set :: PropertyType "Actions" ResourcePermissionProperty
-> ResourcePermissionProperty -> ResourcePermissionProperty
set PropertyType "Actions" ResourcePermissionProperty
newValue ResourcePermissionProperty {Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: ResourcePermissionProperty -> ()
actions :: ResourcePermissionProperty -> ValueList Text
principal :: ResourcePermissionProperty -> Value Text
resource :: ResourcePermissionProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
actions :: ValueList Text
principal :: Value Text
resource :: Maybe (Value Text)
..}
    = ResourcePermissionProperty {actions :: ValueList Text
actions = PropertyType "Actions" ResourcePermissionProperty
ValueList Text
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
principal :: Value Text
resource :: Maybe (Value Text)
haddock_workaround_ :: ()
principal :: Value Text
resource :: Maybe (Value Text)
..}
instance Property "Principal" ResourcePermissionProperty where
  type PropertyType "Principal" ResourcePermissionProperty = Value Prelude.Text
  set :: PropertyType "Principal" ResourcePermissionProperty
-> ResourcePermissionProperty -> ResourcePermissionProperty
set PropertyType "Principal" ResourcePermissionProperty
newValue ResourcePermissionProperty {Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: ResourcePermissionProperty -> ()
actions :: ResourcePermissionProperty -> ValueList Text
principal :: ResourcePermissionProperty -> Value Text
resource :: ResourcePermissionProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
actions :: ValueList Text
principal :: Value Text
resource :: Maybe (Value Text)
..}
    = ResourcePermissionProperty {principal :: Value Text
principal = PropertyType "Principal" ResourcePermissionProperty
Value Text
newValue, Maybe (Value Text)
()
ValueList Text
haddock_workaround_ :: ()
actions :: ValueList Text
resource :: Maybe (Value Text)
haddock_workaround_ :: ()
actions :: ValueList Text
resource :: Maybe (Value Text)
..}
instance Property "Resource" ResourcePermissionProperty where
  type PropertyType "Resource" ResourcePermissionProperty = Value Prelude.Text
  set :: PropertyType "Resource" ResourcePermissionProperty
-> ResourcePermissionProperty -> ResourcePermissionProperty
set PropertyType "Resource" ResourcePermissionProperty
newValue ResourcePermissionProperty {Maybe (Value Text)
()
ValueList Text
Value Text
haddock_workaround_ :: ResourcePermissionProperty -> ()
actions :: ResourcePermissionProperty -> ValueList Text
principal :: ResourcePermissionProperty -> Value Text
resource :: ResourcePermissionProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
actions :: ValueList Text
principal :: Value Text
resource :: Maybe (Value Text)
..}
    = ResourcePermissionProperty {resource :: Maybe (Value Text)
resource = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Resource" ResourcePermissionProperty
Value Text
newValue, ()
ValueList Text
Value Text
haddock_workaround_ :: ()
actions :: ValueList Text
principal :: Value Text
haddock_workaround_ :: ()
actions :: ValueList Text
principal :: Value Text
..}