{-# 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.CloudFront.Types.HttpVersion
-- 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.CloudFront.Types.HttpVersion
  ( HttpVersion
      ( ..,
        HttpVersion_Http1_1,
        HttpVersion_Http2
      ),
  )
where

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

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

pattern HttpVersion_Http1_1 :: HttpVersion
pattern $bHttpVersion_Http1_1 :: HttpVersion
$mHttpVersion_Http1_1 :: forall r. HttpVersion -> (Void# -> r) -> (Void# -> r) -> r
HttpVersion_Http1_1 = HttpVersion' "http1.1"

pattern HttpVersion_Http2 :: HttpVersion
pattern $bHttpVersion_Http2 :: HttpVersion
$mHttpVersion_Http2 :: forall r. HttpVersion -> (Void# -> r) -> (Void# -> r) -> r
HttpVersion_Http2 = HttpVersion' "http2"

{-# COMPLETE
  HttpVersion_Http1_1,
  HttpVersion_Http2,
  HttpVersion'
  #-}