{-# 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-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.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.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 :: Core.Text}
  deriving stock
    ( Int -> State -> ShowS
[State] -> ShowS
State -> String
(Int -> State -> ShowS)
-> (State -> String) -> ([State] -> ShowS) -> Show State
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]
(Int -> ReadS State)
-> ReadS [State]
-> ReadPrec State
-> ReadPrec [State]
-> Read 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
(State -> State -> Bool) -> (State -> State -> Bool) -> Eq State
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
Eq State
-> (State -> State -> Ordering)
-> (State -> State -> Bool)
-> (State -> State -> Bool)
-> (State -> State -> Bool)
-> (State -> State -> Bool)
-> (State -> State -> State)
-> (State -> State -> State)
-> Ord 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
$cp1Ord :: Eq State
Prelude.Ord,
      (forall x. State -> Rep State x)
-> (forall x. Rep State x -> State) -> Generic State
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
    ( Int -> State -> Int
State -> Int
(Int -> State -> Int) -> (State -> Int) -> Hashable State
forall 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 -> ()
(State -> ()) -> NFData State
forall a. (a -> ()) -> NFData a
rnf :: State -> ()
$crnf :: State -> ()
Prelude.NFData,
      Text -> Either String State
(Text -> Either String State) -> FromText State
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String State
$cfromText :: Text -> Either String State
Core.FromText,
      State -> Text
(State -> Text) -> ToText State
forall a. (a -> Text) -> ToText a
toText :: State -> Text
$ctoText :: State -> Text
Core.ToText,
      State -> ByteString
(State -> ByteString) -> ToByteString State
forall a. (a -> ByteString) -> ToByteString a
toBS :: State -> ByteString
$ctoBS :: State -> ByteString
Core.ToByteString,
      State -> ByteStringBuilder
(State -> ByteStringBuilder) -> ToLog State
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: State -> ByteStringBuilder
$cbuild :: State -> ByteStringBuilder
Core.ToLog,
      HeaderName -> State -> [Header]
(HeaderName -> State -> [Header]) -> ToHeader State
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> State -> [Header]
$ctoHeader :: HeaderName -> State -> [Header]
Core.ToHeader,
      State -> QueryString
(State -> QueryString) -> ToQuery State
forall a. (a -> QueryString) -> ToQuery a
toQuery :: State -> QueryString
$ctoQuery :: State -> QueryString
Core.ToQuery,
      Value -> Parser [State]
Value -> Parser State
(Value -> Parser State)
-> (Value -> Parser [State]) -> FromJSON 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
Core.FromJSON,
      FromJSONKeyFunction [State]
FromJSONKeyFunction State
FromJSONKeyFunction State
-> FromJSONKeyFunction [State] -> FromJSONKey State
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [State]
$cfromJSONKeyList :: FromJSONKeyFunction [State]
fromJSONKey :: FromJSONKeyFunction State
$cfromJSONKey :: FromJSONKeyFunction State
Core.FromJSONKey,
      [State] -> Encoding
[State] -> Value
State -> Encoding
State -> Value
(State -> Value)
-> (State -> Encoding)
-> ([State] -> Value)
-> ([State] -> Encoding)
-> ToJSON State
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
Core.ToJSON,
      ToJSONKeyFunction [State]
ToJSONKeyFunction State
ToJSONKeyFunction State
-> ToJSONKeyFunction [State] -> ToJSONKey State
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [State]
$ctoJSONKeyList :: ToJSONKeyFunction [State]
toJSONKey :: ToJSONKeyFunction State
$ctoJSONKey :: ToJSONKeyFunction State
Core.ToJSONKey,
      [Node] -> Either String State
([Node] -> Either String State) -> FromXML State
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String State
$cparseXML :: [Node] -> Either String State
Core.FromXML,
      State -> XML
(State -> XML) -> ToXML State
forall a. (a -> XML) -> ToXML a
toXML :: State -> XML
$ctoXML :: State -> XML
Core.ToXML
    )

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

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

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

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

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

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

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