{-# 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.Build where
import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types.BuildStatus
import Amazonka.GameLift.Types.OperatingSystem
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Build = Build'
{
Build -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
Build -> Maybe BuildStatus
status :: Prelude.Maybe BuildStatus,
Build -> Maybe OperatingSystem
operatingSystem :: Prelude.Maybe OperatingSystem,
Build -> Maybe Text
buildId :: Prelude.Maybe Prelude.Text,
Build -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Build -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
Build -> Maybe Text
buildArn :: Prelude.Maybe Prelude.Text,
Build -> Maybe Natural
sizeOnDisk :: Prelude.Maybe Prelude.Natural
}
deriving (Build -> Build -> Bool
(Build -> Build -> Bool) -> (Build -> Build -> Bool) -> Eq Build
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Build -> Build -> Bool
$c/= :: Build -> Build -> Bool
== :: Build -> Build -> Bool
$c== :: Build -> Build -> Bool
Prelude.Eq, ReadPrec [Build]
ReadPrec Build
Int -> ReadS Build
ReadS [Build]
(Int -> ReadS Build)
-> ReadS [Build]
-> ReadPrec Build
-> ReadPrec [Build]
-> Read Build
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Build]
$creadListPrec :: ReadPrec [Build]
readPrec :: ReadPrec Build
$creadPrec :: ReadPrec Build
readList :: ReadS [Build]
$creadList :: ReadS [Build]
readsPrec :: Int -> ReadS Build
$creadsPrec :: Int -> ReadS Build
Prelude.Read, Int -> Build -> ShowS
[Build] -> ShowS
Build -> String
(Int -> Build -> ShowS)
-> (Build -> String) -> ([Build] -> ShowS) -> Show Build
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Build] -> ShowS
$cshowList :: [Build] -> ShowS
show :: Build -> String
$cshow :: Build -> String
showsPrec :: Int -> Build -> ShowS
$cshowsPrec :: Int -> Build -> ShowS
Prelude.Show, (forall x. Build -> Rep Build x)
-> (forall x. Rep Build x -> Build) -> Generic Build
forall x. Rep Build x -> Build
forall x. Build -> Rep Build x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Build x -> Build
$cfrom :: forall x. Build -> Rep Build x
Prelude.Generic)
newBuild ::
Build
newBuild :: Build
newBuild =
Build' :: Maybe POSIX
-> Maybe BuildStatus
-> Maybe OperatingSystem
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Build
Build'
{ $sel:creationTime:Build' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:status:Build' :: Maybe BuildStatus
status = Maybe BuildStatus
forall a. Maybe a
Prelude.Nothing,
$sel:operatingSystem:Build' :: Maybe OperatingSystem
operatingSystem = Maybe OperatingSystem
forall a. Maybe a
Prelude.Nothing,
$sel:buildId:Build' :: Maybe Text
buildId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:Build' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:version:Build' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:buildArn:Build' :: Maybe Text
buildArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sizeOnDisk:Build' :: Maybe Natural
sizeOnDisk = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
build_creationTime :: Lens.Lens' Build (Prelude.Maybe Prelude.UTCTime)
build_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Build -> f Build
build_creationTime = (Build -> Maybe POSIX)
-> (Build -> Maybe POSIX -> Build)
-> Lens Build Build (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Build' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:Build' :: Build -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: Build
s@Build' {} Maybe POSIX
a -> Build
s {$sel:creationTime:Build' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: Build) ((Maybe POSIX -> f (Maybe POSIX)) -> Build -> f Build)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Build
-> f Build
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
build_status :: Lens.Lens' Build (Prelude.Maybe BuildStatus)
build_status :: (Maybe BuildStatus -> f (Maybe BuildStatus)) -> Build -> f Build
build_status = (Build -> Maybe BuildStatus)
-> (Build -> Maybe BuildStatus -> Build)
-> Lens Build Build (Maybe BuildStatus) (Maybe BuildStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Build' {Maybe BuildStatus
status :: Maybe BuildStatus
$sel:status:Build' :: Build -> Maybe BuildStatus
status} -> Maybe BuildStatus
status) (\s :: Build
s@Build' {} Maybe BuildStatus
a -> Build
s {$sel:status:Build' :: Maybe BuildStatus
status = Maybe BuildStatus
a} :: Build)
build_operatingSystem :: Lens.Lens' Build (Prelude.Maybe OperatingSystem)
build_operatingSystem :: (Maybe OperatingSystem -> f (Maybe OperatingSystem))
-> Build -> f Build
build_operatingSystem = (Build -> Maybe OperatingSystem)
-> (Build -> Maybe OperatingSystem -> Build)
-> Lens Build Build (Maybe OperatingSystem) (Maybe OperatingSystem)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Build' {Maybe OperatingSystem
operatingSystem :: Maybe OperatingSystem
$sel:operatingSystem:Build' :: Build -> Maybe OperatingSystem
operatingSystem} -> Maybe OperatingSystem
operatingSystem) (\s :: Build
s@Build' {} Maybe OperatingSystem
a -> Build
s {$sel:operatingSystem:Build' :: Maybe OperatingSystem
operatingSystem = Maybe OperatingSystem
a} :: Build)
build_buildId :: Lens.Lens' Build (Prelude.Maybe Prelude.Text)
build_buildId :: (Maybe Text -> f (Maybe Text)) -> Build -> f Build
build_buildId = (Build -> Maybe Text)
-> (Build -> Maybe Text -> Build)
-> Lens Build Build (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Build' {Maybe Text
buildId :: Maybe Text
$sel:buildId:Build' :: Build -> Maybe Text
buildId} -> Maybe Text
buildId) (\s :: Build
s@Build' {} Maybe Text
a -> Build
s {$sel:buildId:Build' :: Maybe Text
buildId = Maybe Text
a} :: Build)
build_name :: Lens.Lens' Build (Prelude.Maybe Prelude.Text)
build_name :: (Maybe Text -> f (Maybe Text)) -> Build -> f Build
build_name = (Build -> Maybe Text)
-> (Build -> Maybe Text -> Build)
-> Lens Build Build (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Build' {Maybe Text
name :: Maybe Text
$sel:name:Build' :: Build -> Maybe Text
name} -> Maybe Text
name) (\s :: Build
s@Build' {} Maybe Text
a -> Build
s {$sel:name:Build' :: Maybe Text
name = Maybe Text
a} :: Build)
build_version :: Lens.Lens' Build (Prelude.Maybe Prelude.Text)
build_version :: (Maybe Text -> f (Maybe Text)) -> Build -> f Build
build_version = (Build -> Maybe Text)
-> (Build -> Maybe Text -> Build)
-> Lens Build Build (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Build' {Maybe Text
version :: Maybe Text
$sel:version:Build' :: Build -> Maybe Text
version} -> Maybe Text
version) (\s :: Build
s@Build' {} Maybe Text
a -> Build
s {$sel:version:Build' :: Maybe Text
version = Maybe Text
a} :: Build)
build_buildArn :: Lens.Lens' Build (Prelude.Maybe Prelude.Text)
build_buildArn :: (Maybe Text -> f (Maybe Text)) -> Build -> f Build
build_buildArn = (Build -> Maybe Text)
-> (Build -> Maybe Text -> Build)
-> Lens Build Build (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Build' {Maybe Text
buildArn :: Maybe Text
$sel:buildArn:Build' :: Build -> Maybe Text
buildArn} -> Maybe Text
buildArn) (\s :: Build
s@Build' {} Maybe Text
a -> Build
s {$sel:buildArn:Build' :: Maybe Text
buildArn = Maybe Text
a} :: Build)
build_sizeOnDisk :: Lens.Lens' Build (Prelude.Maybe Prelude.Natural)
build_sizeOnDisk :: (Maybe Natural -> f (Maybe Natural)) -> Build -> f Build
build_sizeOnDisk = (Build -> Maybe Natural)
-> (Build -> Maybe Natural -> Build)
-> Lens Build Build (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Build' {Maybe Natural
sizeOnDisk :: Maybe Natural
$sel:sizeOnDisk:Build' :: Build -> Maybe Natural
sizeOnDisk} -> Maybe Natural
sizeOnDisk) (\s :: Build
s@Build' {} Maybe Natural
a -> Build
s {$sel:sizeOnDisk:Build' :: Maybe Natural
sizeOnDisk = Maybe Natural
a} :: Build)
instance Core.FromJSON Build where
parseJSON :: Value -> Parser Build
parseJSON =
String -> (Object -> Parser Build) -> Value -> Parser Build
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Build"
( \Object
x ->
Maybe POSIX
-> Maybe BuildStatus
-> Maybe OperatingSystem
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Build
Build'
(Maybe POSIX
-> Maybe BuildStatus
-> Maybe OperatingSystem
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Build)
-> Parser (Maybe POSIX)
-> Parser
(Maybe BuildStatus
-> Maybe OperatingSystem
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Build)
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 BuildStatus
-> Maybe OperatingSystem
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Build)
-> Parser (Maybe BuildStatus)
-> Parser
(Maybe OperatingSystem
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Build)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BuildStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe OperatingSystem
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Build)
-> Parser (Maybe OperatingSystem)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Build)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OperatingSystem)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OperatingSystem")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Build)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Natural -> Build)
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
"BuildId")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Natural -> Build)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Natural -> Build)
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 Natural -> Build)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Natural -> Build)
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 -> Build)
-> Parser (Maybe Text) -> Parser (Maybe Natural -> Build)
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
"BuildArn")
Parser (Maybe Natural -> Build)
-> Parser (Maybe Natural) -> Parser Build
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 Build
instance Prelude.NFData Build