{-# 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.Transfer.Types.State
-- 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.Transfer.Types.State
  ( State
      ( ..,
        State_OFFLINE,
        State_ONLINE,
        State_STARTING,
        State_START_FAILED,
        State_STOPPING,
        State_STOP_FAILED
      ),
  )
where

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

-- | Describes the condition of a file transfer protocol-enabled server with
-- respect to its ability to perform file operations. There are six
-- possible states: @OFFLINE@, @ONLINE@, @STARTING@, @STOPPING@,
-- @START_FAILED@, and @STOP_FAILED@.
--
-- @OFFLINE@ indicates that the server exists, but that it is not available
-- for file operations. @ONLINE@ indicates that the server is available to
-- perform file operations. @STARTING@ indicates that the server\'s was
-- instantiated, but the server is not yet available to perform file
-- operations. Under normal conditions, it can take a couple of minutes for
-- the server to be completely operational. Both @START_FAILED@ and
-- @STOP_FAILED@ are error conditions.
newtype State = State' {State -> Text
fromState :: Data.Text}
  deriving stock
    ( Int -> State -> ShowS
[State] -> ShowS
State -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [State] -> ShowS
$cshowList :: [State] -> ShowS
show :: State -> String
$cshow :: State -> String
showsPrec :: Int -> State -> ShowS
$cshowsPrec :: Int -> State -> ShowS
Prelude.Show,
      ReadPrec [State]
ReadPrec State
Int -> ReadS State
ReadS [State]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [State]
$creadListPrec :: ReadPrec [State]
readPrec :: ReadPrec State
$creadPrec :: ReadPrec State
readList :: ReadS [State]
$creadList :: ReadS [State]
readsPrec :: Int -> ReadS State
$creadsPrec :: Int -> ReadS State
Prelude.Read,
      State -> State -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: State -> State -> Bool
$c/= :: State -> State -> Bool
== :: State -> State -> Bool
$c== :: State -> State -> Bool
Prelude.Eq,
      Eq State
State -> State -> Bool
State -> State -> Ordering
State -> State -> State
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 :: State -> State -> State
$cmin :: State -> State -> State
max :: State -> State -> State
$cmax :: State -> State -> State
>= :: State -> State -> Bool
$c>= :: State -> State -> Bool
> :: State -> State -> Bool
$c> :: State -> State -> Bool
<= :: State -> State -> Bool
$c<= :: State -> State -> Bool
< :: State -> State -> Bool
$c< :: State -> State -> Bool
compare :: State -> State -> Ordering
$ccompare :: State -> State -> Ordering
Prelude.Ord,
      forall x. Rep State x -> State
forall x. State -> Rep State x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep State x -> State
$cfrom :: forall x. State -> Rep State x
Prelude.Generic
    )
  deriving newtype
    ( Eq State
Int -> State -> Int
State -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: State -> Int
$chash :: State -> Int
hashWithSalt :: Int -> State -> Int
$chashWithSalt :: Int -> State -> Int
Prelude.Hashable,
      State -> ()
forall a. (a -> ()) -> NFData a
rnf :: State -> ()
$crnf :: State -> ()
Prelude.NFData,
      Text -> Either String State
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String State
$cfromText :: Text -> Either String State
Data.FromText,
      State -> Text
forall a. (a -> Text) -> ToText a
toText :: State -> Text
$ctoText :: State -> Text
Data.ToText,
      State -> ByteString
forall a. (a -> ByteString) -> ToByteString a
toBS :: State -> ByteString
$ctoBS :: State -> ByteString
Data.ToByteString,
      State -> ByteStringBuilder
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: State -> ByteStringBuilder
$cbuild :: State -> ByteStringBuilder
Data.ToLog,
      HeaderName -> State -> [Header]
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> State -> [Header]
$ctoHeader :: HeaderName -> State -> [Header]
Data.ToHeader,
      State -> QueryString
forall a. (a -> QueryString) -> ToQuery a
toQuery :: State -> QueryString
$ctoQuery :: State -> QueryString
Data.ToQuery,
      Value -> Parser [State]
Value -> Parser State
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [State]
$cparseJSONList :: Value -> Parser [State]
parseJSON :: Value -> Parser State
$cparseJSON :: Value -> Parser State
Data.FromJSON,
      FromJSONKeyFunction [State]
FromJSONKeyFunction State
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [State]
$cfromJSONKeyList :: FromJSONKeyFunction [State]
fromJSONKey :: FromJSONKeyFunction State
$cfromJSONKey :: FromJSONKeyFunction State
Data.FromJSONKey,
      [State] -> Encoding
[State] -> Value
State -> Encoding
State -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [State] -> Encoding
$ctoEncodingList :: [State] -> Encoding
toJSONList :: [State] -> Value
$ctoJSONList :: [State] -> Value
toEncoding :: State -> Encoding
$ctoEncoding :: State -> Encoding
toJSON :: State -> Value
$ctoJSON :: State -> Value
Data.ToJSON,
      ToJSONKeyFunction [State]
ToJSONKeyFunction State
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [State]
$ctoJSONKeyList :: ToJSONKeyFunction [State]
toJSONKey :: ToJSONKeyFunction State
$ctoJSONKey :: ToJSONKeyFunction State
Data.ToJSONKey,
      [Node] -> Either String State
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String State
$cparseXML :: [Node] -> Either String State
Data.FromXML,
      State -> XML
forall a. (a -> XML) -> ToXML a
toXML :: State -> XML
$ctoXML :: State -> XML
Data.ToXML
    )

pattern State_OFFLINE :: State
pattern $bState_OFFLINE :: State
$mState_OFFLINE :: forall {r}. State -> ((# #) -> r) -> ((# #) -> r) -> r
State_OFFLINE = State' "OFFLINE"

pattern State_ONLINE :: State
pattern $bState_ONLINE :: State
$mState_ONLINE :: forall {r}. State -> ((# #) -> r) -> ((# #) -> r) -> r
State_ONLINE = State' "ONLINE"

pattern State_STARTING :: State
pattern $bState_STARTING :: State
$mState_STARTING :: forall {r}. State -> ((# #) -> r) -> ((# #) -> r) -> r
State_STARTING = State' "STARTING"

pattern State_START_FAILED :: State
pattern $bState_START_FAILED :: State
$mState_START_FAILED :: forall {r}. State -> ((# #) -> r) -> ((# #) -> r) -> r
State_START_FAILED = State' "START_FAILED"

pattern State_STOPPING :: State
pattern $bState_STOPPING :: State
$mState_STOPPING :: forall {r}. State -> ((# #) -> r) -> ((# #) -> r) -> r
State_STOPPING = State' "STOPPING"

pattern State_STOP_FAILED :: State
pattern $bState_STOP_FAILED :: State
$mState_STOP_FAILED :: forall {r}. State -> ((# #) -> r) -> ((# #) -> r) -> r
State_STOP_FAILED = State' "STOP_FAILED"

{-# COMPLETE
  State_OFFLINE,
  State_ONLINE,
  State_STARTING,
  State_START_FAILED,
  State_STOPPING,
  State_STOP_FAILED,
  State'
  #-}