{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.EC2.Types.SpotAllocationStrategy
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EC2.Types.SpotAllocationStrategy
  ( SpotAllocationStrategy
      ( ..,
        SpotAllocationStrategy_Capacity_optimized,
        SpotAllocationStrategy_Capacity_optimized_prioritized,
        SpotAllocationStrategy_Diversified,
        SpotAllocationStrategy_Lowest_price,
        SpotAllocationStrategy_Price_capacity_optimized
      ),
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import qualified Amazonka.Prelude as Prelude

newtype SpotAllocationStrategy = SpotAllocationStrategy'
  { SpotAllocationStrategy -> Text
fromSpotAllocationStrategy ::
      Data.Text
  }
  deriving stock
    ( Int -> SpotAllocationStrategy -> ShowS
[SpotAllocationStrategy] -> ShowS
SpotAllocationStrategy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SpotAllocationStrategy] -> ShowS
$cshowList :: [SpotAllocationStrategy] -> ShowS
show :: SpotAllocationStrategy -> String
$cshow :: SpotAllocationStrategy -> String
showsPrec :: Int -> SpotAllocationStrategy -> ShowS
$cshowsPrec :: Int -> SpotAllocationStrategy -> ShowS
Prelude.Show,
      ReadPrec [SpotAllocationStrategy]
ReadPrec SpotAllocationStrategy
Int -> ReadS SpotAllocationStrategy
ReadS [SpotAllocationStrategy]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SpotAllocationStrategy]
$creadListPrec :: ReadPrec [SpotAllocationStrategy]
readPrec :: ReadPrec SpotAllocationStrategy
$creadPrec :: ReadPrec SpotAllocationStrategy
readList :: ReadS [SpotAllocationStrategy]
$creadList :: ReadS [SpotAllocationStrategy]
readsPrec :: Int -> ReadS SpotAllocationStrategy
$creadsPrec :: Int -> ReadS SpotAllocationStrategy
Prelude.Read,
      SpotAllocationStrategy -> SpotAllocationStrategy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SpotAllocationStrategy -> SpotAllocationStrategy -> Bool
$c/= :: SpotAllocationStrategy -> SpotAllocationStrategy -> Bool
== :: SpotAllocationStrategy -> SpotAllocationStrategy -> Bool
$c== :: SpotAllocationStrategy -> SpotAllocationStrategy -> Bool
Prelude.Eq,
      Eq SpotAllocationStrategy
SpotAllocationStrategy -> SpotAllocationStrategy -> Bool
SpotAllocationStrategy -> SpotAllocationStrategy -> Ordering
SpotAllocationStrategy
-> SpotAllocationStrategy -> SpotAllocationStrategy
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: SpotAllocationStrategy
-> SpotAllocationStrategy -> SpotAllocationStrategy
$cmin :: SpotAllocationStrategy
-> SpotAllocationStrategy -> SpotAllocationStrategy
max :: SpotAllocationStrategy
-> SpotAllocationStrategy -> SpotAllocationStrategy
$cmax :: SpotAllocationStrategy
-> SpotAllocationStrategy -> SpotAllocationStrategy
>= :: SpotAllocationStrategy -> SpotAllocationStrategy -> Bool
$c>= :: SpotAllocationStrategy -> SpotAllocationStrategy -> Bool
> :: SpotAllocationStrategy -> SpotAllocationStrategy -> Bool
$c> :: SpotAllocationStrategy -> SpotAllocationStrategy -> Bool
<= :: SpotAllocationStrategy -> SpotAllocationStrategy -> Bool
$c<= :: SpotAllocationStrategy -> SpotAllocationStrategy -> Bool
< :: SpotAllocationStrategy -> SpotAllocationStrategy -> Bool
$c< :: SpotAllocationStrategy -> SpotAllocationStrategy -> Bool
compare :: SpotAllocationStrategy -> SpotAllocationStrategy -> Ordering
$ccompare :: SpotAllocationStrategy -> SpotAllocationStrategy -> Ordering
Prelude.Ord,
      forall x. Rep SpotAllocationStrategy x -> SpotAllocationStrategy
forall x. SpotAllocationStrategy -> Rep SpotAllocationStrategy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SpotAllocationStrategy x -> SpotAllocationStrategy
$cfrom :: forall x. SpotAllocationStrategy -> Rep SpotAllocationStrategy x
Prelude.Generic
    )
  deriving newtype
    ( Eq SpotAllocationStrategy
Int -> SpotAllocationStrategy -> Int
SpotAllocationStrategy -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: SpotAllocationStrategy -> Int
$chash :: SpotAllocationStrategy -> Int
hashWithSalt :: Int -> SpotAllocationStrategy -> Int
$chashWithSalt :: Int -> SpotAllocationStrategy -> Int
Prelude.Hashable,
      SpotAllocationStrategy -> ()
forall a. (a -> ()) -> NFData a
rnf :: SpotAllocationStrategy -> ()
$crnf :: SpotAllocationStrategy -> ()
Prelude.NFData,
      Text -> Either String SpotAllocationStrategy
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String SpotAllocationStrategy
$cfromText :: Text -> Either String SpotAllocationStrategy
Data.FromText,
      SpotAllocationStrategy -> Text
forall a. (a -> Text) -> ToText a
toText :: SpotAllocationStrategy -> Text
$ctoText :: SpotAllocationStrategy -> Text
Data.ToText,
      SpotAllocationStrategy -> ByteString
forall a. (a -> ByteString) -> ToByteString a
toBS :: SpotAllocationStrategy -> ByteString
$ctoBS :: SpotAllocationStrategy -> ByteString
Data.ToByteString,
      SpotAllocationStrategy -> ByteStringBuilder
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: SpotAllocationStrategy -> ByteStringBuilder
$cbuild :: SpotAllocationStrategy -> ByteStringBuilder
Data.ToLog,
      HeaderName -> SpotAllocationStrategy -> [Header]
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> SpotAllocationStrategy -> [Header]
$ctoHeader :: HeaderName -> SpotAllocationStrategy -> [Header]
Data.ToHeader,
      SpotAllocationStrategy -> QueryString
forall a. (a -> QueryString) -> ToQuery a
toQuery :: SpotAllocationStrategy -> QueryString
$ctoQuery :: SpotAllocationStrategy -> QueryString
Data.ToQuery,
      Value -> Parser [SpotAllocationStrategy]
Value -> Parser SpotAllocationStrategy
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [SpotAllocationStrategy]
$cparseJSONList :: Value -> Parser [SpotAllocationStrategy]
parseJSON :: Value -> Parser SpotAllocationStrategy
$cparseJSON :: Value -> Parser SpotAllocationStrategy
Data.FromJSON,
      FromJSONKeyFunction [SpotAllocationStrategy]
FromJSONKeyFunction SpotAllocationStrategy
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [SpotAllocationStrategy]
$cfromJSONKeyList :: FromJSONKeyFunction [SpotAllocationStrategy]
fromJSONKey :: FromJSONKeyFunction SpotAllocationStrategy
$cfromJSONKey :: FromJSONKeyFunction SpotAllocationStrategy
Data.FromJSONKey,
      [SpotAllocationStrategy] -> Encoding
[SpotAllocationStrategy] -> Value
SpotAllocationStrategy -> Encoding
SpotAllocationStrategy -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [SpotAllocationStrategy] -> Encoding
$ctoEncodingList :: [SpotAllocationStrategy] -> Encoding
toJSONList :: [SpotAllocationStrategy] -> Value
$ctoJSONList :: [SpotAllocationStrategy] -> Value
toEncoding :: SpotAllocationStrategy -> Encoding
$ctoEncoding :: SpotAllocationStrategy -> Encoding
toJSON :: SpotAllocationStrategy -> Value
$ctoJSON :: SpotAllocationStrategy -> Value
Data.ToJSON,
      ToJSONKeyFunction [SpotAllocationStrategy]
ToJSONKeyFunction SpotAllocationStrategy
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [SpotAllocationStrategy]
$ctoJSONKeyList :: ToJSONKeyFunction [SpotAllocationStrategy]
toJSONKey :: ToJSONKeyFunction SpotAllocationStrategy
$ctoJSONKey :: ToJSONKeyFunction SpotAllocationStrategy
Data.ToJSONKey,
      [Node] -> Either String SpotAllocationStrategy
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String SpotAllocationStrategy
$cparseXML :: [Node] -> Either String SpotAllocationStrategy
Data.FromXML,
      SpotAllocationStrategy -> XML
forall a. (a -> XML) -> ToXML a
toXML :: SpotAllocationStrategy -> XML
$ctoXML :: SpotAllocationStrategy -> XML
Data.ToXML
    )

pattern SpotAllocationStrategy_Capacity_optimized :: SpotAllocationStrategy
pattern $bSpotAllocationStrategy_Capacity_optimized :: SpotAllocationStrategy
$mSpotAllocationStrategy_Capacity_optimized :: forall {r}.
SpotAllocationStrategy -> ((# #) -> r) -> ((# #) -> r) -> r
SpotAllocationStrategy_Capacity_optimized = SpotAllocationStrategy' "capacity-optimized"

pattern SpotAllocationStrategy_Capacity_optimized_prioritized :: SpotAllocationStrategy
pattern $bSpotAllocationStrategy_Capacity_optimized_prioritized :: SpotAllocationStrategy
$mSpotAllocationStrategy_Capacity_optimized_prioritized :: forall {r}.
SpotAllocationStrategy -> ((# #) -> r) -> ((# #) -> r) -> r
SpotAllocationStrategy_Capacity_optimized_prioritized = SpotAllocationStrategy' "capacity-optimized-prioritized"

pattern SpotAllocationStrategy_Diversified :: SpotAllocationStrategy
pattern $bSpotAllocationStrategy_Diversified :: SpotAllocationStrategy
$mSpotAllocationStrategy_Diversified :: forall {r}.
SpotAllocationStrategy -> ((# #) -> r) -> ((# #) -> r) -> r
SpotAllocationStrategy_Diversified = SpotAllocationStrategy' "diversified"

pattern SpotAllocationStrategy_Lowest_price :: SpotAllocationStrategy
pattern $bSpotAllocationStrategy_Lowest_price :: SpotAllocationStrategy
$mSpotAllocationStrategy_Lowest_price :: forall {r}.
SpotAllocationStrategy -> ((# #) -> r) -> ((# #) -> r) -> r
SpotAllocationStrategy_Lowest_price = SpotAllocationStrategy' "lowest-price"

pattern SpotAllocationStrategy_Price_capacity_optimized :: SpotAllocationStrategy
pattern $bSpotAllocationStrategy_Price_capacity_optimized :: SpotAllocationStrategy
$mSpotAllocationStrategy_Price_capacity_optimized :: forall {r}.
SpotAllocationStrategy -> ((# #) -> r) -> ((# #) -> r) -> r
SpotAllocationStrategy_Price_capacity_optimized = SpotAllocationStrategy' "price-capacity-optimized"

{-# COMPLETE
  SpotAllocationStrategy_Capacity_optimized,
  SpotAllocationStrategy_Capacity_optimized_prioritized,
  SpotAllocationStrategy_Diversified,
  SpotAllocationStrategy_Lowest_price,
  SpotAllocationStrategy_Price_capacity_optimized,
  SpotAllocationStrategy'
  #-}