{-# 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.IAM.Types.PolicyUsageType
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IAM.Types.PolicyUsageType
  ( PolicyUsageType
      ( ..,
        PolicyUsageType_PermissionsBoundary,
        PolicyUsageType_PermissionsPolicy
      ),
  )
where

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

-- | The policy usage type that indicates whether the policy is used as a
-- permissions policy or as the permissions boundary for an entity.
--
-- For more information about permissions boundaries, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html Permissions boundaries for IAM identities>
-- in the /IAM User Guide/.
newtype PolicyUsageType = PolicyUsageType'
  { PolicyUsageType -> Text
fromPolicyUsageType ::
      Data.Text
  }
  deriving stock
    ( Int -> PolicyUsageType -> ShowS
[PolicyUsageType] -> ShowS
PolicyUsageType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PolicyUsageType] -> ShowS
$cshowList :: [PolicyUsageType] -> ShowS
show :: PolicyUsageType -> String
$cshow :: PolicyUsageType -> String
showsPrec :: Int -> PolicyUsageType -> ShowS
$cshowsPrec :: Int -> PolicyUsageType -> ShowS
Prelude.Show,
      ReadPrec [PolicyUsageType]
ReadPrec PolicyUsageType
Int -> ReadS PolicyUsageType
ReadS [PolicyUsageType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PolicyUsageType]
$creadListPrec :: ReadPrec [PolicyUsageType]
readPrec :: ReadPrec PolicyUsageType
$creadPrec :: ReadPrec PolicyUsageType
readList :: ReadS [PolicyUsageType]
$creadList :: ReadS [PolicyUsageType]
readsPrec :: Int -> ReadS PolicyUsageType
$creadsPrec :: Int -> ReadS PolicyUsageType
Prelude.Read,
      PolicyUsageType -> PolicyUsageType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PolicyUsageType -> PolicyUsageType -> Bool
$c/= :: PolicyUsageType -> PolicyUsageType -> Bool
== :: PolicyUsageType -> PolicyUsageType -> Bool
$c== :: PolicyUsageType -> PolicyUsageType -> Bool
Prelude.Eq,
      Eq PolicyUsageType
PolicyUsageType -> PolicyUsageType -> Bool
PolicyUsageType -> PolicyUsageType -> Ordering
PolicyUsageType -> PolicyUsageType -> PolicyUsageType
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 :: PolicyUsageType -> PolicyUsageType -> PolicyUsageType
$cmin :: PolicyUsageType -> PolicyUsageType -> PolicyUsageType
max :: PolicyUsageType -> PolicyUsageType -> PolicyUsageType
$cmax :: PolicyUsageType -> PolicyUsageType -> PolicyUsageType
>= :: PolicyUsageType -> PolicyUsageType -> Bool
$c>= :: PolicyUsageType -> PolicyUsageType -> Bool
> :: PolicyUsageType -> PolicyUsageType -> Bool
$c> :: PolicyUsageType -> PolicyUsageType -> Bool
<= :: PolicyUsageType -> PolicyUsageType -> Bool
$c<= :: PolicyUsageType -> PolicyUsageType -> Bool
< :: PolicyUsageType -> PolicyUsageType -> Bool
$c< :: PolicyUsageType -> PolicyUsageType -> Bool
compare :: PolicyUsageType -> PolicyUsageType -> Ordering
$ccompare :: PolicyUsageType -> PolicyUsageType -> Ordering
Prelude.Ord,
      forall x. Rep PolicyUsageType x -> PolicyUsageType
forall x. PolicyUsageType -> Rep PolicyUsageType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PolicyUsageType x -> PolicyUsageType
$cfrom :: forall x. PolicyUsageType -> Rep PolicyUsageType x
Prelude.Generic
    )
  deriving newtype
    ( Eq PolicyUsageType
Int -> PolicyUsageType -> Int
PolicyUsageType -> Int
forall a. Eq a -> (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: PolicyUsageType -> Int
$chash :: PolicyUsageType -> Int
hashWithSalt :: Int -> PolicyUsageType -> Int
$chashWithSalt :: Int -> PolicyUsageType -> Int
Prelude.Hashable,
      PolicyUsageType -> ()
forall a. (a -> ()) -> NFData a
rnf :: PolicyUsageType -> ()
$crnf :: PolicyUsageType -> ()
Prelude.NFData,
      Text -> Either String PolicyUsageType
forall a. (Text -> Either String a) -> FromText a
fromText :: Text -> Either String PolicyUsageType
$cfromText :: Text -> Either String PolicyUsageType
Data.FromText,
      PolicyUsageType -> Text
forall a. (a -> Text) -> ToText a
toText :: PolicyUsageType -> Text
$ctoText :: PolicyUsageType -> Text
Data.ToText,
      PolicyUsageType -> ByteString
forall a. (a -> ByteString) -> ToByteString a
toBS :: PolicyUsageType -> ByteString
$ctoBS :: PolicyUsageType -> ByteString
Data.ToByteString,
      PolicyUsageType -> ByteStringBuilder
forall a. (a -> ByteStringBuilder) -> ToLog a
build :: PolicyUsageType -> ByteStringBuilder
$cbuild :: PolicyUsageType -> ByteStringBuilder
Data.ToLog,
      HeaderName -> PolicyUsageType -> [Header]
forall a. (HeaderName -> a -> [Header]) -> ToHeader a
toHeader :: HeaderName -> PolicyUsageType -> [Header]
$ctoHeader :: HeaderName -> PolicyUsageType -> [Header]
Data.ToHeader,
      PolicyUsageType -> QueryString
forall a. (a -> QueryString) -> ToQuery a
toQuery :: PolicyUsageType -> QueryString
$ctoQuery :: PolicyUsageType -> QueryString
Data.ToQuery,
      Value -> Parser [PolicyUsageType]
Value -> Parser PolicyUsageType
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [PolicyUsageType]
$cparseJSONList :: Value -> Parser [PolicyUsageType]
parseJSON :: Value -> Parser PolicyUsageType
$cparseJSON :: Value -> Parser PolicyUsageType
Data.FromJSON,
      FromJSONKeyFunction [PolicyUsageType]
FromJSONKeyFunction PolicyUsageType
forall a.
FromJSONKeyFunction a -> FromJSONKeyFunction [a] -> FromJSONKey a
fromJSONKeyList :: FromJSONKeyFunction [PolicyUsageType]
$cfromJSONKeyList :: FromJSONKeyFunction [PolicyUsageType]
fromJSONKey :: FromJSONKeyFunction PolicyUsageType
$cfromJSONKey :: FromJSONKeyFunction PolicyUsageType
Data.FromJSONKey,
      [PolicyUsageType] -> Encoding
[PolicyUsageType] -> Value
PolicyUsageType -> Encoding
PolicyUsageType -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [PolicyUsageType] -> Encoding
$ctoEncodingList :: [PolicyUsageType] -> Encoding
toJSONList :: [PolicyUsageType] -> Value
$ctoJSONList :: [PolicyUsageType] -> Value
toEncoding :: PolicyUsageType -> Encoding
$ctoEncoding :: PolicyUsageType -> Encoding
toJSON :: PolicyUsageType -> Value
$ctoJSON :: PolicyUsageType -> Value
Data.ToJSON,
      ToJSONKeyFunction [PolicyUsageType]
ToJSONKeyFunction PolicyUsageType
forall a.
ToJSONKeyFunction a -> ToJSONKeyFunction [a] -> ToJSONKey a
toJSONKeyList :: ToJSONKeyFunction [PolicyUsageType]
$ctoJSONKeyList :: ToJSONKeyFunction [PolicyUsageType]
toJSONKey :: ToJSONKeyFunction PolicyUsageType
$ctoJSONKey :: ToJSONKeyFunction PolicyUsageType
Data.ToJSONKey,
      [Node] -> Either String PolicyUsageType
forall a. ([Node] -> Either String a) -> FromXML a
parseXML :: [Node] -> Either String PolicyUsageType
$cparseXML :: [Node] -> Either String PolicyUsageType
Data.FromXML,
      PolicyUsageType -> XML
forall a. (a -> XML) -> ToXML a
toXML :: PolicyUsageType -> XML
$ctoXML :: PolicyUsageType -> XML
Data.ToXML
    )

pattern PolicyUsageType_PermissionsBoundary :: PolicyUsageType
pattern $bPolicyUsageType_PermissionsBoundary :: PolicyUsageType
$mPolicyUsageType_PermissionsBoundary :: forall {r}. PolicyUsageType -> ((# #) -> r) -> ((# #) -> r) -> r
PolicyUsageType_PermissionsBoundary = PolicyUsageType' "PermissionsBoundary"

pattern PolicyUsageType_PermissionsPolicy :: PolicyUsageType
pattern $bPolicyUsageType_PermissionsPolicy :: PolicyUsageType
$mPolicyUsageType_PermissionsPolicy :: forall {r}. PolicyUsageType -> ((# #) -> r) -> ((# #) -> r) -> r
PolicyUsageType_PermissionsPolicy = PolicyUsageType' "PermissionsPolicy"

{-# COMPLETE
  PolicyUsageType_PermissionsBoundary,
  PolicyUsageType_PermissionsPolicy,
  PolicyUsageType'
  #-}