{-# 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.CognitoIdentityProvider.Types.OAuthFlowType
-- 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.CognitoIdentityProvider.Types.OAuthFlowType
  ( OAuthFlowType
      ( ..,
        OAuthFlowType_Client_credentials,
        OAuthFlowType_Code,
        OAuthFlowType_Implicit
      ),
  )
where

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

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

pattern OAuthFlowType_Client_credentials :: OAuthFlowType
pattern $bOAuthFlowType_Client_credentials :: OAuthFlowType
$mOAuthFlowType_Client_credentials :: forall r. OAuthFlowType -> (Void# -> r) -> (Void# -> r) -> r
OAuthFlowType_Client_credentials = OAuthFlowType' "client_credentials"

pattern OAuthFlowType_Code :: OAuthFlowType
pattern $bOAuthFlowType_Code :: OAuthFlowType
$mOAuthFlowType_Code :: forall r. OAuthFlowType -> (Void# -> r) -> (Void# -> r) -> r
OAuthFlowType_Code = OAuthFlowType' "code"

pattern OAuthFlowType_Implicit :: OAuthFlowType
pattern $bOAuthFlowType_Implicit :: OAuthFlowType
$mOAuthFlowType_Implicit :: forall r. OAuthFlowType -> (Void# -> r) -> (Void# -> r) -> r
OAuthFlowType_Implicit = OAuthFlowType' "implicit"

{-# COMPLETE
  OAuthFlowType_Client_credentials,
  OAuthFlowType_Code,
  OAuthFlowType_Implicit,
  OAuthFlowType'
  #-}