{-# 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.DynamoDB.Types.KeyType
-- 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.DynamoDB.Types.KeyType
  ( KeyType
      ( ..,
        KeyType_HASH,
        KeyType_RANGE
      ),
  )
where

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

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

pattern KeyType_HASH :: KeyType
pattern $bKeyType_HASH :: KeyType
$mKeyType_HASH :: forall r. KeyType -> (Void# -> r) -> (Void# -> r) -> r
KeyType_HASH = KeyType' "HASH"

pattern KeyType_RANGE :: KeyType
pattern $bKeyType_RANGE :: KeyType
$mKeyType_RANGE :: forall r. KeyType -> (Void# -> r) -> (Void# -> r) -> r
KeyType_RANGE = KeyType' "RANGE"

{-# COMPLETE
  KeyType_HASH,
  KeyType_RANGE,
  KeyType'
  #-}