{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.GameLift.Types.Script where
import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types.S3Location
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Script = Script'
{
Script -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
Script -> Maybe S3Location
storageLocation :: Prelude.Maybe S3Location,
Script -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Script -> Maybe Text
scriptId :: Prelude.Maybe Prelude.Text,
Script -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
Script -> Maybe Text
scriptArn :: Prelude.Maybe Prelude.Text,
Script -> Maybe Natural
sizeOnDisk :: Prelude.Maybe Prelude.Natural
}
deriving (Script -> Script -> Bool
(Script -> Script -> Bool)
-> (Script -> Script -> Bool) -> Eq Script
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Script -> Script -> Bool
$c/= :: Script -> Script -> Bool
== :: Script -> Script -> Bool
$c== :: Script -> Script -> Bool
Prelude.Eq, ReadPrec [Script]
ReadPrec Script
Int -> ReadS Script
ReadS [Script]
(Int -> ReadS Script)
-> ReadS [Script]
-> ReadPrec Script
-> ReadPrec [Script]
-> Read Script
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Script]
$creadListPrec :: ReadPrec [Script]
readPrec :: ReadPrec Script
$creadPrec :: ReadPrec Script
readList :: ReadS [Script]
$creadList :: ReadS [Script]
readsPrec :: Int -> ReadS Script
$creadsPrec :: Int -> ReadS Script
Prelude.Read, 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
showList :: [Script] -> ShowS
$cshowList :: [Script] -> ShowS
show :: Script -> String
$cshow :: Script -> String
showsPrec :: Int -> Script -> ShowS
$cshowsPrec :: Int -> Script -> ShowS
Prelude.Show, (forall x. Script -> Rep Script x)
-> (forall x. Rep Script x -> Script) -> Generic Script
forall x. Rep Script x -> Script
forall x. Script -> Rep Script x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Script x -> Script
$cfrom :: forall x. Script -> Rep Script x
Prelude.Generic)
newScript ::
Script
newScript :: Script
newScript =
Script' :: Maybe POSIX
-> Maybe S3Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Script
Script'
{ $sel:creationTime:Script' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:storageLocation:Script' :: Maybe S3Location
storageLocation = Maybe S3Location
forall a. Maybe a
Prelude.Nothing,
$sel:name:Script' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:scriptId:Script' :: Maybe Text
scriptId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:version:Script' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:scriptArn:Script' :: Maybe Text
scriptArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sizeOnDisk:Script' :: Maybe Natural
sizeOnDisk = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
script_creationTime :: Lens.Lens' Script (Prelude.Maybe Prelude.UTCTime)
script_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Script -> f Script
script_creationTime = (Script -> Maybe POSIX)
-> (Script -> Maybe POSIX -> Script)
-> Lens Script Script (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Script' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:Script' :: Script -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: Script
s@Script' {} Maybe POSIX
a -> Script
s {$sel:creationTime:Script' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: Script) ((Maybe POSIX -> f (Maybe POSIX)) -> Script -> f Script)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Script
-> f Script
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
script_storageLocation :: Lens.Lens' Script (Prelude.Maybe S3Location)
script_storageLocation :: (Maybe S3Location -> f (Maybe S3Location)) -> Script -> f Script
script_storageLocation = (Script -> Maybe S3Location)
-> (Script -> Maybe S3Location -> Script)
-> Lens Script Script (Maybe S3Location) (Maybe S3Location)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Script' {Maybe S3Location
storageLocation :: Maybe S3Location
$sel:storageLocation:Script' :: Script -> Maybe S3Location
storageLocation} -> Maybe S3Location
storageLocation) (\s :: Script
s@Script' {} Maybe S3Location
a -> Script
s {$sel:storageLocation:Script' :: Maybe S3Location
storageLocation = Maybe S3Location
a} :: Script)
script_name :: Lens.Lens' Script (Prelude.Maybe Prelude.Text)
script_name :: (Maybe Text -> f (Maybe Text)) -> Script -> f Script
script_name = (Script -> Maybe Text)
-> (Script -> Maybe Text -> Script)
-> Lens Script Script (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Script' {Maybe Text
name :: Maybe Text
$sel:name:Script' :: Script -> Maybe Text
name} -> Maybe Text
name) (\s :: Script
s@Script' {} Maybe Text
a -> Script
s {$sel:name:Script' :: Maybe Text
name = Maybe Text
a} :: Script)
script_scriptId :: Lens.Lens' Script (Prelude.Maybe Prelude.Text)
script_scriptId :: (Maybe Text -> f (Maybe Text)) -> Script -> f Script
script_scriptId = (Script -> Maybe Text)
-> (Script -> Maybe Text -> Script)
-> Lens Script Script (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Script' {Maybe Text
scriptId :: Maybe Text
$sel:scriptId:Script' :: Script -> Maybe Text
scriptId} -> Maybe Text
scriptId) (\s :: Script
s@Script' {} Maybe Text
a -> Script
s {$sel:scriptId:Script' :: Maybe Text
scriptId = Maybe Text
a} :: Script)
script_version :: Lens.Lens' Script (Prelude.Maybe Prelude.Text)
script_version :: (Maybe Text -> f (Maybe Text)) -> Script -> f Script
script_version = (Script -> Maybe Text)
-> (Script -> Maybe Text -> Script)
-> Lens Script Script (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Script' {Maybe Text
version :: Maybe Text
$sel:version:Script' :: Script -> Maybe Text
version} -> Maybe Text
version) (\s :: Script
s@Script' {} Maybe Text
a -> Script
s {$sel:version:Script' :: Maybe Text
version = Maybe Text
a} :: Script)
script_scriptArn :: Lens.Lens' Script (Prelude.Maybe Prelude.Text)
script_scriptArn :: (Maybe Text -> f (Maybe Text)) -> Script -> f Script
script_scriptArn = (Script -> Maybe Text)
-> (Script -> Maybe Text -> Script)
-> Lens Script Script (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Script' {Maybe Text
scriptArn :: Maybe Text
$sel:scriptArn:Script' :: Script -> Maybe Text
scriptArn} -> Maybe Text
scriptArn) (\s :: Script
s@Script' {} Maybe Text
a -> Script
s {$sel:scriptArn:Script' :: Maybe Text
scriptArn = Maybe Text
a} :: Script)
script_sizeOnDisk :: Lens.Lens' Script (Prelude.Maybe Prelude.Natural)
script_sizeOnDisk :: (Maybe Natural -> f (Maybe Natural)) -> Script -> f Script
script_sizeOnDisk = (Script -> Maybe Natural)
-> (Script -> Maybe Natural -> Script)
-> Lens Script Script (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Script' {Maybe Natural
sizeOnDisk :: Maybe Natural
$sel:sizeOnDisk:Script' :: Script -> Maybe Natural
sizeOnDisk} -> Maybe Natural
sizeOnDisk) (\s :: Script
s@Script' {} Maybe Natural
a -> Script
s {$sel:sizeOnDisk:Script' :: Maybe Natural
sizeOnDisk = Maybe Natural
a} :: Script)
instance Core.FromJSON Script where
parseJSON :: Value -> Parser Script
parseJSON =
String -> (Object -> Parser Script) -> Value -> Parser Script
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Script"
( \Object
x ->
Maybe POSIX
-> Maybe S3Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Script
Script'
(Maybe POSIX
-> Maybe S3Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Script)
-> Parser (Maybe POSIX)
-> Parser
(Maybe S3Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Script)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationTime")
Parser
(Maybe S3Location
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Script)
-> Parser (Maybe S3Location)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Script)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe S3Location)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StorageLocation")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Script)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Natural -> Script)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Natural -> Script)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Natural -> Script)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ScriptId")
Parser (Maybe Text -> Maybe Text -> Maybe Natural -> Script)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Natural -> Script)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Version")
Parser (Maybe Text -> Maybe Natural -> Script)
-> Parser (Maybe Text) -> Parser (Maybe Natural -> Script)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ScriptArn")
Parser (Maybe Natural -> Script)
-> Parser (Maybe Natural) -> Parser Script
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SizeOnDisk")
)
instance Prelude.Hashable Script
instance Prelude.NFData Script