{-# 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.Environment where
import Amazonka.Cloud9.Types.ConnectionType
import Amazonka.Cloud9.Types.EnvironmentLifecycle
import Amazonka.Cloud9.Types.EnvironmentType
import Amazonka.Cloud9.Types.ManagedCredentialsStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Environment = Environment'
{
Environment -> Maybe EnvironmentLifecycle
lifecycle :: Prelude.Maybe EnvironmentLifecycle,
Environment -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Environment -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Environment -> Maybe ConnectionType
connectionType :: Prelude.Maybe ConnectionType,
Environment -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
Environment -> Maybe ManagedCredentialsStatus
managedCredentialsStatus :: Prelude.Maybe ManagedCredentialsStatus,
Environment -> EnvironmentType
type' :: EnvironmentType,
Environment -> Text
arn :: Prelude.Text,
Environment -> Text
ownerArn :: Prelude.Text
}
deriving (Environment -> Environment -> Bool
(Environment -> Environment -> Bool)
-> (Environment -> Environment -> Bool) -> Eq Environment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Environment -> Environment -> Bool
$c/= :: Environment -> Environment -> Bool
== :: Environment -> Environment -> Bool
$c== :: Environment -> Environment -> Bool
Prelude.Eq, Int -> Environment -> ShowS
[Environment] -> ShowS
Environment -> String
(Int -> Environment -> ShowS)
-> (Environment -> String)
-> ([Environment] -> ShowS)
-> Show Environment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Environment] -> ShowS
$cshowList :: [Environment] -> ShowS
show :: Environment -> String
$cshow :: Environment -> String
showsPrec :: Int -> Environment -> ShowS
$cshowsPrec :: Int -> Environment -> ShowS
Prelude.Show, (forall x. Environment -> Rep Environment x)
-> (forall x. Rep Environment x -> Environment)
-> Generic Environment
forall x. Rep Environment x -> Environment
forall x. Environment -> Rep Environment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Environment x -> Environment
$cfrom :: forall x. Environment -> Rep Environment x
Prelude.Generic)
newEnvironment ::
EnvironmentType ->
Prelude.Text ->
Prelude.Text ->
Environment
newEnvironment :: EnvironmentType -> Text -> Text -> Environment
newEnvironment EnvironmentType
pType_ Text
pArn_ Text
pOwnerArn_ =
Environment' :: Maybe EnvironmentLifecycle
-> Maybe Text
-> Maybe Text
-> Maybe ConnectionType
-> Maybe (Sensitive Text)
-> Maybe ManagedCredentialsStatus
-> EnvironmentType
-> Text
-> Text
-> Environment
Environment'
{ $sel:lifecycle:Environment' :: Maybe EnvironmentLifecycle
lifecycle = Maybe EnvironmentLifecycle
forall a. Maybe a
Prelude.Nothing,
$sel:name:Environment' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:Environment' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:connectionType:Environment' :: Maybe ConnectionType
connectionType = Maybe ConnectionType
forall a. Maybe a
Prelude.Nothing,
$sel:description:Environment' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:managedCredentialsStatus:Environment' :: Maybe ManagedCredentialsStatus
managedCredentialsStatus = Maybe ManagedCredentialsStatus
forall a. Maybe a
Prelude.Nothing,
$sel:type':Environment' :: EnvironmentType
type' = EnvironmentType
pType_,
$sel:arn:Environment' :: Text
arn = Text
pArn_,
$sel:ownerArn:Environment' :: Text
ownerArn = Text
pOwnerArn_
}
environment_lifecycle :: Lens.Lens' Environment (Prelude.Maybe EnvironmentLifecycle)
environment_lifecycle :: (Maybe EnvironmentLifecycle -> f (Maybe EnvironmentLifecycle))
-> Environment -> f Environment
environment_lifecycle = (Environment -> Maybe EnvironmentLifecycle)
-> (Environment -> Maybe EnvironmentLifecycle -> Environment)
-> Lens
Environment
Environment
(Maybe EnvironmentLifecycle)
(Maybe EnvironmentLifecycle)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Maybe EnvironmentLifecycle
lifecycle :: Maybe EnvironmentLifecycle
$sel:lifecycle:Environment' :: Environment -> Maybe EnvironmentLifecycle
lifecycle} -> Maybe EnvironmentLifecycle
lifecycle) (\s :: Environment
s@Environment' {} Maybe EnvironmentLifecycle
a -> Environment
s {$sel:lifecycle:Environment' :: Maybe EnvironmentLifecycle
lifecycle = Maybe EnvironmentLifecycle
a} :: Environment)
environment_name :: Lens.Lens' Environment (Prelude.Maybe Prelude.Text)
environment_name :: (Maybe Text -> f (Maybe Text)) -> Environment -> f Environment
environment_name = (Environment -> Maybe Text)
-> (Environment -> Maybe Text -> Environment)
-> Lens Environment Environment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Maybe Text
name :: Maybe Text
$sel:name:Environment' :: Environment -> Maybe Text
name} -> Maybe Text
name) (\s :: Environment
s@Environment' {} Maybe Text
a -> Environment
s {$sel:name:Environment' :: Maybe Text
name = Maybe Text
a} :: Environment)
environment_id :: Lens.Lens' Environment (Prelude.Maybe Prelude.Text)
environment_id :: (Maybe Text -> f (Maybe Text)) -> Environment -> f Environment
environment_id = (Environment -> Maybe Text)
-> (Environment -> Maybe Text -> Environment)
-> Lens Environment Environment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Maybe Text
id :: Maybe Text
$sel:id:Environment' :: Environment -> Maybe Text
id} -> Maybe Text
id) (\s :: Environment
s@Environment' {} Maybe Text
a -> Environment
s {$sel:id:Environment' :: Maybe Text
id = Maybe Text
a} :: Environment)
environment_connectionType :: Lens.Lens' Environment (Prelude.Maybe ConnectionType)
environment_connectionType :: (Maybe ConnectionType -> f (Maybe ConnectionType))
-> Environment -> f Environment
environment_connectionType = (Environment -> Maybe ConnectionType)
-> (Environment -> Maybe ConnectionType -> Environment)
-> Lens
Environment
Environment
(Maybe ConnectionType)
(Maybe ConnectionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Maybe ConnectionType
connectionType :: Maybe ConnectionType
$sel:connectionType:Environment' :: Environment -> Maybe ConnectionType
connectionType} -> Maybe ConnectionType
connectionType) (\s :: Environment
s@Environment' {} Maybe ConnectionType
a -> Environment
s {$sel:connectionType:Environment' :: Maybe ConnectionType
connectionType = Maybe ConnectionType
a} :: Environment)
environment_description :: Lens.Lens' Environment (Prelude.Maybe Prelude.Text)
environment_description :: (Maybe Text -> f (Maybe Text)) -> Environment -> f Environment
environment_description = (Environment -> Maybe (Sensitive Text))
-> (Environment -> Maybe (Sensitive Text) -> Environment)
-> Lens
Environment
Environment
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:Environment' :: Environment -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: Environment
s@Environment' {} Maybe (Sensitive Text)
a -> Environment
s {$sel:description:Environment' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: Environment) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> Environment -> f Environment)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Environment
-> f Environment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
environment_managedCredentialsStatus :: Lens.Lens' Environment (Prelude.Maybe ManagedCredentialsStatus)
environment_managedCredentialsStatus :: (Maybe ManagedCredentialsStatus
-> f (Maybe ManagedCredentialsStatus))
-> Environment -> f Environment
environment_managedCredentialsStatus = (Environment -> Maybe ManagedCredentialsStatus)
-> (Environment -> Maybe ManagedCredentialsStatus -> Environment)
-> Lens
Environment
Environment
(Maybe ManagedCredentialsStatus)
(Maybe ManagedCredentialsStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Maybe ManagedCredentialsStatus
managedCredentialsStatus :: Maybe ManagedCredentialsStatus
$sel:managedCredentialsStatus:Environment' :: Environment -> Maybe ManagedCredentialsStatus
managedCredentialsStatus} -> Maybe ManagedCredentialsStatus
managedCredentialsStatus) (\s :: Environment
s@Environment' {} Maybe ManagedCredentialsStatus
a -> Environment
s {$sel:managedCredentialsStatus:Environment' :: Maybe ManagedCredentialsStatus
managedCredentialsStatus = Maybe ManagedCredentialsStatus
a} :: Environment)
environment_type :: Lens.Lens' Environment EnvironmentType
environment_type :: (EnvironmentType -> f EnvironmentType)
-> Environment -> f Environment
environment_type = (Environment -> EnvironmentType)
-> (Environment -> EnvironmentType -> Environment)
-> Lens Environment Environment EnvironmentType EnvironmentType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {EnvironmentType
type' :: EnvironmentType
$sel:type':Environment' :: Environment -> EnvironmentType
type'} -> EnvironmentType
type') (\s :: Environment
s@Environment' {} EnvironmentType
a -> Environment
s {$sel:type':Environment' :: EnvironmentType
type' = EnvironmentType
a} :: Environment)
environment_arn :: Lens.Lens' Environment Prelude.Text
environment_arn :: (Text -> f Text) -> Environment -> f Environment
environment_arn = (Environment -> Text)
-> (Environment -> Text -> Environment)
-> Lens Environment Environment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Text
arn :: Text
$sel:arn:Environment' :: Environment -> Text
arn} -> Text
arn) (\s :: Environment
s@Environment' {} Text
a -> Environment
s {$sel:arn:Environment' :: Text
arn = Text
a} :: Environment)
environment_ownerArn :: Lens.Lens' Environment Prelude.Text
environment_ownerArn :: (Text -> f Text) -> Environment -> f Environment
environment_ownerArn = (Environment -> Text)
-> (Environment -> Text -> Environment)
-> Lens Environment Environment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Text
ownerArn :: Text
$sel:ownerArn:Environment' :: Environment -> Text
ownerArn} -> Text
ownerArn) (\s :: Environment
s@Environment' {} Text
a -> Environment
s {$sel:ownerArn:Environment' :: Text
ownerArn = Text
a} :: Environment)
instance Core.FromJSON Environment where
parseJSON :: Value -> Parser Environment
parseJSON =
String
-> (Object -> Parser Environment) -> Value -> Parser Environment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Environment"
( \Object
x ->
Maybe EnvironmentLifecycle
-> Maybe Text
-> Maybe Text
-> Maybe ConnectionType
-> Maybe (Sensitive Text)
-> Maybe ManagedCredentialsStatus
-> EnvironmentType
-> Text
-> Text
-> Environment
Environment'
(Maybe EnvironmentLifecycle
-> Maybe Text
-> Maybe Text
-> Maybe ConnectionType
-> Maybe (Sensitive Text)
-> Maybe ManagedCredentialsStatus
-> EnvironmentType
-> Text
-> Text
-> Environment)
-> Parser (Maybe EnvironmentLifecycle)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe ConnectionType
-> Maybe (Sensitive Text)
-> Maybe ManagedCredentialsStatus
-> EnvironmentType
-> Text
-> Text
-> Environment)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe EnvironmentLifecycle)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lifecycle")
Parser
(Maybe Text
-> Maybe Text
-> Maybe ConnectionType
-> Maybe (Sensitive Text)
-> Maybe ManagedCredentialsStatus
-> EnvironmentType
-> Text
-> Text
-> Environment)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe ConnectionType
-> Maybe (Sensitive Text)
-> Maybe ManagedCredentialsStatus
-> EnvironmentType
-> Text
-> Text
-> Environment)
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
"name")
Parser
(Maybe Text
-> Maybe ConnectionType
-> Maybe (Sensitive Text)
-> Maybe ManagedCredentialsStatus
-> EnvironmentType
-> Text
-> Text
-> Environment)
-> Parser (Maybe Text)
-> Parser
(Maybe ConnectionType
-> Maybe (Sensitive Text)
-> Maybe ManagedCredentialsStatus
-> EnvironmentType
-> Text
-> Text
-> Environment)
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
"id")
Parser
(Maybe ConnectionType
-> Maybe (Sensitive Text)
-> Maybe ManagedCredentialsStatus
-> EnvironmentType
-> Text
-> Text
-> Environment)
-> Parser (Maybe ConnectionType)
-> Parser
(Maybe (Sensitive Text)
-> Maybe ManagedCredentialsStatus
-> EnvironmentType
-> Text
-> Text
-> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ConnectionType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"connectionType")
Parser
(Maybe (Sensitive Text)
-> Maybe ManagedCredentialsStatus
-> EnvironmentType
-> Text
-> Text
-> Environment)
-> Parser (Maybe (Sensitive Text))
-> Parser
(Maybe ManagedCredentialsStatus
-> EnvironmentType -> Text -> Text -> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
Parser
(Maybe ManagedCredentialsStatus
-> EnvironmentType -> Text -> Text -> Environment)
-> Parser (Maybe ManagedCredentialsStatus)
-> Parser (EnvironmentType -> Text -> Text -> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ManagedCredentialsStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"managedCredentialsStatus")
Parser (EnvironmentType -> Text -> Text -> Environment)
-> Parser EnvironmentType -> Parser (Text -> Text -> Environment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser EnvironmentType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"type")
Parser (Text -> Text -> Environment)
-> Parser Text -> Parser (Text -> Environment)
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
"arn")
Parser (Text -> Environment) -> Parser Text -> Parser Environment
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
"ownerArn")
)
instance Prelude.Hashable Environment
instance Prelude.NFData Environment