{-# 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.PlacementStrategy
-- 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.PlacementStrategy
  ( PlacementStrategy
      ( ..,
        PlacementStrategy_Cluster,
        PlacementStrategy_Partition,
        PlacementStrategy_Spread
      ),
  )
where

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

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

pattern PlacementStrategy_Cluster :: PlacementStrategy
pattern $bPlacementStrategy_Cluster :: PlacementStrategy
$mPlacementStrategy_Cluster :: forall {r}. PlacementStrategy -> ((# #) -> r) -> ((# #) -> r) -> r
PlacementStrategy_Cluster = PlacementStrategy' "cluster"

pattern PlacementStrategy_Partition :: PlacementStrategy
pattern $bPlacementStrategy_Partition :: PlacementStrategy
$mPlacementStrategy_Partition :: forall {r}. PlacementStrategy -> ((# #) -> r) -> ((# #) -> r) -> r
PlacementStrategy_Partition = PlacementStrategy' "partition"

pattern PlacementStrategy_Spread :: PlacementStrategy
pattern $bPlacementStrategy_Spread :: PlacementStrategy
$mPlacementStrategy_Spread :: forall {r}. PlacementStrategy -> ((# #) -> r) -> ((# #) -> r) -> r
PlacementStrategy_Spread = PlacementStrategy' "spread"

{-# COMPLETE
  PlacementStrategy_Cluster,
  PlacementStrategy_Partition,
  PlacementStrategy_Spread,
  PlacementStrategy'
  #-}