{-# 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.SpotInstanceState
-- 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.SpotInstanceState
  ( SpotInstanceState
      ( ..,
        SpotInstanceState_Active,
        SpotInstanceState_Cancelled,
        SpotInstanceState_Closed,
        SpotInstanceState_Failed,
        SpotInstanceState_Open
      ),
  )
where

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

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

pattern SpotInstanceState_Active :: SpotInstanceState
pattern $bSpotInstanceState_Active :: SpotInstanceState
$mSpotInstanceState_Active :: forall {r}. SpotInstanceState -> ((# #) -> r) -> ((# #) -> r) -> r
SpotInstanceState_Active = SpotInstanceState' "active"

pattern SpotInstanceState_Cancelled :: SpotInstanceState
pattern $bSpotInstanceState_Cancelled :: SpotInstanceState
$mSpotInstanceState_Cancelled :: forall {r}. SpotInstanceState -> ((# #) -> r) -> ((# #) -> r) -> r
SpotInstanceState_Cancelled = SpotInstanceState' "cancelled"

pattern SpotInstanceState_Closed :: SpotInstanceState
pattern $bSpotInstanceState_Closed :: SpotInstanceState
$mSpotInstanceState_Closed :: forall {r}. SpotInstanceState -> ((# #) -> r) -> ((# #) -> r) -> r
SpotInstanceState_Closed = SpotInstanceState' "closed"

pattern SpotInstanceState_Failed :: SpotInstanceState
pattern $bSpotInstanceState_Failed :: SpotInstanceState
$mSpotInstanceState_Failed :: forall {r}. SpotInstanceState -> ((# #) -> r) -> ((# #) -> r) -> r
SpotInstanceState_Failed = SpotInstanceState' "failed"

pattern SpotInstanceState_Open :: SpotInstanceState
pattern $bSpotInstanceState_Open :: SpotInstanceState
$mSpotInstanceState_Open :: forall {r}. SpotInstanceState -> ((# #) -> r) -> ((# #) -> r) -> r
SpotInstanceState_Open = SpotInstanceState' "open"

{-# COMPLETE
  SpotInstanceState_Active,
  SpotInstanceState_Cancelled,
  SpotInstanceState_Closed,
  SpotInstanceState_Failed,
  SpotInstanceState_Open,
  SpotInstanceState'
  #-}