{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GameLift.Types.S3Location
import qualified Amazonka.Prelude as Prelude
data Script = Script'
{
Script -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
Script -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Script -> Maybe Text
scriptArn :: Prelude.Maybe Prelude.Text,
Script -> Maybe Text
scriptId :: Prelude.Maybe Prelude.Text,
Script -> Maybe Natural
sizeOnDisk :: Prelude.Maybe Prelude.Natural,
Script -> Maybe S3Location
storageLocation :: Prelude.Maybe S3Location,
Script -> Maybe Text
version :: Prelude.Maybe Prelude.Text
}
deriving (Script -> Script -> Bool
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]
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
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. 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'
{ $sel:creationTime:Script' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
$sel:name:Script' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:scriptArn:Script' :: Maybe Text
scriptArn = forall a. Maybe a
Prelude.Nothing,
$sel:scriptId:Script' :: Maybe Text
scriptId = forall a. Maybe a
Prelude.Nothing,
$sel:sizeOnDisk:Script' :: Maybe Natural
sizeOnDisk = forall a. Maybe a
Prelude.Nothing,
$sel:storageLocation:Script' :: Maybe S3Location
storageLocation = forall a. Maybe a
Prelude.Nothing,
$sel:version:Script' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing
}
script_creationTime :: Lens.Lens' Script (Prelude.Maybe Prelude.UTCTime)
script_creationTime :: Lens' Script (Maybe UTCTime)
script_creationTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
script_name :: Lens.Lens' Script (Prelude.Maybe Prelude.Text)
script_name :: Lens' Script (Maybe Text)
script_name = 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_scriptArn :: Lens.Lens' Script (Prelude.Maybe Prelude.Text)
script_scriptArn :: Lens' Script (Maybe Text)
script_scriptArn = 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_scriptId :: Lens.Lens' Script (Prelude.Maybe Prelude.Text)
script_scriptId :: Lens' Script (Maybe Text)
script_scriptId = 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_sizeOnDisk :: Lens.Lens' Script (Prelude.Maybe Prelude.Natural)
script_sizeOnDisk :: Lens' Script (Maybe Natural)
script_sizeOnDisk = 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)
script_storageLocation :: Lens.Lens' Script (Prelude.Maybe S3Location)
script_storageLocation :: Lens' Script (Maybe S3Location)
script_storageLocation = 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_version :: Lens.Lens' Script (Prelude.Maybe Prelude.Text)
script_version :: Lens' Script (Maybe Text)
script_version = 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)
instance Data.FromJSON Script where
parseJSON :: Value -> Parser Script
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Script"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe S3Location
-> Maybe Text
-> Script
Script'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreationTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ScriptArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ScriptId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SizeOnDisk")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StorageLocation")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Version")
)
instance Prelude.Hashable Script where
hashWithSalt :: Int -> Script -> Int
hashWithSalt Int
_salt Script' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe S3Location
version :: Maybe Text
storageLocation :: Maybe S3Location
sizeOnDisk :: Maybe Natural
scriptId :: Maybe Text
scriptArn :: Maybe Text
name :: Maybe Text
creationTime :: Maybe POSIX
$sel:version:Script' :: Script -> Maybe Text
$sel:storageLocation:Script' :: Script -> Maybe S3Location
$sel:sizeOnDisk:Script' :: Script -> Maybe Natural
$sel:scriptId:Script' :: Script -> Maybe Text
$sel:scriptArn:Script' :: Script -> Maybe Text
$sel:name:Script' :: Script -> Maybe Text
$sel:creationTime:Script' :: Script -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
scriptArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
scriptId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
sizeOnDisk
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3Location
storageLocation
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
version
instance Prelude.NFData Script where
rnf :: Script -> ()
rnf Script' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe S3Location
version :: Maybe Text
storageLocation :: Maybe S3Location
sizeOnDisk :: Maybe Natural
scriptId :: Maybe Text
scriptArn :: Maybe Text
name :: Maybe Text
creationTime :: Maybe POSIX
$sel:version:Script' :: Script -> Maybe Text
$sel:storageLocation:Script' :: Script -> Maybe S3Location
$sel:sizeOnDisk:Script' :: Script -> Maybe Natural
$sel:scriptId:Script' :: Script -> Maybe Text
$sel:scriptArn:Script' :: Script -> Maybe Text
$sel:name:Script' :: Script -> Maybe Text
$sel:creationTime:Script' :: Script -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
scriptArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
scriptId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
sizeOnDisk
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe S3Location
storageLocation
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version