{-# 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.Cloud9.Types.EnvironmentMember where
import Amazonka.Cloud9.Types.Permissions
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EnvironmentMember = EnvironmentMember'
{
EnvironmentMember -> Maybe POSIX
lastAccess :: Prelude.Maybe Core.POSIX,
EnvironmentMember -> Permissions
permissions :: Permissions,
EnvironmentMember -> Text
userId :: Prelude.Text,
EnvironmentMember -> Text
userArn :: Prelude.Text,
EnvironmentMember -> Text
environmentId :: Prelude.Text
}
deriving (EnvironmentMember -> EnvironmentMember -> Bool
(EnvironmentMember -> EnvironmentMember -> Bool)
-> (EnvironmentMember -> EnvironmentMember -> Bool)
-> Eq EnvironmentMember
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnvironmentMember -> EnvironmentMember -> Bool
$c/= :: EnvironmentMember -> EnvironmentMember -> Bool
== :: EnvironmentMember -> EnvironmentMember -> Bool
$c== :: EnvironmentMember -> EnvironmentMember -> Bool
Prelude.Eq, ReadPrec [EnvironmentMember]
ReadPrec EnvironmentMember
Int -> ReadS EnvironmentMember
ReadS [EnvironmentMember]
(Int -> ReadS EnvironmentMember)
-> ReadS [EnvironmentMember]
-> ReadPrec EnvironmentMember
-> ReadPrec [EnvironmentMember]
-> Read EnvironmentMember
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnvironmentMember]
$creadListPrec :: ReadPrec [EnvironmentMember]
readPrec :: ReadPrec EnvironmentMember
$creadPrec :: ReadPrec EnvironmentMember
readList :: ReadS [EnvironmentMember]
$creadList :: ReadS [EnvironmentMember]
readsPrec :: Int -> ReadS EnvironmentMember
$creadsPrec :: Int -> ReadS EnvironmentMember
Prelude.Read, Int -> EnvironmentMember -> ShowS
[EnvironmentMember] -> ShowS
EnvironmentMember -> String
(Int -> EnvironmentMember -> ShowS)
-> (EnvironmentMember -> String)
-> ([EnvironmentMember] -> ShowS)
-> Show EnvironmentMember
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnvironmentMember] -> ShowS
$cshowList :: [EnvironmentMember] -> ShowS
show :: EnvironmentMember -> String
$cshow :: EnvironmentMember -> String
showsPrec :: Int -> EnvironmentMember -> ShowS
$cshowsPrec :: Int -> EnvironmentMember -> ShowS
Prelude.Show, (forall x. EnvironmentMember -> Rep EnvironmentMember x)
-> (forall x. Rep EnvironmentMember x -> EnvironmentMember)
-> Generic EnvironmentMember
forall x. Rep EnvironmentMember x -> EnvironmentMember
forall x. EnvironmentMember -> Rep EnvironmentMember x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnvironmentMember x -> EnvironmentMember
$cfrom :: forall x. EnvironmentMember -> Rep EnvironmentMember x
Prelude.Generic)
newEnvironmentMember ::
Permissions ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
EnvironmentMember
newEnvironmentMember :: Permissions -> Text -> Text -> Text -> EnvironmentMember
newEnvironmentMember
Permissions
pPermissions_
Text
pUserId_
Text
pUserArn_
Text
pEnvironmentId_ =
EnvironmentMember' :: Maybe POSIX
-> Permissions -> Text -> Text -> Text -> EnvironmentMember
EnvironmentMember'
{ $sel:lastAccess:EnvironmentMember' :: Maybe POSIX
lastAccess = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:permissions:EnvironmentMember' :: Permissions
permissions = Permissions
pPermissions_,
$sel:userId:EnvironmentMember' :: Text
userId = Text
pUserId_,
$sel:userArn:EnvironmentMember' :: Text
userArn = Text
pUserArn_,
$sel:environmentId:EnvironmentMember' :: Text
environmentId = Text
pEnvironmentId_
}
environmentMember_lastAccess :: Lens.Lens' EnvironmentMember (Prelude.Maybe Prelude.UTCTime)
environmentMember_lastAccess :: (Maybe UTCTime -> f (Maybe UTCTime))
-> EnvironmentMember -> f EnvironmentMember
environmentMember_lastAccess = (EnvironmentMember -> Maybe POSIX)
-> (EnvironmentMember -> Maybe POSIX -> EnvironmentMember)
-> Lens
EnvironmentMember EnvironmentMember (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentMember' {Maybe POSIX
lastAccess :: Maybe POSIX
$sel:lastAccess:EnvironmentMember' :: EnvironmentMember -> Maybe POSIX
lastAccess} -> Maybe POSIX
lastAccess) (\s :: EnvironmentMember
s@EnvironmentMember' {} Maybe POSIX
a -> EnvironmentMember
s {$sel:lastAccess:EnvironmentMember' :: Maybe POSIX
lastAccess = Maybe POSIX
a} :: EnvironmentMember) ((Maybe POSIX -> f (Maybe POSIX))
-> EnvironmentMember -> f EnvironmentMember)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> EnvironmentMember
-> f EnvironmentMember
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
environmentMember_permissions :: Lens.Lens' EnvironmentMember Permissions
environmentMember_permissions :: (Permissions -> f Permissions)
-> EnvironmentMember -> f EnvironmentMember
environmentMember_permissions = (EnvironmentMember -> Permissions)
-> (EnvironmentMember -> Permissions -> EnvironmentMember)
-> Lens EnvironmentMember EnvironmentMember Permissions Permissions
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentMember' {Permissions
permissions :: Permissions
$sel:permissions:EnvironmentMember' :: EnvironmentMember -> Permissions
permissions} -> Permissions
permissions) (\s :: EnvironmentMember
s@EnvironmentMember' {} Permissions
a -> EnvironmentMember
s {$sel:permissions:EnvironmentMember' :: Permissions
permissions = Permissions
a} :: EnvironmentMember)
environmentMember_userId :: Lens.Lens' EnvironmentMember Prelude.Text
environmentMember_userId :: (Text -> f Text) -> EnvironmentMember -> f EnvironmentMember
environmentMember_userId = (EnvironmentMember -> Text)
-> (EnvironmentMember -> Text -> EnvironmentMember)
-> Lens EnvironmentMember EnvironmentMember Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentMember' {Text
userId :: Text
$sel:userId:EnvironmentMember' :: EnvironmentMember -> Text
userId} -> Text
userId) (\s :: EnvironmentMember
s@EnvironmentMember' {} Text
a -> EnvironmentMember
s {$sel:userId:EnvironmentMember' :: Text
userId = Text
a} :: EnvironmentMember)
environmentMember_userArn :: Lens.Lens' EnvironmentMember Prelude.Text
environmentMember_userArn :: (Text -> f Text) -> EnvironmentMember -> f EnvironmentMember
environmentMember_userArn = (EnvironmentMember -> Text)
-> (EnvironmentMember -> Text -> EnvironmentMember)
-> Lens EnvironmentMember EnvironmentMember Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentMember' {Text
userArn :: Text
$sel:userArn:EnvironmentMember' :: EnvironmentMember -> Text
userArn} -> Text
userArn) (\s :: EnvironmentMember
s@EnvironmentMember' {} Text
a -> EnvironmentMember
s {$sel:userArn:EnvironmentMember' :: Text
userArn = Text
a} :: EnvironmentMember)
environmentMember_environmentId :: Lens.Lens' EnvironmentMember Prelude.Text
environmentMember_environmentId :: (Text -> f Text) -> EnvironmentMember -> f EnvironmentMember
environmentMember_environmentId = (EnvironmentMember -> Text)
-> (EnvironmentMember -> Text -> EnvironmentMember)
-> Lens EnvironmentMember EnvironmentMember Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnvironmentMember' {Text
environmentId :: Text
$sel:environmentId:EnvironmentMember' :: EnvironmentMember -> Text
environmentId} -> Text
environmentId) (\s :: EnvironmentMember
s@EnvironmentMember' {} Text
a -> EnvironmentMember
s {$sel:environmentId:EnvironmentMember' :: Text
environmentId = Text
a} :: EnvironmentMember)
instance Core.FromJSON EnvironmentMember where
parseJSON :: Value -> Parser EnvironmentMember
parseJSON =
String
-> (Object -> Parser EnvironmentMember)
-> Value
-> Parser EnvironmentMember
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EnvironmentMember"
( \Object
x ->
Maybe POSIX
-> Permissions -> Text -> Text -> Text -> EnvironmentMember
EnvironmentMember'
(Maybe POSIX
-> Permissions -> Text -> Text -> Text -> EnvironmentMember)
-> Parser (Maybe POSIX)
-> Parser
(Permissions -> Text -> Text -> Text -> EnvironmentMember)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastAccess")
Parser (Permissions -> Text -> Text -> Text -> EnvironmentMember)
-> Parser Permissions
-> Parser (Text -> Text -> Text -> EnvironmentMember)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Permissions
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"permissions")
Parser (Text -> Text -> Text -> EnvironmentMember)
-> Parser Text -> Parser (Text -> Text -> EnvironmentMember)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"userId")
Parser (Text -> Text -> EnvironmentMember)
-> Parser Text -> Parser (Text -> EnvironmentMember)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"userArn")
Parser (Text -> EnvironmentMember)
-> Parser Text -> Parser EnvironmentMember
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"environmentId")
)
instance Prelude.Hashable EnvironmentMember
instance Prelude.NFData EnvironmentMember