{-# 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.KMS.Types.DataKeySpec
-- 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.KMS.Types.DataKeySpec
  ( DataKeySpec
      ( ..,
        DataKeySpec_AES_128,
        DataKeySpec_AES_256
      ),
  )
where

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

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

pattern DataKeySpec_AES_128 :: DataKeySpec
pattern $bDataKeySpec_AES_128 :: DataKeySpec
$mDataKeySpec_AES_128 :: forall r. DataKeySpec -> (Void# -> r) -> (Void# -> r) -> r
DataKeySpec_AES_128 = DataKeySpec' "AES_128"

pattern DataKeySpec_AES_256 :: DataKeySpec
pattern $bDataKeySpec_AES_256 :: DataKeySpec
$mDataKeySpec_AES_256 :: forall r. DataKeySpec -> (Void# -> r) -> (Void# -> r) -> r
DataKeySpec_AES_256 = DataKeySpec' "AES_256"

{-# COMPLETE
  DataKeySpec_AES_128,
  DataKeySpec_AES_256,
  DataKeySpec'
  #-}