{-# 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.ImageBuilder.Types.FastLaunchConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ImageBuilder.Types.FastLaunchLaunchTemplateSpecification
import Amazonka.ImageBuilder.Types.FastLaunchSnapshotConfiguration
import qualified Amazonka.Prelude as Prelude
data FastLaunchConfiguration = FastLaunchConfiguration'
{
FastLaunchConfiguration -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
FastLaunchConfiguration
-> Maybe FastLaunchLaunchTemplateSpecification
launchTemplate :: Prelude.Maybe FastLaunchLaunchTemplateSpecification,
FastLaunchConfiguration -> Maybe Natural
maxParallelLaunches :: Prelude.Maybe Prelude.Natural,
FastLaunchConfiguration -> Maybe FastLaunchSnapshotConfiguration
snapshotConfiguration :: Prelude.Maybe FastLaunchSnapshotConfiguration,
FastLaunchConfiguration -> Bool
enabled :: Prelude.Bool
}
deriving (FastLaunchConfiguration -> FastLaunchConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FastLaunchConfiguration -> FastLaunchConfiguration -> Bool
$c/= :: FastLaunchConfiguration -> FastLaunchConfiguration -> Bool
== :: FastLaunchConfiguration -> FastLaunchConfiguration -> Bool
$c== :: FastLaunchConfiguration -> FastLaunchConfiguration -> Bool
Prelude.Eq, ReadPrec [FastLaunchConfiguration]
ReadPrec FastLaunchConfiguration
Int -> ReadS FastLaunchConfiguration
ReadS [FastLaunchConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FastLaunchConfiguration]
$creadListPrec :: ReadPrec [FastLaunchConfiguration]
readPrec :: ReadPrec FastLaunchConfiguration
$creadPrec :: ReadPrec FastLaunchConfiguration
readList :: ReadS [FastLaunchConfiguration]
$creadList :: ReadS [FastLaunchConfiguration]
readsPrec :: Int -> ReadS FastLaunchConfiguration
$creadsPrec :: Int -> ReadS FastLaunchConfiguration
Prelude.Read, Int -> FastLaunchConfiguration -> ShowS
[FastLaunchConfiguration] -> ShowS
FastLaunchConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FastLaunchConfiguration] -> ShowS
$cshowList :: [FastLaunchConfiguration] -> ShowS
show :: FastLaunchConfiguration -> String
$cshow :: FastLaunchConfiguration -> String
showsPrec :: Int -> FastLaunchConfiguration -> ShowS
$cshowsPrec :: Int -> FastLaunchConfiguration -> ShowS
Prelude.Show, forall x. Rep FastLaunchConfiguration x -> FastLaunchConfiguration
forall x. FastLaunchConfiguration -> Rep FastLaunchConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FastLaunchConfiguration x -> FastLaunchConfiguration
$cfrom :: forall x. FastLaunchConfiguration -> Rep FastLaunchConfiguration x
Prelude.Generic)
newFastLaunchConfiguration ::
Prelude.Bool ->
FastLaunchConfiguration
newFastLaunchConfiguration :: Bool -> FastLaunchConfiguration
newFastLaunchConfiguration Bool
pEnabled_ =
FastLaunchConfiguration'
{ $sel:accountId:FastLaunchConfiguration' :: Maybe Text
accountId =
forall a. Maybe a
Prelude.Nothing,
$sel:launchTemplate:FastLaunchConfiguration' :: Maybe FastLaunchLaunchTemplateSpecification
launchTemplate = forall a. Maybe a
Prelude.Nothing,
$sel:maxParallelLaunches:FastLaunchConfiguration' :: Maybe Natural
maxParallelLaunches = forall a. Maybe a
Prelude.Nothing,
$sel:snapshotConfiguration:FastLaunchConfiguration' :: Maybe FastLaunchSnapshotConfiguration
snapshotConfiguration = forall a. Maybe a
Prelude.Nothing,
$sel:enabled:FastLaunchConfiguration' :: Bool
enabled = Bool
pEnabled_
}
fastLaunchConfiguration_accountId :: Lens.Lens' FastLaunchConfiguration (Prelude.Maybe Prelude.Text)
fastLaunchConfiguration_accountId :: Lens' FastLaunchConfiguration (Maybe Text)
fastLaunchConfiguration_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FastLaunchConfiguration' {Maybe Text
accountId :: Maybe Text
$sel:accountId:FastLaunchConfiguration' :: FastLaunchConfiguration -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: FastLaunchConfiguration
s@FastLaunchConfiguration' {} Maybe Text
a -> FastLaunchConfiguration
s {$sel:accountId:FastLaunchConfiguration' :: Maybe Text
accountId = Maybe Text
a} :: FastLaunchConfiguration)
fastLaunchConfiguration_launchTemplate :: Lens.Lens' FastLaunchConfiguration (Prelude.Maybe FastLaunchLaunchTemplateSpecification)
fastLaunchConfiguration_launchTemplate :: Lens'
FastLaunchConfiguration
(Maybe FastLaunchLaunchTemplateSpecification)
fastLaunchConfiguration_launchTemplate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FastLaunchConfiguration' {Maybe FastLaunchLaunchTemplateSpecification
launchTemplate :: Maybe FastLaunchLaunchTemplateSpecification
$sel:launchTemplate:FastLaunchConfiguration' :: FastLaunchConfiguration
-> Maybe FastLaunchLaunchTemplateSpecification
launchTemplate} -> Maybe FastLaunchLaunchTemplateSpecification
launchTemplate) (\s :: FastLaunchConfiguration
s@FastLaunchConfiguration' {} Maybe FastLaunchLaunchTemplateSpecification
a -> FastLaunchConfiguration
s {$sel:launchTemplate:FastLaunchConfiguration' :: Maybe FastLaunchLaunchTemplateSpecification
launchTemplate = Maybe FastLaunchLaunchTemplateSpecification
a} :: FastLaunchConfiguration)
fastLaunchConfiguration_maxParallelLaunches :: Lens.Lens' FastLaunchConfiguration (Prelude.Maybe Prelude.Natural)
fastLaunchConfiguration_maxParallelLaunches :: Lens' FastLaunchConfiguration (Maybe Natural)
fastLaunchConfiguration_maxParallelLaunches = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FastLaunchConfiguration' {Maybe Natural
maxParallelLaunches :: Maybe Natural
$sel:maxParallelLaunches:FastLaunchConfiguration' :: FastLaunchConfiguration -> Maybe Natural
maxParallelLaunches} -> Maybe Natural
maxParallelLaunches) (\s :: FastLaunchConfiguration
s@FastLaunchConfiguration' {} Maybe Natural
a -> FastLaunchConfiguration
s {$sel:maxParallelLaunches:FastLaunchConfiguration' :: Maybe Natural
maxParallelLaunches = Maybe Natural
a} :: FastLaunchConfiguration)
fastLaunchConfiguration_snapshotConfiguration :: Lens.Lens' FastLaunchConfiguration (Prelude.Maybe FastLaunchSnapshotConfiguration)
fastLaunchConfiguration_snapshotConfiguration :: Lens'
FastLaunchConfiguration (Maybe FastLaunchSnapshotConfiguration)
fastLaunchConfiguration_snapshotConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FastLaunchConfiguration' {Maybe FastLaunchSnapshotConfiguration
snapshotConfiguration :: Maybe FastLaunchSnapshotConfiguration
$sel:snapshotConfiguration:FastLaunchConfiguration' :: FastLaunchConfiguration -> Maybe FastLaunchSnapshotConfiguration
snapshotConfiguration} -> Maybe FastLaunchSnapshotConfiguration
snapshotConfiguration) (\s :: FastLaunchConfiguration
s@FastLaunchConfiguration' {} Maybe FastLaunchSnapshotConfiguration
a -> FastLaunchConfiguration
s {$sel:snapshotConfiguration:FastLaunchConfiguration' :: Maybe FastLaunchSnapshotConfiguration
snapshotConfiguration = Maybe FastLaunchSnapshotConfiguration
a} :: FastLaunchConfiguration)
fastLaunchConfiguration_enabled :: Lens.Lens' FastLaunchConfiguration Prelude.Bool
fastLaunchConfiguration_enabled :: Lens' FastLaunchConfiguration Bool
fastLaunchConfiguration_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FastLaunchConfiguration' {Bool
enabled :: Bool
$sel:enabled:FastLaunchConfiguration' :: FastLaunchConfiguration -> Bool
enabled} -> Bool
enabled) (\s :: FastLaunchConfiguration
s@FastLaunchConfiguration' {} Bool
a -> FastLaunchConfiguration
s {$sel:enabled:FastLaunchConfiguration' :: Bool
enabled = Bool
a} :: FastLaunchConfiguration)
instance Data.FromJSON FastLaunchConfiguration where
parseJSON :: Value -> Parser FastLaunchConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"FastLaunchConfiguration"
( \Object
x ->
Maybe Text
-> Maybe FastLaunchLaunchTemplateSpecification
-> Maybe Natural
-> Maybe FastLaunchSnapshotConfiguration
-> Bool
-> FastLaunchConfiguration
FastLaunchConfiguration'
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
"accountId")
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
"launchTemplate")
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
"maxParallelLaunches")
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
"snapshotConfiguration")
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
"enabled")
)
instance Prelude.Hashable FastLaunchConfiguration where
hashWithSalt :: Int -> FastLaunchConfiguration -> Int
hashWithSalt Int
_salt FastLaunchConfiguration' {Bool
Maybe Natural
Maybe Text
Maybe FastLaunchLaunchTemplateSpecification
Maybe FastLaunchSnapshotConfiguration
enabled :: Bool
snapshotConfiguration :: Maybe FastLaunchSnapshotConfiguration
maxParallelLaunches :: Maybe Natural
launchTemplate :: Maybe FastLaunchLaunchTemplateSpecification
accountId :: Maybe Text
$sel:enabled:FastLaunchConfiguration' :: FastLaunchConfiguration -> Bool
$sel:snapshotConfiguration:FastLaunchConfiguration' :: FastLaunchConfiguration -> Maybe FastLaunchSnapshotConfiguration
$sel:maxParallelLaunches:FastLaunchConfiguration' :: FastLaunchConfiguration -> Maybe Natural
$sel:launchTemplate:FastLaunchConfiguration' :: FastLaunchConfiguration
-> Maybe FastLaunchLaunchTemplateSpecification
$sel:accountId:FastLaunchConfiguration' :: FastLaunchConfiguration -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accountId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FastLaunchLaunchTemplateSpecification
launchTemplate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxParallelLaunches
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FastLaunchSnapshotConfiguration
snapshotConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
enabled
instance Prelude.NFData FastLaunchConfiguration where
rnf :: FastLaunchConfiguration -> ()
rnf FastLaunchConfiguration' {Bool
Maybe Natural
Maybe Text
Maybe FastLaunchLaunchTemplateSpecification
Maybe FastLaunchSnapshotConfiguration
enabled :: Bool
snapshotConfiguration :: Maybe FastLaunchSnapshotConfiguration
maxParallelLaunches :: Maybe Natural
launchTemplate :: Maybe FastLaunchLaunchTemplateSpecification
accountId :: Maybe Text
$sel:enabled:FastLaunchConfiguration' :: FastLaunchConfiguration -> Bool
$sel:snapshotConfiguration:FastLaunchConfiguration' :: FastLaunchConfiguration -> Maybe FastLaunchSnapshotConfiguration
$sel:maxParallelLaunches:FastLaunchConfiguration' :: FastLaunchConfiguration -> Maybe Natural
$sel:launchTemplate:FastLaunchConfiguration' :: FastLaunchConfiguration
-> Maybe FastLaunchLaunchTemplateSpecification
$sel:accountId:FastLaunchConfiguration' :: FastLaunchConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accountId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FastLaunchLaunchTemplateSpecification
launchTemplate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxParallelLaunches
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FastLaunchSnapshotConfiguration
snapshotConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
enabled
instance Data.ToJSON FastLaunchConfiguration where
toJSON :: FastLaunchConfiguration -> Value
toJSON FastLaunchConfiguration' {Bool
Maybe Natural
Maybe Text
Maybe FastLaunchLaunchTemplateSpecification
Maybe FastLaunchSnapshotConfiguration
enabled :: Bool
snapshotConfiguration :: Maybe FastLaunchSnapshotConfiguration
maxParallelLaunches :: Maybe Natural
launchTemplate :: Maybe FastLaunchLaunchTemplateSpecification
accountId :: Maybe Text
$sel:enabled:FastLaunchConfiguration' :: FastLaunchConfiguration -> Bool
$sel:snapshotConfiguration:FastLaunchConfiguration' :: FastLaunchConfiguration -> Maybe FastLaunchSnapshotConfiguration
$sel:maxParallelLaunches:FastLaunchConfiguration' :: FastLaunchConfiguration -> Maybe Natural
$sel:launchTemplate:FastLaunchConfiguration' :: FastLaunchConfiguration
-> Maybe FastLaunchLaunchTemplateSpecification
$sel:accountId:FastLaunchConfiguration' :: FastLaunchConfiguration -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"accountId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
accountId,
(Key
"launchTemplate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FastLaunchLaunchTemplateSpecification
launchTemplate,
(Key
"maxParallelLaunches" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxParallelLaunches,
(Key
"snapshotConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FastLaunchSnapshotConfiguration
snapshotConfiguration,
forall a. a -> Maybe a
Prelude.Just (Key
"enabled" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Bool
enabled)
]
)