{-# 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.SpotOptionsRequest 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.FleetSpotMaintenanceStrategiesRequest
import Amazonka.EC2.Types.SpotAllocationStrategy
import Amazonka.EC2.Types.SpotInstanceInterruptionBehavior
import qualified Amazonka.Prelude as Prelude
data SpotOptionsRequest = SpotOptionsRequest'
{
SpotOptionsRequest -> Maybe SpotAllocationStrategy
allocationStrategy :: Prelude.Maybe SpotAllocationStrategy,
SpotOptionsRequest -> Maybe SpotInstanceInterruptionBehavior
instanceInterruptionBehavior :: Prelude.Maybe SpotInstanceInterruptionBehavior,
SpotOptionsRequest -> Maybe Int
instancePoolsToUseCount :: Prelude.Maybe Prelude.Int,
SpotOptionsRequest -> Maybe FleetSpotMaintenanceStrategiesRequest
maintenanceStrategies :: Prelude.Maybe FleetSpotMaintenanceStrategiesRequest,
SpotOptionsRequest -> Maybe Text
maxTotalPrice :: Prelude.Maybe Prelude.Text,
SpotOptionsRequest -> Maybe Int
minTargetCapacity :: Prelude.Maybe Prelude.Int,
SpotOptionsRequest -> Maybe Bool
singleAvailabilityZone :: Prelude.Maybe Prelude.Bool,
SpotOptionsRequest -> Maybe Bool
singleInstanceType :: Prelude.Maybe Prelude.Bool
}
deriving (SpotOptionsRequest -> SpotOptionsRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SpotOptionsRequest -> SpotOptionsRequest -> Bool
$c/= :: SpotOptionsRequest -> SpotOptionsRequest -> Bool
== :: SpotOptionsRequest -> SpotOptionsRequest -> Bool
$c== :: SpotOptionsRequest -> SpotOptionsRequest -> Bool
Prelude.Eq, ReadPrec [SpotOptionsRequest]
ReadPrec SpotOptionsRequest
Int -> ReadS SpotOptionsRequest
ReadS [SpotOptionsRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SpotOptionsRequest]
$creadListPrec :: ReadPrec [SpotOptionsRequest]
readPrec :: ReadPrec SpotOptionsRequest
$creadPrec :: ReadPrec SpotOptionsRequest
readList :: ReadS [SpotOptionsRequest]
$creadList :: ReadS [SpotOptionsRequest]
readsPrec :: Int -> ReadS SpotOptionsRequest
$creadsPrec :: Int -> ReadS SpotOptionsRequest
Prelude.Read, Int -> SpotOptionsRequest -> ShowS
[SpotOptionsRequest] -> ShowS
SpotOptionsRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SpotOptionsRequest] -> ShowS
$cshowList :: [SpotOptionsRequest] -> ShowS
show :: SpotOptionsRequest -> String
$cshow :: SpotOptionsRequest -> String
showsPrec :: Int -> SpotOptionsRequest -> ShowS
$cshowsPrec :: Int -> SpotOptionsRequest -> ShowS
Prelude.Show, forall x. Rep SpotOptionsRequest x -> SpotOptionsRequest
forall x. SpotOptionsRequest -> Rep SpotOptionsRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SpotOptionsRequest x -> SpotOptionsRequest
$cfrom :: forall x. SpotOptionsRequest -> Rep SpotOptionsRequest x
Prelude.Generic)
newSpotOptionsRequest ::
SpotOptionsRequest
newSpotOptionsRequest :: SpotOptionsRequest
newSpotOptionsRequest =
SpotOptionsRequest'
{ $sel:allocationStrategy:SpotOptionsRequest' :: Maybe SpotAllocationStrategy
allocationStrategy =
forall a. Maybe a
Prelude.Nothing,
$sel:instanceInterruptionBehavior:SpotOptionsRequest' :: Maybe SpotInstanceInterruptionBehavior
instanceInterruptionBehavior = forall a. Maybe a
Prelude.Nothing,
$sel:instancePoolsToUseCount:SpotOptionsRequest' :: Maybe Int
instancePoolsToUseCount = forall a. Maybe a
Prelude.Nothing,
$sel:maintenanceStrategies:SpotOptionsRequest' :: Maybe FleetSpotMaintenanceStrategiesRequest
maintenanceStrategies = forall a. Maybe a
Prelude.Nothing,
$sel:maxTotalPrice:SpotOptionsRequest' :: Maybe Text
maxTotalPrice = forall a. Maybe a
Prelude.Nothing,
$sel:minTargetCapacity:SpotOptionsRequest' :: Maybe Int
minTargetCapacity = forall a. Maybe a
Prelude.Nothing,
$sel:singleAvailabilityZone:SpotOptionsRequest' :: Maybe Bool
singleAvailabilityZone = forall a. Maybe a
Prelude.Nothing,
$sel:singleInstanceType:SpotOptionsRequest' :: Maybe Bool
singleInstanceType = forall a. Maybe a
Prelude.Nothing
}
spotOptionsRequest_allocationStrategy :: Lens.Lens' SpotOptionsRequest (Prelude.Maybe SpotAllocationStrategy)
spotOptionsRequest_allocationStrategy :: Lens' SpotOptionsRequest (Maybe SpotAllocationStrategy)
spotOptionsRequest_allocationStrategy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SpotOptionsRequest' {Maybe SpotAllocationStrategy
allocationStrategy :: Maybe SpotAllocationStrategy
$sel:allocationStrategy:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe SpotAllocationStrategy
allocationStrategy} -> Maybe SpotAllocationStrategy
allocationStrategy) (\s :: SpotOptionsRequest
s@SpotOptionsRequest' {} Maybe SpotAllocationStrategy
a -> SpotOptionsRequest
s {$sel:allocationStrategy:SpotOptionsRequest' :: Maybe SpotAllocationStrategy
allocationStrategy = Maybe SpotAllocationStrategy
a} :: SpotOptionsRequest)
spotOptionsRequest_instanceInterruptionBehavior :: Lens.Lens' SpotOptionsRequest (Prelude.Maybe SpotInstanceInterruptionBehavior)
spotOptionsRequest_instanceInterruptionBehavior :: Lens' SpotOptionsRequest (Maybe SpotInstanceInterruptionBehavior)
spotOptionsRequest_instanceInterruptionBehavior = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SpotOptionsRequest' {Maybe SpotInstanceInterruptionBehavior
instanceInterruptionBehavior :: Maybe SpotInstanceInterruptionBehavior
$sel:instanceInterruptionBehavior:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe SpotInstanceInterruptionBehavior
instanceInterruptionBehavior} -> Maybe SpotInstanceInterruptionBehavior
instanceInterruptionBehavior) (\s :: SpotOptionsRequest
s@SpotOptionsRequest' {} Maybe SpotInstanceInterruptionBehavior
a -> SpotOptionsRequest
s {$sel:instanceInterruptionBehavior:SpotOptionsRequest' :: Maybe SpotInstanceInterruptionBehavior
instanceInterruptionBehavior = Maybe SpotInstanceInterruptionBehavior
a} :: SpotOptionsRequest)
spotOptionsRequest_instancePoolsToUseCount :: Lens.Lens' SpotOptionsRequest (Prelude.Maybe Prelude.Int)
spotOptionsRequest_instancePoolsToUseCount :: Lens' SpotOptionsRequest (Maybe Int)
spotOptionsRequest_instancePoolsToUseCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SpotOptionsRequest' {Maybe Int
instancePoolsToUseCount :: Maybe Int
$sel:instancePoolsToUseCount:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Int
instancePoolsToUseCount} -> Maybe Int
instancePoolsToUseCount) (\s :: SpotOptionsRequest
s@SpotOptionsRequest' {} Maybe Int
a -> SpotOptionsRequest
s {$sel:instancePoolsToUseCount:SpotOptionsRequest' :: Maybe Int
instancePoolsToUseCount = Maybe Int
a} :: SpotOptionsRequest)
spotOptionsRequest_maintenanceStrategies :: Lens.Lens' SpotOptionsRequest (Prelude.Maybe FleetSpotMaintenanceStrategiesRequest)
spotOptionsRequest_maintenanceStrategies :: Lens'
SpotOptionsRequest (Maybe FleetSpotMaintenanceStrategiesRequest)
spotOptionsRequest_maintenanceStrategies = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SpotOptionsRequest' {Maybe FleetSpotMaintenanceStrategiesRequest
maintenanceStrategies :: Maybe FleetSpotMaintenanceStrategiesRequest
$sel:maintenanceStrategies:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe FleetSpotMaintenanceStrategiesRequest
maintenanceStrategies} -> Maybe FleetSpotMaintenanceStrategiesRequest
maintenanceStrategies) (\s :: SpotOptionsRequest
s@SpotOptionsRequest' {} Maybe FleetSpotMaintenanceStrategiesRequest
a -> SpotOptionsRequest
s {$sel:maintenanceStrategies:SpotOptionsRequest' :: Maybe FleetSpotMaintenanceStrategiesRequest
maintenanceStrategies = Maybe FleetSpotMaintenanceStrategiesRequest
a} :: SpotOptionsRequest)
spotOptionsRequest_maxTotalPrice :: Lens.Lens' SpotOptionsRequest (Prelude.Maybe Prelude.Text)
spotOptionsRequest_maxTotalPrice :: Lens' SpotOptionsRequest (Maybe Text)
spotOptionsRequest_maxTotalPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SpotOptionsRequest' {Maybe Text
maxTotalPrice :: Maybe Text
$sel:maxTotalPrice:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Text
maxTotalPrice} -> Maybe Text
maxTotalPrice) (\s :: SpotOptionsRequest
s@SpotOptionsRequest' {} Maybe Text
a -> SpotOptionsRequest
s {$sel:maxTotalPrice:SpotOptionsRequest' :: Maybe Text
maxTotalPrice = Maybe Text
a} :: SpotOptionsRequest)
spotOptionsRequest_minTargetCapacity :: Lens.Lens' SpotOptionsRequest (Prelude.Maybe Prelude.Int)
spotOptionsRequest_minTargetCapacity :: Lens' SpotOptionsRequest (Maybe Int)
spotOptionsRequest_minTargetCapacity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SpotOptionsRequest' {Maybe Int
minTargetCapacity :: Maybe Int
$sel:minTargetCapacity:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Int
minTargetCapacity} -> Maybe Int
minTargetCapacity) (\s :: SpotOptionsRequest
s@SpotOptionsRequest' {} Maybe Int
a -> SpotOptionsRequest
s {$sel:minTargetCapacity:SpotOptionsRequest' :: Maybe Int
minTargetCapacity = Maybe Int
a} :: SpotOptionsRequest)
spotOptionsRequest_singleAvailabilityZone :: Lens.Lens' SpotOptionsRequest (Prelude.Maybe Prelude.Bool)
spotOptionsRequest_singleAvailabilityZone :: Lens' SpotOptionsRequest (Maybe Bool)
spotOptionsRequest_singleAvailabilityZone = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SpotOptionsRequest' {Maybe Bool
singleAvailabilityZone :: Maybe Bool
$sel:singleAvailabilityZone:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Bool
singleAvailabilityZone} -> Maybe Bool
singleAvailabilityZone) (\s :: SpotOptionsRequest
s@SpotOptionsRequest' {} Maybe Bool
a -> SpotOptionsRequest
s {$sel:singleAvailabilityZone:SpotOptionsRequest' :: Maybe Bool
singleAvailabilityZone = Maybe Bool
a} :: SpotOptionsRequest)
spotOptionsRequest_singleInstanceType :: Lens.Lens' SpotOptionsRequest (Prelude.Maybe Prelude.Bool)
spotOptionsRequest_singleInstanceType :: Lens' SpotOptionsRequest (Maybe Bool)
spotOptionsRequest_singleInstanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SpotOptionsRequest' {Maybe Bool
singleInstanceType :: Maybe Bool
$sel:singleInstanceType:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Bool
singleInstanceType} -> Maybe Bool
singleInstanceType) (\s :: SpotOptionsRequest
s@SpotOptionsRequest' {} Maybe Bool
a -> SpotOptionsRequest
s {$sel:singleInstanceType:SpotOptionsRequest' :: Maybe Bool
singleInstanceType = Maybe Bool
a} :: SpotOptionsRequest)
instance Prelude.Hashable SpotOptionsRequest where
hashWithSalt :: Int -> SpotOptionsRequest -> Int
hashWithSalt Int
_salt SpotOptionsRequest' {Maybe Bool
Maybe Int
Maybe Text
Maybe FleetSpotMaintenanceStrategiesRequest
Maybe SpotAllocationStrategy
Maybe SpotInstanceInterruptionBehavior
singleInstanceType :: Maybe Bool
singleAvailabilityZone :: Maybe Bool
minTargetCapacity :: Maybe Int
maxTotalPrice :: Maybe Text
maintenanceStrategies :: Maybe FleetSpotMaintenanceStrategiesRequest
instancePoolsToUseCount :: Maybe Int
instanceInterruptionBehavior :: Maybe SpotInstanceInterruptionBehavior
allocationStrategy :: Maybe SpotAllocationStrategy
$sel:singleInstanceType:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Bool
$sel:singleAvailabilityZone:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Bool
$sel:minTargetCapacity:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Int
$sel:maxTotalPrice:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Text
$sel:maintenanceStrategies:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe FleetSpotMaintenanceStrategiesRequest
$sel:instancePoolsToUseCount:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Int
$sel:instanceInterruptionBehavior:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe SpotInstanceInterruptionBehavior
$sel:allocationStrategy:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe SpotAllocationStrategy
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SpotAllocationStrategy
allocationStrategy
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SpotInstanceInterruptionBehavior
instanceInterruptionBehavior
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
instancePoolsToUseCount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FleetSpotMaintenanceStrategiesRequest
maintenanceStrategies
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maxTotalPrice
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
minTargetCapacity
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
singleAvailabilityZone
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
singleInstanceType
instance Prelude.NFData SpotOptionsRequest where
rnf :: SpotOptionsRequest -> ()
rnf SpotOptionsRequest' {Maybe Bool
Maybe Int
Maybe Text
Maybe FleetSpotMaintenanceStrategiesRequest
Maybe SpotAllocationStrategy
Maybe SpotInstanceInterruptionBehavior
singleInstanceType :: Maybe Bool
singleAvailabilityZone :: Maybe Bool
minTargetCapacity :: Maybe Int
maxTotalPrice :: Maybe Text
maintenanceStrategies :: Maybe FleetSpotMaintenanceStrategiesRequest
instancePoolsToUseCount :: Maybe Int
instanceInterruptionBehavior :: Maybe SpotInstanceInterruptionBehavior
allocationStrategy :: Maybe SpotAllocationStrategy
$sel:singleInstanceType:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Bool
$sel:singleAvailabilityZone:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Bool
$sel:minTargetCapacity:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Int
$sel:maxTotalPrice:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Text
$sel:maintenanceStrategies:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe FleetSpotMaintenanceStrategiesRequest
$sel:instancePoolsToUseCount:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Int
$sel:instanceInterruptionBehavior:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe SpotInstanceInterruptionBehavior
$sel:allocationStrategy:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe SpotAllocationStrategy
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe SpotAllocationStrategy
allocationStrategy
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SpotInstanceInterruptionBehavior
instanceInterruptionBehavior
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
instancePoolsToUseCount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FleetSpotMaintenanceStrategiesRequest
maintenanceStrategies
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
maxTotalPrice
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
minTargetCapacity
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
singleAvailabilityZone
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
singleInstanceType
instance Data.ToQuery SpotOptionsRequest where
toQuery :: SpotOptionsRequest -> QueryString
toQuery SpotOptionsRequest' {Maybe Bool
Maybe Int
Maybe Text
Maybe FleetSpotMaintenanceStrategiesRequest
Maybe SpotAllocationStrategy
Maybe SpotInstanceInterruptionBehavior
singleInstanceType :: Maybe Bool
singleAvailabilityZone :: Maybe Bool
minTargetCapacity :: Maybe Int
maxTotalPrice :: Maybe Text
maintenanceStrategies :: Maybe FleetSpotMaintenanceStrategiesRequest
instancePoolsToUseCount :: Maybe Int
instanceInterruptionBehavior :: Maybe SpotInstanceInterruptionBehavior
allocationStrategy :: Maybe SpotAllocationStrategy
$sel:singleInstanceType:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Bool
$sel:singleAvailabilityZone:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Bool
$sel:minTargetCapacity:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Int
$sel:maxTotalPrice:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Text
$sel:maintenanceStrategies:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe FleetSpotMaintenanceStrategiesRequest
$sel:instancePoolsToUseCount:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe Int
$sel:instanceInterruptionBehavior:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe SpotInstanceInterruptionBehavior
$sel:allocationStrategy:SpotOptionsRequest' :: SpotOptionsRequest -> Maybe SpotAllocationStrategy
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"AllocationStrategy" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe SpotAllocationStrategy
allocationStrategy,
ByteString
"InstanceInterruptionBehavior"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe SpotInstanceInterruptionBehavior
instanceInterruptionBehavior,
ByteString
"InstancePoolsToUseCount"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
instancePoolsToUseCount,
ByteString
"MaintenanceStrategies"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe FleetSpotMaintenanceStrategiesRequest
maintenanceStrategies,
ByteString
"MaxTotalPrice" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
maxTotalPrice,
ByteString
"MinTargetCapacity" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
minTargetCapacity,
ByteString
"SingleAvailabilityZone"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
singleAvailabilityZone,
ByteString
"SingleInstanceType" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
singleInstanceType
]