{-# 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.ContentHandlingStrategy
-- 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.ContentHandlingStrategy
  ( ContentHandlingStrategy
      ( ..,
        ContentHandlingStrategy_CONVERT_TO_BINARY,
        ContentHandlingStrategy_CONVERT_TO_TEXT
      ),
  )
where

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

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

pattern ContentHandlingStrategy_CONVERT_TO_BINARY :: ContentHandlingStrategy
pattern $bContentHandlingStrategy_CONVERT_TO_BINARY :: ContentHandlingStrategy
$mContentHandlingStrategy_CONVERT_TO_BINARY :: forall r.
ContentHandlingStrategy -> (Void# -> r) -> (Void# -> r) -> r
ContentHandlingStrategy_CONVERT_TO_BINARY = ContentHandlingStrategy' "CONVERT_TO_BINARY"

pattern ContentHandlingStrategy_CONVERT_TO_TEXT :: ContentHandlingStrategy
pattern $bContentHandlingStrategy_CONVERT_TO_TEXT :: ContentHandlingStrategy
$mContentHandlingStrategy_CONVERT_TO_TEXT :: forall r.
ContentHandlingStrategy -> (Void# -> r) -> (Void# -> r) -> r
ContentHandlingStrategy_CONVERT_TO_TEXT = ContentHandlingStrategy' "CONVERT_TO_TEXT"

{-# COMPLETE
  ContentHandlingStrategy_CONVERT_TO_BINARY,
  ContentHandlingStrategy_CONVERT_TO_TEXT,
  ContentHandlingStrategy'
  #-}