{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.OpsWorks.Types.Permission where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Permission = Permission'
{
Permission -> Maybe Text
iamUserArn :: Prelude.Maybe Prelude.Text,
Permission -> Maybe Bool
allowSudo :: Prelude.Maybe Prelude.Bool,
Permission -> Maybe Text
stackId :: Prelude.Maybe Prelude.Text,
Permission -> Maybe Text
level :: Prelude.Maybe Prelude.Text,
Permission -> Maybe Bool
allowSsh :: Prelude.Maybe Prelude.Bool
}
deriving (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, 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, 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, (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)
newPermission ::
Permission
newPermission :: Permission
newPermission =
Permission' :: Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Permission
Permission'
{ $sel:iamUserArn:Permission' :: Maybe Text
iamUserArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:allowSudo:Permission' :: Maybe Bool
allowSudo = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:stackId:Permission' :: Maybe Text
stackId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:level:Permission' :: Maybe Text
level = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:allowSsh:Permission' :: Maybe Bool
allowSsh = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
permission_iamUserArn :: Lens.Lens' Permission (Prelude.Maybe Prelude.Text)
permission_iamUserArn :: (Maybe Text -> f (Maybe Text)) -> Permission -> f Permission
permission_iamUserArn = (Permission -> Maybe Text)
-> (Permission -> Maybe Text -> Permission)
-> Lens Permission Permission (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Permission' {Maybe Text
iamUserArn :: Maybe Text
$sel:iamUserArn:Permission' :: Permission -> Maybe Text
iamUserArn} -> Maybe Text
iamUserArn) (\s :: Permission
s@Permission' {} Maybe Text
a -> Permission
s {$sel:iamUserArn:Permission' :: Maybe Text
iamUserArn = Maybe Text
a} :: Permission)
permission_allowSudo :: Lens.Lens' Permission (Prelude.Maybe Prelude.Bool)
permission_allowSudo :: (Maybe Bool -> f (Maybe Bool)) -> Permission -> f Permission
permission_allowSudo = (Permission -> Maybe Bool)
-> (Permission -> Maybe Bool -> Permission)
-> Lens Permission Permission (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Permission' {Maybe Bool
allowSudo :: Maybe Bool
$sel:allowSudo:Permission' :: Permission -> Maybe Bool
allowSudo} -> Maybe Bool
allowSudo) (\s :: Permission
s@Permission' {} Maybe Bool
a -> Permission
s {$sel:allowSudo:Permission' :: Maybe Bool
allowSudo = Maybe Bool
a} :: Permission)
permission_stackId :: Lens.Lens' Permission (Prelude.Maybe Prelude.Text)
permission_stackId :: (Maybe Text -> f (Maybe Text)) -> Permission -> f Permission
permission_stackId = (Permission -> Maybe Text)
-> (Permission -> Maybe Text -> Permission)
-> Lens Permission Permission (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Permission' {Maybe Text
stackId :: Maybe Text
$sel:stackId:Permission' :: Permission -> Maybe Text
stackId} -> Maybe Text
stackId) (\s :: Permission
s@Permission' {} Maybe Text
a -> Permission
s {$sel:stackId:Permission' :: Maybe Text
stackId = Maybe Text
a} :: Permission)
permission_level :: Lens.Lens' Permission (Prelude.Maybe Prelude.Text)
permission_level :: (Maybe Text -> f (Maybe Text)) -> Permission -> f Permission
permission_level = (Permission -> Maybe Text)
-> (Permission -> Maybe Text -> Permission)
-> Lens Permission Permission (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Permission' {Maybe Text
level :: Maybe Text
$sel:level:Permission' :: Permission -> Maybe Text
level} -> Maybe Text
level) (\s :: Permission
s@Permission' {} Maybe Text
a -> Permission
s {$sel:level:Permission' :: Maybe Text
level = Maybe Text
a} :: Permission)
permission_allowSsh :: Lens.Lens' Permission (Prelude.Maybe Prelude.Bool)
permission_allowSsh :: (Maybe Bool -> f (Maybe Bool)) -> Permission -> f Permission
permission_allowSsh = (Permission -> Maybe Bool)
-> (Permission -> Maybe Bool -> Permission)
-> Lens Permission Permission (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Permission' {Maybe Bool
allowSsh :: Maybe Bool
$sel:allowSsh:Permission' :: Permission -> Maybe Bool
allowSsh} -> Maybe Bool
allowSsh) (\s :: Permission
s@Permission' {} Maybe Bool
a -> Permission
s {$sel:allowSsh:Permission' :: Maybe Bool
allowSsh = Maybe Bool
a} :: Permission)
instance Core.FromJSON Permission where
parseJSON :: Value -> Parser Permission
parseJSON =
String
-> (Object -> Parser Permission) -> Value -> Parser Permission
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Permission"
( \Object
x ->
Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Permission
Permission'
(Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Permission)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool
-> Maybe Text -> Maybe Text -> Maybe Bool -> Permission)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IamUserArn")
Parser
(Maybe Bool
-> Maybe Text -> Maybe Text -> Maybe Bool -> Permission)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Maybe Text -> Maybe Bool -> Permission)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AllowSudo")
Parser (Maybe Text -> Maybe Text -> Maybe Bool -> Permission)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Bool -> Permission)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StackId")
Parser (Maybe Text -> Maybe Bool -> Permission)
-> Parser (Maybe Text) -> Parser (Maybe Bool -> Permission)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Level")
Parser (Maybe Bool -> Permission)
-> Parser (Maybe Bool) -> Parser Permission
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AllowSsh")
)
instance Prelude.Hashable Permission
instance Prelude.NFData Permission