module Stratosphere.GameLift.Script (
        module Exports, Script(..), mkScript
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.GameLift.Script.S3LocationProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data Script
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-script.html>
    Script {Script -> ()
haddock_workaround_ :: (),
            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-script.html#cfn-gamelift-script-name>
            Script -> Maybe (Value Text)
name :: (Prelude.Maybe (Value Prelude.Text)),
            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-script.html#cfn-gamelift-script-storagelocation>
            Script -> S3LocationProperty
storageLocation :: S3LocationProperty,
            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-script.html#cfn-gamelift-script-tags>
            Script -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag]),
            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-script.html#cfn-gamelift-script-version>
            Script -> Maybe (Value Text)
version :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (Script -> Script -> Bool
(Script -> Script -> Bool)
-> (Script -> Script -> Bool) -> Eq Script
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Script -> Script -> Bool
== :: Script -> Script -> Bool
$c/= :: Script -> Script -> Bool
/= :: Script -> Script -> Bool
Prelude.Eq, Int -> Script -> ShowS
[Script] -> ShowS
Script -> String
(Int -> Script -> ShowS)
-> (Script -> String) -> ([Script] -> ShowS) -> Show Script
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Script -> ShowS
showsPrec :: Int -> Script -> ShowS
$cshow :: Script -> String
show :: Script -> String
$cshowList :: [Script] -> ShowS
showList :: [Script] -> ShowS
Prelude.Show)
mkScript :: S3LocationProperty -> Script
mkScript :: S3LocationProperty -> Script
mkScript S3LocationProperty
storageLocation
  = Script
      {haddock_workaround_ :: ()
haddock_workaround_ = (), storageLocation :: S3LocationProperty
storageLocation = S3LocationProperty
storageLocation,
       name :: Maybe (Value Text)
name = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
       version :: Maybe (Value Text)
version = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Script where
  toResourceProperties :: Script -> ResourceProperties
toResourceProperties Script {Maybe [Tag]
Maybe (Value Text)
()
S3LocationProperty
haddock_workaround_ :: Script -> ()
name :: Script -> Maybe (Value Text)
storageLocation :: Script -> S3LocationProperty
tags :: Script -> Maybe [Tag]
version :: Script -> Maybe (Value Text)
haddock_workaround_ :: ()
name :: Maybe (Value Text)
storageLocation :: S3LocationProperty
tags :: Maybe [Tag]
version :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::GameLift::Script", 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
"StorageLocation" Key -> S3LocationProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= S3LocationProperty
storageLocation]
                           ([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
"Name" (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)
name,
                               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 -> 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
"Version" (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)
version]))}
instance JSON.ToJSON Script where
  toJSON :: Script -> Value
toJSON Script {Maybe [Tag]
Maybe (Value Text)
()
S3LocationProperty
haddock_workaround_ :: Script -> ()
name :: Script -> Maybe (Value Text)
storageLocation :: Script -> S3LocationProperty
tags :: Script -> Maybe [Tag]
version :: Script -> Maybe (Value Text)
haddock_workaround_ :: ()
name :: Maybe (Value Text)
storageLocation :: S3LocationProperty
tags :: Maybe [Tag]
version :: 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
"StorageLocation" Key -> S3LocationProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= S3LocationProperty
storageLocation]
              ([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
"Name" (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)
name,
                  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 -> 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
"Version" (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)
version])))
instance Property "Name" Script where
  type PropertyType "Name" Script = Value Prelude.Text
  set :: PropertyType "Name" Script -> Script -> Script
set PropertyType "Name" Script
newValue Script {Maybe [Tag]
Maybe (Value Text)
()
S3LocationProperty
haddock_workaround_ :: Script -> ()
name :: Script -> Maybe (Value Text)
storageLocation :: Script -> S3LocationProperty
tags :: Script -> Maybe [Tag]
version :: Script -> Maybe (Value Text)
haddock_workaround_ :: ()
name :: Maybe (Value Text)
storageLocation :: S3LocationProperty
tags :: Maybe [Tag]
version :: Maybe (Value Text)
..}
    = Script {name :: Maybe (Value Text)
name = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Name" Script
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
S3LocationProperty
haddock_workaround_ :: ()
storageLocation :: S3LocationProperty
tags :: Maybe [Tag]
version :: Maybe (Value Text)
haddock_workaround_ :: ()
storageLocation :: S3LocationProperty
tags :: Maybe [Tag]
version :: Maybe (Value Text)
..}
instance Property "StorageLocation" Script where
  type PropertyType "StorageLocation" Script = S3LocationProperty
  set :: PropertyType "StorageLocation" Script -> Script -> Script
set PropertyType "StorageLocation" Script
newValue Script {Maybe [Tag]
Maybe (Value Text)
()
S3LocationProperty
haddock_workaround_ :: Script -> ()
name :: Script -> Maybe (Value Text)
storageLocation :: Script -> S3LocationProperty
tags :: Script -> Maybe [Tag]
version :: Script -> Maybe (Value Text)
haddock_workaround_ :: ()
name :: Maybe (Value Text)
storageLocation :: S3LocationProperty
tags :: Maybe [Tag]
version :: Maybe (Value Text)
..} = Script {storageLocation :: S3LocationProperty
storageLocation = PropertyType "StorageLocation" Script
S3LocationProperty
newValue, Maybe [Tag]
Maybe (Value Text)
()
haddock_workaround_ :: ()
name :: Maybe (Value Text)
tags :: Maybe [Tag]
version :: Maybe (Value Text)
haddock_workaround_ :: ()
name :: Maybe (Value Text)
tags :: Maybe [Tag]
version :: Maybe (Value Text)
..}
instance Property "Tags" Script where
  type PropertyType "Tags" Script = [Tag]
  set :: PropertyType "Tags" Script -> Script -> Script
set PropertyType "Tags" Script
newValue Script {Maybe [Tag]
Maybe (Value Text)
()
S3LocationProperty
haddock_workaround_ :: Script -> ()
name :: Script -> Maybe (Value Text)
storageLocation :: Script -> S3LocationProperty
tags :: Script -> Maybe [Tag]
version :: Script -> Maybe (Value Text)
haddock_workaround_ :: ()
name :: Maybe (Value Text)
storageLocation :: S3LocationProperty
tags :: Maybe [Tag]
version :: Maybe (Value Text)
..}
    = Script {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" Script
newValue, Maybe (Value Text)
()
S3LocationProperty
haddock_workaround_ :: ()
name :: Maybe (Value Text)
storageLocation :: S3LocationProperty
version :: Maybe (Value Text)
haddock_workaround_ :: ()
name :: Maybe (Value Text)
storageLocation :: S3LocationProperty
version :: Maybe (Value Text)
..}
instance Property "Version" Script where
  type PropertyType "Version" Script = Value Prelude.Text
  set :: PropertyType "Version" Script -> Script -> Script
set PropertyType "Version" Script
newValue Script {Maybe [Tag]
Maybe (Value Text)
()
S3LocationProperty
haddock_workaround_ :: Script -> ()
name :: Script -> Maybe (Value Text)
storageLocation :: Script -> S3LocationProperty
tags :: Script -> Maybe [Tag]
version :: Script -> Maybe (Value Text)
haddock_workaround_ :: ()
name :: Maybe (Value Text)
storageLocation :: S3LocationProperty
tags :: Maybe [Tag]
version :: Maybe (Value Text)
..}
    = Script {version :: Maybe (Value Text)
version = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Version" Script
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
S3LocationProperty
haddock_workaround_ :: ()
name :: Maybe (Value Text)
storageLocation :: S3LocationProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
name :: Maybe (Value Text)
storageLocation :: S3LocationProperty
tags :: Maybe [Tag]
..}