{-# 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.APIGateway.Types.AuthorizerType
-- 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.APIGateway.Types.AuthorizerType
  ( AuthorizerType
      ( ..,
        AuthorizerType_COGNITO_USER_POOLS,
        AuthorizerType_REQUEST,
        AuthorizerType_TOKEN
      ),
  )
where

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

-- | The authorizer type. Valid values are @TOKEN@ for a Lambda function
-- using a single authorization token submitted in a custom header,
-- @REQUEST@ for a Lambda function using incoming request parameters, and
-- @COGNITO_USER_POOLS@ for using an Amazon Cognito user pool.
newtype AuthorizerType = AuthorizerType'
  { AuthorizerType -> Text
fromAuthorizerType ::
      Core.Text
  }
  deriving stock
    ( Int -> AuthorizerType -> ShowS
[AuthorizerType] -> ShowS
AuthorizerType -> String
(Int -> AuthorizerType -> ShowS)
-> (AuthorizerType -> String)
-> ([AuthorizerType] -> ShowS)
-> Show AuthorizerType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AuthorizerType] -> ShowS
$cshowList :: [AuthorizerType] -> ShowS
show :: AuthorizerType -> String
$cshow :: AuthorizerType -> String
showsPrec :: Int -> AuthorizerType -> ShowS
$cshowsPrec :: Int -> AuthorizerType -> ShowS
Prelude.Show,
      ReadPrec [AuthorizerType]
ReadPrec AuthorizerType
Int -> ReadS AuthorizerType
ReadS [AuthorizerType]
(Int -> ReadS AuthorizerType)
-> ReadS [AuthorizerType]
-> ReadPrec AuthorizerType
-> ReadPrec [AuthorizerType]
-> Read AuthorizerType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AuthorizerType]
$creadListPrec :: ReadPrec [AuthorizerType]
readPrec :: ReadPrec AuthorizerType
$creadPrec :: ReadPrec AuthorizerType
readList :: ReadS [AuthorizerType]
$creadList :: ReadS [AuthorizerType]
readsPrec :: Int -> ReadS AuthorizerType
$creadsPrec :: Int -> ReadS AuthorizerType
Prelude.Read,
      AuthorizerType -> AuthorizerType -> Bool
(AuthorizerType -> AuthorizerType -> Bool)
-> (AuthorizerType -> AuthorizerType -> Bool) -> Eq AuthorizerType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AuthorizerType -> AuthorizerType -> Bool
$c/= :: AuthorizerType -> AuthorizerType -> Bool
== :: AuthorizerType -> AuthorizerType -> Bool
$c== :: AuthorizerType -> AuthorizerType -> Bool
Prelude.Eq,
      Eq AuthorizerType
Eq AuthorizerType
-> (AuthorizerType -> AuthorizerType -> Ordering)
-> (AuthorizerType -> AuthorizerType -> Bool)
-> (AuthorizerType -> AuthorizerType -> Bool)
-> (AuthorizerType -> AuthorizerType -> Bool)
-> (AuthorizerType -> AuthorizerType -> Bool)
-> (AuthorizerType -> AuthorizerType -> AuthorizerType)
-> (AuthorizerType -> AuthorizerType -> AuthorizerType)
-> Ord AuthorizerType
AuthorizerType -> AuthorizerType -> Bool
AuthorizerType -> AuthorizerType -> Ordering
AuthorizerType -> AuthorizerType -> AuthorizerType
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 :: AuthorizerType -> AuthorizerType -> AuthorizerType
$cmin :: AuthorizerType -> AuthorizerType -> AuthorizerType
max :: AuthorizerType -> AuthorizerType -> AuthorizerType
$cmax :: AuthorizerType -> AuthorizerType -> AuthorizerType
>= :: AuthorizerType -> AuthorizerType -> Bool
$c>= :: AuthorizerType -> AuthorizerType -> Bool
> :: AuthorizerType -> AuthorizerType -> Bool
$c> :: AuthorizerType -> AuthorizerType -> Bool
<= :: AuthorizerType -> AuthorizerType -> Bool
$c<= :: AuthorizerType -> AuthorizerType -> Bool
< :: AuthorizerType -> AuthorizerType -> Bool
$c< :: AuthorizerType -> AuthorizerType -> Bool
compare :: AuthorizerType -> AuthorizerType -> Ordering
$ccompare :: AuthorizerType -> AuthorizerType -> Ordering
$cp1Ord :: Eq AuthorizerType
Prelude.Ord,
      (forall x. AuthorizerType -> Rep AuthorizerType x)
-> (forall x. Rep AuthorizerType x -> AuthorizerType)
-> Generic AuthorizerType
forall x. Rep AuthorizerType x -> AuthorizerType
forall x. AuthorizerType -> Rep AuthorizerType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AuthorizerType x -> AuthorizerType
$cfrom :: forall x. AuthorizerType -> Rep AuthorizerType x
Prelude.Generic
    )
  deriving newtype
    ( Int -> AuthorizerType -> Int
AuthorizerType -> Int
(Int -> AuthorizerType -> Int)
-> (AuthorizerType -> Int) -> Hashable AuthorizerType
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: AuthorizerType -> Int
$chash :: AuthorizerType -> Int
hashWithSalt :: Int -> AuthorizerType -> Int
$chashWithSalt :: Int -> AuthorizerType -> Int
Prelude.Hashable,
      AuthorizerType -> ()
(AuthorizerType -> ()) -> NFData AuthorizerType
forall a. (a -> ()) -> NFData a
rnf :: AuthorizerType -> ()
$crnf :: AuthorizerType -> ()
Prelude.NFData,
      Text -> Either String AuthorizerType
(Text -> Either String AuthorizerType) -> FromText AuthorizerType
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String AuthorizerType
$cfromText :: Text -> Either String AuthorizerType
Core.FromText,
      AuthorizerType -> Text
(AuthorizerType -> Text) -> ToText AuthorizerType
forall a. (a -> Text) -> ToText a
toText :: AuthorizerType -> Text
$ctoText :: AuthorizerType -> Text
Core.ToText,
      AuthorizerType -> ByteString
(AuthorizerType -> ByteString) -> ToByteString AuthorizerType
forall a. (a -> ByteString) -> ToByteString a
toBS :: AuthorizerType -> ByteString
$ctoBS :: AuthorizerType -> ByteString
Core.ToByteString,
      AuthorizerType -> ByteStringBuilder
(AuthorizerType -> ByteStringBuilder) -> ToLog AuthorizerType
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: AuthorizerType -> ByteStringBuilder
$cbuild :: AuthorizerType -> ByteStringBuilder
Core.ToLog,
      HeaderName -> AuthorizerType -> [Header]
(HeaderName -> AuthorizerType -> [Header])
-> ToHeader AuthorizerType
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> AuthorizerType -> [Header]
$ctoHeader :: HeaderName -> AuthorizerType -> [Header]
Core.ToHeader,
      AuthorizerType -> QueryString
(AuthorizerType -> QueryString) -> ToQuery AuthorizerType
forall a. (a -> QueryString) -> ToQuery a
toQuery :: AuthorizerType -> QueryString
$ctoQuery :: AuthorizerType -> QueryString
Core.ToQuery,
      Value -> Parser [AuthorizerType]
Value -> Parser AuthorizerType
(Value -> Parser AuthorizerType)
-> (Value -> Parser [AuthorizerType]) -> FromJSON AuthorizerType
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [AuthorizerType]
$cparseJSONList :: Value -> Parser [AuthorizerType]
parseJSON :: Value -> Parser AuthorizerType
$cparseJSON :: Value -> Parser AuthorizerType
Core.FromJSON,
      FromJSONKeyFunction [AuthorizerType]
FromJSONKeyFunction AuthorizerType
FromJSONKeyFunction AuthorizerType
-> FromJSONKeyFunction [AuthorizerType]
-> FromJSONKey AuthorizerType
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [AuthorizerType]
$cfromJSONKeyList :: FromJSONKeyFunction [AuthorizerType]
fromJSONKey :: FromJSONKeyFunction AuthorizerType
$cfromJSONKey :: FromJSONKeyFunction AuthorizerType
Core.FromJSONKey,
      [AuthorizerType] -> Encoding
[AuthorizerType] -> Value
AuthorizerType -> Encoding
AuthorizerType -> Value
(AuthorizerType -> Value)
-> (AuthorizerType -> Encoding)
-> ([AuthorizerType] -> Value)
-> ([AuthorizerType] -> Encoding)
-> ToJSON AuthorizerType
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [AuthorizerType] -> Encoding
$ctoEncodingList :: [AuthorizerType] -> Encoding
toJSONList :: [AuthorizerType] -> Value
$ctoJSONList :: [AuthorizerType] -> Value
toEncoding :: AuthorizerType -> Encoding
$ctoEncoding :: AuthorizerType -> Encoding
toJSON :: AuthorizerType -> Value
$ctoJSON :: AuthorizerType -> Value
Core.ToJSON,
      ToJSONKeyFunction [AuthorizerType]
ToJSONKeyFunction AuthorizerType
ToJSONKeyFunction AuthorizerType
-> ToJSONKeyFunction [AuthorizerType] -> ToJSONKey AuthorizerType
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [AuthorizerType]
$ctoJSONKeyList :: ToJSONKeyFunction [AuthorizerType]
toJSONKey :: ToJSONKeyFunction AuthorizerType
$ctoJSONKey :: ToJSONKeyFunction AuthorizerType
Core.ToJSONKey,
      [Node] -> Either String AuthorizerType
([Node] -> Either String AuthorizerType) -> FromXML AuthorizerType
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String AuthorizerType
$cparseXML :: [Node] -> Either String AuthorizerType
Core.FromXML,
      AuthorizerType -> XML
(AuthorizerType -> XML) -> ToXML AuthorizerType
forall a. (a -> XML) -> ToXML a
toXML :: AuthorizerType -> XML
$ctoXML :: AuthorizerType -> XML
Core.ToXML
    )

pattern AuthorizerType_COGNITO_USER_POOLS :: AuthorizerType
pattern $bAuthorizerType_COGNITO_USER_POOLS :: AuthorizerType
$mAuthorizerType_COGNITO_USER_POOLS :: forall r. AuthorizerType -> (Void# -> r) -> (Void# -> r) -> r
AuthorizerType_COGNITO_USER_POOLS = AuthorizerType' "COGNITO_USER_POOLS"

pattern AuthorizerType_REQUEST :: AuthorizerType
pattern $bAuthorizerType_REQUEST :: AuthorizerType
$mAuthorizerType_REQUEST :: forall r. AuthorizerType -> (Void# -> r) -> (Void# -> r) -> r
AuthorizerType_REQUEST = AuthorizerType' "REQUEST"

pattern AuthorizerType_TOKEN :: AuthorizerType
pattern $bAuthorizerType_TOKEN :: AuthorizerType
$mAuthorizerType_TOKEN :: forall r. AuthorizerType -> (Void# -> r) -> (Void# -> r) -> r
AuthorizerType_TOKEN = AuthorizerType' "TOKEN"

{-# COMPLETE
  AuthorizerType_COGNITO_USER_POOLS,
  AuthorizerType_REQUEST,
  AuthorizerType_TOKEN,
  AuthorizerType'
  #-}