{-# 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.Greengrass.Types.Permission
-- 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.Greengrass.Types.Permission
  ( Permission
      ( ..,
        Permission_Ro,
        Permission_Rw
      ),
  )
where

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

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

pattern Permission_Ro :: Permission
pattern $bPermission_Ro :: Permission
$mPermission_Ro :: forall r. Permission -> (Void# -> r) -> (Void# -> r) -> r
Permission_Ro = Permission' "ro"

pattern Permission_Rw :: Permission
pattern $bPermission_Rw :: Permission
$mPermission_Rw :: forall r. Permission -> (Void# -> r) -> (Void# -> r) -> r
Permission_Rw = Permission' "rw"

{-# COMPLETE
  Permission_Ro,
  Permission_Rw,
  Permission'
  #-}