{-# 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.KeyUsageType
-- 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.KeyUsageType
  ( KeyUsageType
      ( ..,
        KeyUsageType_ENCRYPT_DECRYPT,
        KeyUsageType_SIGN_VERIFY
      ),
  )
where

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

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

pattern KeyUsageType_ENCRYPT_DECRYPT :: KeyUsageType
pattern $bKeyUsageType_ENCRYPT_DECRYPT :: KeyUsageType
$mKeyUsageType_ENCRYPT_DECRYPT :: forall r. KeyUsageType -> (Void# -> r) -> (Void# -> r) -> r
KeyUsageType_ENCRYPT_DECRYPT = KeyUsageType' "ENCRYPT_DECRYPT"

pattern KeyUsageType_SIGN_VERIFY :: KeyUsageType
pattern $bKeyUsageType_SIGN_VERIFY :: KeyUsageType
$mKeyUsageType_SIGN_VERIFY :: forall r. KeyUsageType -> (Void# -> r) -> (Void# -> r) -> r
KeyUsageType_SIGN_VERIFY = KeyUsageType' "SIGN_VERIFY"

{-# COMPLETE
  KeyUsageType_ENCRYPT_DECRYPT,
  KeyUsageType_SIGN_VERIFY,
  KeyUsageType'
  #-}