{-# 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.CachePolicyHeaderBehavior
-- 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.CachePolicyHeaderBehavior
  ( CachePolicyHeaderBehavior
      ( ..,
        CachePolicyHeaderBehavior_None,
        CachePolicyHeaderBehavior_Whitelist
      ),
  )
where

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

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

pattern CachePolicyHeaderBehavior_None :: CachePolicyHeaderBehavior
pattern $bCachePolicyHeaderBehavior_None :: CachePolicyHeaderBehavior
$mCachePolicyHeaderBehavior_None :: forall r.
CachePolicyHeaderBehavior -> (Void# -> r) -> (Void# -> r) -> r
CachePolicyHeaderBehavior_None = CachePolicyHeaderBehavior' "none"

pattern CachePolicyHeaderBehavior_Whitelist :: CachePolicyHeaderBehavior
pattern $bCachePolicyHeaderBehavior_Whitelist :: CachePolicyHeaderBehavior
$mCachePolicyHeaderBehavior_Whitelist :: forall r.
CachePolicyHeaderBehavior -> (Void# -> r) -> (Void# -> r) -> r
CachePolicyHeaderBehavior_Whitelist = CachePolicyHeaderBehavior' "whitelist"

{-# COMPLETE
  CachePolicyHeaderBehavior_None,
  CachePolicyHeaderBehavior_Whitelist,
  CachePolicyHeaderBehavior'
  #-}