{-# 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.EC2.Types.LaunchTemplateSpotMarketOptions where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.InstanceInterruptionBehavior
import Amazonka.EC2.Types.SpotInstanceType
import qualified Amazonka.Prelude as Prelude
data LaunchTemplateSpotMarketOptions = LaunchTemplateSpotMarketOptions'
{
LaunchTemplateSpotMarketOptions -> Maybe Int
blockDurationMinutes :: Prelude.Maybe Prelude.Int,
LaunchTemplateSpotMarketOptions
-> Maybe InstanceInterruptionBehavior
instanceInterruptionBehavior :: Prelude.Maybe InstanceInterruptionBehavior,
LaunchTemplateSpotMarketOptions -> Maybe Text
maxPrice :: Prelude.Maybe Prelude.Text,
LaunchTemplateSpotMarketOptions -> Maybe SpotInstanceType
spotInstanceType :: Prelude.Maybe SpotInstanceType,
LaunchTemplateSpotMarketOptions -> Maybe ISO8601
validUntil :: Prelude.Maybe Data.ISO8601
}
deriving (LaunchTemplateSpotMarketOptions
-> LaunchTemplateSpotMarketOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LaunchTemplateSpotMarketOptions
-> LaunchTemplateSpotMarketOptions -> Bool
$c/= :: LaunchTemplateSpotMarketOptions
-> LaunchTemplateSpotMarketOptions -> Bool
== :: LaunchTemplateSpotMarketOptions
-> LaunchTemplateSpotMarketOptions -> Bool
$c== :: LaunchTemplateSpotMarketOptions
-> LaunchTemplateSpotMarketOptions -> Bool
Prelude.Eq, ReadPrec [LaunchTemplateSpotMarketOptions]
ReadPrec LaunchTemplateSpotMarketOptions
Int -> ReadS LaunchTemplateSpotMarketOptions
ReadS [LaunchTemplateSpotMarketOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LaunchTemplateSpotMarketOptions]
$creadListPrec :: ReadPrec [LaunchTemplateSpotMarketOptions]
readPrec :: ReadPrec LaunchTemplateSpotMarketOptions
$creadPrec :: ReadPrec LaunchTemplateSpotMarketOptions
readList :: ReadS [LaunchTemplateSpotMarketOptions]
$creadList :: ReadS [LaunchTemplateSpotMarketOptions]
readsPrec :: Int -> ReadS LaunchTemplateSpotMarketOptions
$creadsPrec :: Int -> ReadS LaunchTemplateSpotMarketOptions
Prelude.Read, Int -> LaunchTemplateSpotMarketOptions -> ShowS
[LaunchTemplateSpotMarketOptions] -> ShowS
LaunchTemplateSpotMarketOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LaunchTemplateSpotMarketOptions] -> ShowS
$cshowList :: [LaunchTemplateSpotMarketOptions] -> ShowS
show :: LaunchTemplateSpotMarketOptions -> String
$cshow :: LaunchTemplateSpotMarketOptions -> String
showsPrec :: Int -> LaunchTemplateSpotMarketOptions -> ShowS
$cshowsPrec :: Int -> LaunchTemplateSpotMarketOptions -> ShowS
Prelude.Show, forall x.
Rep LaunchTemplateSpotMarketOptions x
-> LaunchTemplateSpotMarketOptions
forall x.
LaunchTemplateSpotMarketOptions
-> Rep LaunchTemplateSpotMarketOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LaunchTemplateSpotMarketOptions x
-> LaunchTemplateSpotMarketOptions
$cfrom :: forall x.
LaunchTemplateSpotMarketOptions
-> Rep LaunchTemplateSpotMarketOptions x
Prelude.Generic)
newLaunchTemplateSpotMarketOptions ::
LaunchTemplateSpotMarketOptions
newLaunchTemplateSpotMarketOptions :: LaunchTemplateSpotMarketOptions
newLaunchTemplateSpotMarketOptions =
LaunchTemplateSpotMarketOptions'
{ $sel:blockDurationMinutes:LaunchTemplateSpotMarketOptions' :: Maybe Int
blockDurationMinutes =
forall a. Maybe a
Prelude.Nothing,
$sel:instanceInterruptionBehavior:LaunchTemplateSpotMarketOptions' :: Maybe InstanceInterruptionBehavior
instanceInterruptionBehavior =
forall a. Maybe a
Prelude.Nothing,
$sel:maxPrice:LaunchTemplateSpotMarketOptions' :: Maybe Text
maxPrice = forall a. Maybe a
Prelude.Nothing,
$sel:spotInstanceType:LaunchTemplateSpotMarketOptions' :: Maybe SpotInstanceType
spotInstanceType = forall a. Maybe a
Prelude.Nothing,
$sel:validUntil:LaunchTemplateSpotMarketOptions' :: Maybe ISO8601
validUntil = forall a. Maybe a
Prelude.Nothing
}
launchTemplateSpotMarketOptions_blockDurationMinutes :: Lens.Lens' LaunchTemplateSpotMarketOptions (Prelude.Maybe Prelude.Int)
launchTemplateSpotMarketOptions_blockDurationMinutes :: Lens' LaunchTemplateSpotMarketOptions (Maybe Int)
launchTemplateSpotMarketOptions_blockDurationMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchTemplateSpotMarketOptions' {Maybe Int
blockDurationMinutes :: Maybe Int
$sel:blockDurationMinutes:LaunchTemplateSpotMarketOptions' :: LaunchTemplateSpotMarketOptions -> Maybe Int
blockDurationMinutes} -> Maybe Int
blockDurationMinutes) (\s :: LaunchTemplateSpotMarketOptions
s@LaunchTemplateSpotMarketOptions' {} Maybe Int
a -> LaunchTemplateSpotMarketOptions
s {$sel:blockDurationMinutes:LaunchTemplateSpotMarketOptions' :: Maybe Int
blockDurationMinutes = Maybe Int
a} :: LaunchTemplateSpotMarketOptions)
launchTemplateSpotMarketOptions_instanceInterruptionBehavior :: Lens.Lens' LaunchTemplateSpotMarketOptions (Prelude.Maybe InstanceInterruptionBehavior)
launchTemplateSpotMarketOptions_instanceInterruptionBehavior :: Lens'
LaunchTemplateSpotMarketOptions
(Maybe InstanceInterruptionBehavior)
launchTemplateSpotMarketOptions_instanceInterruptionBehavior = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchTemplateSpotMarketOptions' {Maybe InstanceInterruptionBehavior
instanceInterruptionBehavior :: Maybe InstanceInterruptionBehavior
$sel:instanceInterruptionBehavior:LaunchTemplateSpotMarketOptions' :: LaunchTemplateSpotMarketOptions
-> Maybe InstanceInterruptionBehavior
instanceInterruptionBehavior} -> Maybe InstanceInterruptionBehavior
instanceInterruptionBehavior) (\s :: LaunchTemplateSpotMarketOptions
s@LaunchTemplateSpotMarketOptions' {} Maybe InstanceInterruptionBehavior
a -> LaunchTemplateSpotMarketOptions
s {$sel:instanceInterruptionBehavior:LaunchTemplateSpotMarketOptions' :: Maybe InstanceInterruptionBehavior
instanceInterruptionBehavior = Maybe InstanceInterruptionBehavior
a} :: LaunchTemplateSpotMarketOptions)
launchTemplateSpotMarketOptions_maxPrice :: Lens.Lens' LaunchTemplateSpotMarketOptions (Prelude.Maybe Prelude.Text)
launchTemplateSpotMarketOptions_maxPrice :: Lens' LaunchTemplateSpotMarketOptions (Maybe Text)
launchTemplateSpotMarketOptions_maxPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchTemplateSpotMarketOptions' {Maybe Text
maxPrice :: Maybe Text
$sel:maxPrice:LaunchTemplateSpotMarketOptions' :: LaunchTemplateSpotMarketOptions -> Maybe Text
maxPrice} -> Maybe Text
maxPrice) (\s :: LaunchTemplateSpotMarketOptions
s@LaunchTemplateSpotMarketOptions' {} Maybe Text
a -> LaunchTemplateSpotMarketOptions
s {$sel:maxPrice:LaunchTemplateSpotMarketOptions' :: Maybe Text
maxPrice = Maybe Text
a} :: LaunchTemplateSpotMarketOptions)
launchTemplateSpotMarketOptions_spotInstanceType :: Lens.Lens' LaunchTemplateSpotMarketOptions (Prelude.Maybe SpotInstanceType)
launchTemplateSpotMarketOptions_spotInstanceType :: Lens' LaunchTemplateSpotMarketOptions (Maybe SpotInstanceType)
launchTemplateSpotMarketOptions_spotInstanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchTemplateSpotMarketOptions' {Maybe SpotInstanceType
spotInstanceType :: Maybe SpotInstanceType
$sel:spotInstanceType:LaunchTemplateSpotMarketOptions' :: LaunchTemplateSpotMarketOptions -> Maybe SpotInstanceType
spotInstanceType} -> Maybe SpotInstanceType
spotInstanceType) (\s :: LaunchTemplateSpotMarketOptions
s@LaunchTemplateSpotMarketOptions' {} Maybe SpotInstanceType
a -> LaunchTemplateSpotMarketOptions
s {$sel:spotInstanceType:LaunchTemplateSpotMarketOptions' :: Maybe SpotInstanceType
spotInstanceType = Maybe SpotInstanceType
a} :: LaunchTemplateSpotMarketOptions)
launchTemplateSpotMarketOptions_validUntil :: Lens.Lens' LaunchTemplateSpotMarketOptions (Prelude.Maybe Prelude.UTCTime)
launchTemplateSpotMarketOptions_validUntil :: Lens' LaunchTemplateSpotMarketOptions (Maybe UTCTime)
launchTemplateSpotMarketOptions_validUntil = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchTemplateSpotMarketOptions' {Maybe ISO8601
validUntil :: Maybe ISO8601
$sel:validUntil:LaunchTemplateSpotMarketOptions' :: LaunchTemplateSpotMarketOptions -> Maybe ISO8601
validUntil} -> Maybe ISO8601
validUntil) (\s :: LaunchTemplateSpotMarketOptions
s@LaunchTemplateSpotMarketOptions' {} Maybe ISO8601
a -> LaunchTemplateSpotMarketOptions
s {$sel:validUntil:LaunchTemplateSpotMarketOptions' :: Maybe ISO8601
validUntil = Maybe ISO8601
a} :: LaunchTemplateSpotMarketOptions) 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
instance Data.FromXML LaunchTemplateSpotMarketOptions where
parseXML :: [Node] -> Either String LaunchTemplateSpotMarketOptions
parseXML [Node]
x =
Maybe Int
-> Maybe InstanceInterruptionBehavior
-> Maybe Text
-> Maybe SpotInstanceType
-> Maybe ISO8601
-> LaunchTemplateSpotMarketOptions
LaunchTemplateSpotMarketOptions'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"blockDurationMinutes")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"instanceInterruptionBehavior")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"maxPrice")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"spotInstanceType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"validUntil")
instance
Prelude.Hashable
LaunchTemplateSpotMarketOptions
where
hashWithSalt :: Int -> LaunchTemplateSpotMarketOptions -> Int
hashWithSalt
Int
_salt
LaunchTemplateSpotMarketOptions' {Maybe Int
Maybe Text
Maybe ISO8601
Maybe InstanceInterruptionBehavior
Maybe SpotInstanceType
validUntil :: Maybe ISO8601
spotInstanceType :: Maybe SpotInstanceType
maxPrice :: Maybe Text
instanceInterruptionBehavior :: Maybe InstanceInterruptionBehavior
blockDurationMinutes :: Maybe Int
$sel:validUntil:LaunchTemplateSpotMarketOptions' :: LaunchTemplateSpotMarketOptions -> Maybe ISO8601
$sel:spotInstanceType:LaunchTemplateSpotMarketOptions' :: LaunchTemplateSpotMarketOptions -> Maybe SpotInstanceType
$sel:maxPrice:LaunchTemplateSpotMarketOptions' :: LaunchTemplateSpotMarketOptions -> Maybe Text
$sel:instanceInterruptionBehavior:LaunchTemplateSpotMarketOptions' :: LaunchTemplateSpotMarketOptions
-> Maybe InstanceInterruptionBehavior
$sel:blockDurationMinutes:LaunchTemplateSpotMarketOptions' :: LaunchTemplateSpotMarketOptions -> Maybe Int
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
blockDurationMinutes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceInterruptionBehavior
instanceInterruptionBehavior
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maxPrice
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SpotInstanceType
spotInstanceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
validUntil
instance
Prelude.NFData
LaunchTemplateSpotMarketOptions
where
rnf :: LaunchTemplateSpotMarketOptions -> ()
rnf LaunchTemplateSpotMarketOptions' {Maybe Int
Maybe Text
Maybe ISO8601
Maybe InstanceInterruptionBehavior
Maybe SpotInstanceType
validUntil :: Maybe ISO8601
spotInstanceType :: Maybe SpotInstanceType
maxPrice :: Maybe Text
instanceInterruptionBehavior :: Maybe InstanceInterruptionBehavior
blockDurationMinutes :: Maybe Int
$sel:validUntil:LaunchTemplateSpotMarketOptions' :: LaunchTemplateSpotMarketOptions -> Maybe ISO8601
$sel:spotInstanceType:LaunchTemplateSpotMarketOptions' :: LaunchTemplateSpotMarketOptions -> Maybe SpotInstanceType
$sel:maxPrice:LaunchTemplateSpotMarketOptions' :: LaunchTemplateSpotMarketOptions -> Maybe Text
$sel:instanceInterruptionBehavior:LaunchTemplateSpotMarketOptions' :: LaunchTemplateSpotMarketOptions
-> Maybe InstanceInterruptionBehavior
$sel:blockDurationMinutes:LaunchTemplateSpotMarketOptions' :: LaunchTemplateSpotMarketOptions -> Maybe Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
blockDurationMinutes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceInterruptionBehavior
instanceInterruptionBehavior
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
maxPrice
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SpotInstanceType
spotInstanceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
validUntil