{-# 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.AppStream.Types.AppBlock where
import Amazonka.AppStream.Types.S3Location
import Amazonka.AppStream.Types.ScriptDetails
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data AppBlock = AppBlock'
{
AppBlock -> Maybe POSIX
createdTime :: Prelude.Maybe Data.POSIX,
AppBlock -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
AppBlock -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
AppBlock -> Maybe S3Location
sourceS3Location :: Prelude.Maybe S3Location,
AppBlock -> Text
name :: Prelude.Text,
AppBlock -> Text
arn :: Prelude.Text,
AppBlock -> ScriptDetails
setupScriptDetails :: ScriptDetails
}
deriving (AppBlock -> AppBlock -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AppBlock -> AppBlock -> Bool
$c/= :: AppBlock -> AppBlock -> Bool
== :: AppBlock -> AppBlock -> Bool
$c== :: AppBlock -> AppBlock -> Bool
Prelude.Eq, ReadPrec [AppBlock]
ReadPrec AppBlock
Int -> ReadS AppBlock
ReadS [AppBlock]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AppBlock]
$creadListPrec :: ReadPrec [AppBlock]
readPrec :: ReadPrec AppBlock
$creadPrec :: ReadPrec AppBlock
readList :: ReadS [AppBlock]
$creadList :: ReadS [AppBlock]
readsPrec :: Int -> ReadS AppBlock
$creadsPrec :: Int -> ReadS AppBlock
Prelude.Read, Int -> AppBlock -> ShowS
[AppBlock] -> ShowS
AppBlock -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AppBlock] -> ShowS
$cshowList :: [AppBlock] -> ShowS
show :: AppBlock -> String
$cshow :: AppBlock -> String
showsPrec :: Int -> AppBlock -> ShowS
$cshowsPrec :: Int -> AppBlock -> ShowS
Prelude.Show, forall x. Rep AppBlock x -> AppBlock
forall x. AppBlock -> Rep AppBlock x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AppBlock x -> AppBlock
$cfrom :: forall x. AppBlock -> Rep AppBlock x
Prelude.Generic)
newAppBlock ::
Prelude.Text ->
Prelude.Text ->
ScriptDetails ->
AppBlock
newAppBlock :: Text -> Text -> ScriptDetails -> AppBlock
newAppBlock Text
pName_ Text
pArn_ ScriptDetails
pSetupScriptDetails_ =
AppBlock'
{ $sel:createdTime:AppBlock' :: Maybe POSIX
createdTime = forall a. Maybe a
Prelude.Nothing,
$sel:description:AppBlock' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:displayName:AppBlock' :: Maybe Text
displayName = forall a. Maybe a
Prelude.Nothing,
$sel:sourceS3Location:AppBlock' :: Maybe S3Location
sourceS3Location = forall a. Maybe a
Prelude.Nothing,
$sel:name:AppBlock' :: Text
name = Text
pName_,
$sel:arn:AppBlock' :: Text
arn = Text
pArn_,
$sel:setupScriptDetails:AppBlock' :: ScriptDetails
setupScriptDetails = ScriptDetails
pSetupScriptDetails_
}
appBlock_createdTime :: Lens.Lens' AppBlock (Prelude.Maybe Prelude.UTCTime)
appBlock_createdTime :: Lens' AppBlock (Maybe UTCTime)
appBlock_createdTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppBlock' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:AppBlock' :: AppBlock -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: AppBlock
s@AppBlock' {} Maybe POSIX
a -> AppBlock
s {$sel:createdTime:AppBlock' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: AppBlock) 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
appBlock_description :: Lens.Lens' AppBlock (Prelude.Maybe Prelude.Text)
appBlock_description :: Lens' AppBlock (Maybe Text)
appBlock_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppBlock' {Maybe Text
description :: Maybe Text
$sel:description:AppBlock' :: AppBlock -> Maybe Text
description} -> Maybe Text
description) (\s :: AppBlock
s@AppBlock' {} Maybe Text
a -> AppBlock
s {$sel:description:AppBlock' :: Maybe Text
description = Maybe Text
a} :: AppBlock)
appBlock_displayName :: Lens.Lens' AppBlock (Prelude.Maybe Prelude.Text)
appBlock_displayName :: Lens' AppBlock (Maybe Text)
appBlock_displayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppBlock' {Maybe Text
displayName :: Maybe Text
$sel:displayName:AppBlock' :: AppBlock -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: AppBlock
s@AppBlock' {} Maybe Text
a -> AppBlock
s {$sel:displayName:AppBlock' :: Maybe Text
displayName = Maybe Text
a} :: AppBlock)
appBlock_sourceS3Location :: Lens.Lens' AppBlock (Prelude.Maybe S3Location)
appBlock_sourceS3Location :: Lens' AppBlock (Maybe S3Location)
appBlock_sourceS3Location = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppBlock' {Maybe S3Location
sourceS3Location :: Maybe S3Location
$sel:sourceS3Location:AppBlock' :: AppBlock -> Maybe S3Location
sourceS3Location} -> Maybe S3Location
sourceS3Location) (\s :: AppBlock
s@AppBlock' {} Maybe S3Location
a -> AppBlock
s {$sel:sourceS3Location:AppBlock' :: Maybe S3Location
sourceS3Location = Maybe S3Location
a} :: AppBlock)
appBlock_name :: Lens.Lens' AppBlock Prelude.Text
appBlock_name :: Lens' AppBlock Text
appBlock_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppBlock' {Text
name :: Text
$sel:name:AppBlock' :: AppBlock -> Text
name} -> Text
name) (\s :: AppBlock
s@AppBlock' {} Text
a -> AppBlock
s {$sel:name:AppBlock' :: Text
name = Text
a} :: AppBlock)
appBlock_arn :: Lens.Lens' AppBlock Prelude.Text
appBlock_arn :: Lens' AppBlock Text
appBlock_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppBlock' {Text
arn :: Text
$sel:arn:AppBlock' :: AppBlock -> Text
arn} -> Text
arn) (\s :: AppBlock
s@AppBlock' {} Text
a -> AppBlock
s {$sel:arn:AppBlock' :: Text
arn = Text
a} :: AppBlock)
appBlock_setupScriptDetails :: Lens.Lens' AppBlock ScriptDetails
appBlock_setupScriptDetails :: Lens' AppBlock ScriptDetails
appBlock_setupScriptDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppBlock' {ScriptDetails
setupScriptDetails :: ScriptDetails
$sel:setupScriptDetails:AppBlock' :: AppBlock -> ScriptDetails
setupScriptDetails} -> ScriptDetails
setupScriptDetails) (\s :: AppBlock
s@AppBlock' {} ScriptDetails
a -> AppBlock
s {$sel:setupScriptDetails:AppBlock' :: ScriptDetails
setupScriptDetails = ScriptDetails
a} :: AppBlock)
instance Data.FromJSON AppBlock where
parseJSON :: Value -> Parser AppBlock
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AppBlock"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe S3Location
-> Text
-> Text
-> ScriptDetails
-> AppBlock
AppBlock'
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
"CreatedTime")
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
"Description")
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
"DisplayName")
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
"SourceS3Location")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser 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 a
Data..: Key
"Arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"SetupScriptDetails")
)
instance Prelude.Hashable AppBlock where
hashWithSalt :: Int -> AppBlock -> Int
hashWithSalt Int
_salt AppBlock' {Maybe Text
Maybe POSIX
Maybe S3Location
Text
ScriptDetails
setupScriptDetails :: ScriptDetails
arn :: Text
name :: Text
sourceS3Location :: Maybe S3Location
displayName :: Maybe Text
description :: Maybe Text
createdTime :: Maybe POSIX
$sel:setupScriptDetails:AppBlock' :: AppBlock -> ScriptDetails
$sel:arn:AppBlock' :: AppBlock -> Text
$sel:name:AppBlock' :: AppBlock -> Text
$sel:sourceS3Location:AppBlock' :: AppBlock -> Maybe S3Location
$sel:displayName:AppBlock' :: AppBlock -> Maybe Text
$sel:description:AppBlock' :: AppBlock -> Maybe Text
$sel:createdTime:AppBlock' :: AppBlock -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
displayName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3Location
sourceS3Location
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ScriptDetails
setupScriptDetails
instance Prelude.NFData AppBlock where
rnf :: AppBlock -> ()
rnf AppBlock' {Maybe Text
Maybe POSIX
Maybe S3Location
Text
ScriptDetails
setupScriptDetails :: ScriptDetails
arn :: Text
name :: Text
sourceS3Location :: Maybe S3Location
displayName :: Maybe Text
description :: Maybe Text
createdTime :: Maybe POSIX
$sel:setupScriptDetails:AppBlock' :: AppBlock -> ScriptDetails
$sel:arn:AppBlock' :: AppBlock -> Text
$sel:name:AppBlock' :: AppBlock -> Text
$sel:sourceS3Location:AppBlock' :: AppBlock -> Maybe S3Location
$sel:displayName:AppBlock' :: AppBlock -> Maybe Text
$sel:description:AppBlock' :: AppBlock -> Maybe Text
$sel:createdTime:AppBlock' :: AppBlock -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
displayName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe S3Location
sourceS3Location
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ScriptDetails
setupScriptDetails