{-# 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.ApiGatewayV2.Types.ProtocolType
-- 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.ApiGatewayV2.Types.ProtocolType
  ( ProtocolType
      ( ..,
        ProtocolType_HTTP,
        ProtocolType_WEBSOCKET
      ),
  )
where

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

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

pattern ProtocolType_HTTP :: ProtocolType
pattern $bProtocolType_HTTP :: ProtocolType
$mProtocolType_HTTP :: forall r. ProtocolType -> (Void# -> r) -> (Void# -> r) -> r
ProtocolType_HTTP = ProtocolType' "HTTP"

pattern ProtocolType_WEBSOCKET :: ProtocolType
pattern $bProtocolType_WEBSOCKET :: ProtocolType
$mProtocolType_WEBSOCKET :: forall r. ProtocolType -> (Void# -> r) -> (Void# -> r) -> r
ProtocolType_WEBSOCKET = ProtocolType' "WEBSOCKET"

{-# COMPLETE
  ProtocolType_HTTP,
  ProtocolType_WEBSOCKET,
  ProtocolType'
  #-}