{-# 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.KeySpec
-- 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.KeySpec
  ( KeySpec
      ( ..,
        KeySpec_ECC_NIST_P256,
        KeySpec_ECC_NIST_P384,
        KeySpec_ECC_NIST_P521,
        KeySpec_ECC_SECG_P256K1,
        KeySpec_RSA_2048,
        KeySpec_RSA_3072,
        KeySpec_RSA_4096,
        KeySpec_SYMMETRIC_DEFAULT
      ),
  )
where

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

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

pattern KeySpec_ECC_NIST_P256 :: KeySpec
pattern $bKeySpec_ECC_NIST_P256 :: KeySpec
$mKeySpec_ECC_NIST_P256 :: forall r. KeySpec -> (Void# -> r) -> (Void# -> r) -> r
KeySpec_ECC_NIST_P256 = KeySpec' "ECC_NIST_P256"

pattern KeySpec_ECC_NIST_P384 :: KeySpec
pattern $bKeySpec_ECC_NIST_P384 :: KeySpec
$mKeySpec_ECC_NIST_P384 :: forall r. KeySpec -> (Void# -> r) -> (Void# -> r) -> r
KeySpec_ECC_NIST_P384 = KeySpec' "ECC_NIST_P384"

pattern KeySpec_ECC_NIST_P521 :: KeySpec
pattern $bKeySpec_ECC_NIST_P521 :: KeySpec
$mKeySpec_ECC_NIST_P521 :: forall r. KeySpec -> (Void# -> r) -> (Void# -> r) -> r
KeySpec_ECC_NIST_P521 = KeySpec' "ECC_NIST_P521"

pattern KeySpec_ECC_SECG_P256K1 :: KeySpec
pattern $bKeySpec_ECC_SECG_P256K1 :: KeySpec
$mKeySpec_ECC_SECG_P256K1 :: forall r. KeySpec -> (Void# -> r) -> (Void# -> r) -> r
KeySpec_ECC_SECG_P256K1 = KeySpec' "ECC_SECG_P256K1"

pattern KeySpec_RSA_2048 :: KeySpec
pattern $bKeySpec_RSA_2048 :: KeySpec
$mKeySpec_RSA_2048 :: forall r. KeySpec -> (Void# -> r) -> (Void# -> r) -> r
KeySpec_RSA_2048 = KeySpec' "RSA_2048"

pattern KeySpec_RSA_3072 :: KeySpec
pattern $bKeySpec_RSA_3072 :: KeySpec
$mKeySpec_RSA_3072 :: forall r. KeySpec -> (Void# -> r) -> (Void# -> r) -> r
KeySpec_RSA_3072 = KeySpec' "RSA_3072"

pattern KeySpec_RSA_4096 :: KeySpec
pattern $bKeySpec_RSA_4096 :: KeySpec
$mKeySpec_RSA_4096 :: forall r. KeySpec -> (Void# -> r) -> (Void# -> r) -> r
KeySpec_RSA_4096 = KeySpec' "RSA_4096"

pattern KeySpec_SYMMETRIC_DEFAULT :: KeySpec
pattern $bKeySpec_SYMMETRIC_DEFAULT :: KeySpec
$mKeySpec_SYMMETRIC_DEFAULT :: forall r. KeySpec -> (Void# -> r) -> (Void# -> r) -> r
KeySpec_SYMMETRIC_DEFAULT = KeySpec' "SYMMETRIC_DEFAULT"

{-# COMPLETE
  KeySpec_ECC_NIST_P256,
  KeySpec_ECC_NIST_P384,
  KeySpec_ECC_NIST_P521,
  KeySpec_ECC_SECG_P256K1,
  KeySpec_RSA_2048,
  KeySpec_RSA_3072,
  KeySpec_RSA_4096,
  KeySpec_SYMMETRIC_DEFAULT,
  KeySpec'
  #-}