{-# 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.Batch.Types.CRAllocationStrategy
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Batch.Types.CRAllocationStrategy
  ( CRAllocationStrategy
      ( ..,
        CRAllocationStrategy_BEST_FIT,
        CRAllocationStrategy_BEST_FIT_PROGRESSIVE,
        CRAllocationStrategy_SPOT_CAPACITY_OPTIMIZED
      ),
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Prelude as Prelude

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

pattern CRAllocationStrategy_BEST_FIT :: CRAllocationStrategy
pattern $bCRAllocationStrategy_BEST_FIT :: CRAllocationStrategy
$mCRAllocationStrategy_BEST_FIT :: forall r. CRAllocationStrategy -> (Void# -> r) -> (Void# -> r) -> r
CRAllocationStrategy_BEST_FIT = CRAllocationStrategy' "BEST_FIT"

pattern CRAllocationStrategy_BEST_FIT_PROGRESSIVE :: CRAllocationStrategy
pattern $bCRAllocationStrategy_BEST_FIT_PROGRESSIVE :: CRAllocationStrategy
$mCRAllocationStrategy_BEST_FIT_PROGRESSIVE :: forall r. CRAllocationStrategy -> (Void# -> r) -> (Void# -> r) -> r
CRAllocationStrategy_BEST_FIT_PROGRESSIVE = CRAllocationStrategy' "BEST_FIT_PROGRESSIVE"

pattern CRAllocationStrategy_SPOT_CAPACITY_OPTIMIZED :: CRAllocationStrategy
pattern $bCRAllocationStrategy_SPOT_CAPACITY_OPTIMIZED :: CRAllocationStrategy
$mCRAllocationStrategy_SPOT_CAPACITY_OPTIMIZED :: forall r. CRAllocationStrategy -> (Void# -> r) -> (Void# -> r) -> r
CRAllocationStrategy_SPOT_CAPACITY_OPTIMIZED = CRAllocationStrategy' "SPOT_CAPACITY_OPTIMIZED"

{-# COMPLETE
  CRAllocationStrategy_BEST_FIT,
  CRAllocationStrategy_BEST_FIT_PROGRESSIVE,
  CRAllocationStrategy_SPOT_CAPACITY_OPTIMIZED,
  CRAllocationStrategy'
  #-}