{-# 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.IoTSiteWise.Types.ErrorCode
-- 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.IoTSiteWise.Types.ErrorCode
  ( ErrorCode
      ( ..,
        ErrorCode_INTERNAL_FAILURE,
        ErrorCode_VALIDATION_ERROR
      ),
  )
where

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

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

pattern ErrorCode_INTERNAL_FAILURE :: ErrorCode
pattern $bErrorCode_INTERNAL_FAILURE :: ErrorCode
$mErrorCode_INTERNAL_FAILURE :: forall r. ErrorCode -> (Void# -> r) -> (Void# -> r) -> r
ErrorCode_INTERNAL_FAILURE = ErrorCode' "INTERNAL_FAILURE"

pattern ErrorCode_VALIDATION_ERROR :: ErrorCode
pattern $bErrorCode_VALIDATION_ERROR :: ErrorCode
$mErrorCode_VALIDATION_ERROR :: forall r. ErrorCode -> (Void# -> r) -> (Void# -> r) -> r
ErrorCode_VALIDATION_ERROR = ErrorCode' "VALIDATION_ERROR"

{-# COMPLETE
  ErrorCode_INTERNAL_FAILURE,
  ErrorCode_VALIDATION_ERROR,
  ErrorCode'
  #-}