{-# 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.Grafana.Types.Role
-- 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.Grafana.Types.Role
  ( Role
      ( ..,
        Role_ADMIN,
        Role_EDITOR,
        Role_VIEWER
      ),
  )
where

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

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

pattern Role_ADMIN :: Role
pattern $bRole_ADMIN :: Role
$mRole_ADMIN :: forall {r}. Role -> ((# #) -> r) -> ((# #) -> r) -> r
Role_ADMIN = Role' "ADMIN"

pattern Role_EDITOR :: Role
pattern $bRole_EDITOR :: Role
$mRole_EDITOR :: forall {r}. Role -> ((# #) -> r) -> ((# #) -> r) -> r
Role_EDITOR = Role' "EDITOR"

pattern Role_VIEWER :: Role
pattern $bRole_VIEWER :: Role
$mRole_VIEWER :: forall {r}. Role -> ((# #) -> r) -> ((# #) -> r) -> r
Role_VIEWER = Role' "VIEWER"

{-# COMPLETE
  Role_ADMIN,
  Role_EDITOR,
  Role_VIEWER,
  Role'
  #-}