{-# 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.Redshift.Types.SortByOrder
-- 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.Redshift.Types.SortByOrder
  ( SortByOrder
      ( ..,
        SortByOrder_ASC,
        SortByOrder_DESC
      ),
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Internal

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

pattern SortByOrder_ASC :: SortByOrder
pattern $bSortByOrder_ASC :: SortByOrder
$mSortByOrder_ASC :: forall r. SortByOrder -> (Void# -> r) -> (Void# -> r) -> r
SortByOrder_ASC = SortByOrder' "ASC"

pattern SortByOrder_DESC :: SortByOrder
pattern $bSortByOrder_DESC :: SortByOrder
$mSortByOrder_DESC :: forall r. SortByOrder -> (Void# -> r) -> (Void# -> r) -> r
SortByOrder_DESC = SortByOrder' "DESC"

{-# COMPLETE
  SortByOrder_ASC,
  SortByOrder_DESC,
  SortByOrder'
  #-}