{-# 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.CachePolicyType
-- 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.CachePolicyType
  ( CachePolicyType
      ( ..,
        CachePolicyType_Custom,
        CachePolicyType_Managed
      ),
  )
where

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

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

pattern CachePolicyType_Custom :: CachePolicyType
pattern $bCachePolicyType_Custom :: CachePolicyType
$mCachePolicyType_Custom :: forall r. CachePolicyType -> (Void# -> r) -> (Void# -> r) -> r
CachePolicyType_Custom = CachePolicyType' "custom"

pattern CachePolicyType_Managed :: CachePolicyType
pattern $bCachePolicyType_Managed :: CachePolicyType
$mCachePolicyType_Managed :: forall r. CachePolicyType -> (Void# -> r) -> (Void# -> r) -> r
CachePolicyType_Managed = CachePolicyType' "managed"

{-# COMPLETE
  CachePolicyType_Custom,
  CachePolicyType_Managed,
  CachePolicyType'
  #-}