{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data Permission = Permission'
{
Permission -> Maybe Bool
allowSsh :: Prelude.Maybe Prelude.Bool,
Permission -> Maybe Bool
allowSudo :: Prelude.Maybe Prelude.Bool,
Permission -> Maybe Text
iamUserArn :: Prelude.Maybe Prelude.Text,
Permission -> Maybe Text
level :: Prelude.Maybe Prelude.Text,
Permission -> Maybe Text
stackId :: Prelude.Maybe Prelude.Text
}
deriving (Permission -> Permission -> Bool
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]
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
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. 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'
{ $sel:allowSsh:Permission' :: Maybe Bool
allowSsh = forall a. Maybe a
Prelude.Nothing,
$sel:allowSudo:Permission' :: Maybe Bool
allowSudo = forall a. Maybe a
Prelude.Nothing,
$sel:iamUserArn:Permission' :: Maybe Text
iamUserArn = forall a. Maybe a
Prelude.Nothing,
$sel:level:Permission' :: Maybe Text
level = forall a. Maybe a
Prelude.Nothing,
$sel:stackId:Permission' :: Maybe Text
stackId = forall a. Maybe a
Prelude.Nothing
}
permission_allowSsh :: Lens.Lens' Permission (Prelude.Maybe Prelude.Bool)
permission_allowSsh :: Lens' Permission (Maybe Bool)
permission_allowSsh = 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)
permission_allowSudo :: Lens.Lens' Permission (Prelude.Maybe Prelude.Bool)
permission_allowSudo :: Lens' Permission (Maybe Bool)
permission_allowSudo = 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_iamUserArn :: Lens.Lens' Permission (Prelude.Maybe Prelude.Text)
permission_iamUserArn :: Lens' Permission (Maybe Text)
permission_iamUserArn = 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_level :: Lens.Lens' Permission (Prelude.Maybe Prelude.Text)
permission_level :: Lens' Permission (Maybe Text)
permission_level = 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_stackId :: Lens.Lens' Permission (Prelude.Maybe Prelude.Text)
permission_stackId :: Lens' Permission (Maybe Text)
permission_stackId = 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)
instance Data.FromJSON Permission where
parseJSON :: Value -> Parser Permission
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Permission"
( \Object
x ->
Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Permission
Permission'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AllowSsh")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AllowSudo")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IamUserArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Level")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StackId")
)
instance Prelude.Hashable Permission where
hashWithSalt :: Int -> Permission -> Int
hashWithSalt Int
_salt Permission' {Maybe Bool
Maybe Text
stackId :: Maybe Text
level :: Maybe Text
iamUserArn :: Maybe Text
allowSudo :: Maybe Bool
allowSsh :: Maybe Bool
$sel:stackId:Permission' :: Permission -> Maybe Text
$sel:level:Permission' :: Permission -> Maybe Text
$sel:iamUserArn:Permission' :: Permission -> Maybe Text
$sel:allowSudo:Permission' :: Permission -> Maybe Bool
$sel:allowSsh:Permission' :: Permission -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
allowSsh
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
allowSudo
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
iamUserArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
level
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stackId
instance Prelude.NFData Permission where
rnf :: Permission -> ()
rnf Permission' {Maybe Bool
Maybe Text
stackId :: Maybe Text
level :: Maybe Text
iamUserArn :: Maybe Text
allowSudo :: Maybe Bool
allowSsh :: Maybe Bool
$sel:stackId:Permission' :: Permission -> Maybe Text
$sel:level:Permission' :: Permission -> Maybe Text
$sel:iamUserArn:Permission' :: Permission -> Maybe Text
$sel:allowSudo:Permission' :: Permission -> Maybe Bool
$sel:allowSsh:Permission' :: Permission -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
allowSsh
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
allowSudo
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
iamUserArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
level
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stackId