{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Cloud9.UpdateEnvironment
(
UpdateEnvironment (..),
newUpdateEnvironment,
updateEnvironment_managedCredentialsAction,
updateEnvironment_name,
updateEnvironment_description,
updateEnvironment_environmentId,
UpdateEnvironmentResponse (..),
newUpdateEnvironmentResponse,
updateEnvironmentResponse_httpStatus,
)
where
import Amazonka.Cloud9.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateEnvironment = UpdateEnvironment'
{
UpdateEnvironment -> Maybe ManagedCredentialsAction
managedCredentialsAction :: Prelude.Maybe ManagedCredentialsAction,
UpdateEnvironment -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
UpdateEnvironment -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Core.Sensitive Prelude.Text),
UpdateEnvironment -> Text
environmentId :: Prelude.Text
}
deriving (UpdateEnvironment -> UpdateEnvironment -> Bool
(UpdateEnvironment -> UpdateEnvironment -> Bool)
-> (UpdateEnvironment -> UpdateEnvironment -> Bool)
-> Eq UpdateEnvironment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEnvironment -> UpdateEnvironment -> Bool
$c/= :: UpdateEnvironment -> UpdateEnvironment -> Bool
== :: UpdateEnvironment -> UpdateEnvironment -> Bool
$c== :: UpdateEnvironment -> UpdateEnvironment -> Bool
Prelude.Eq, Int -> UpdateEnvironment -> ShowS
[UpdateEnvironment] -> ShowS
UpdateEnvironment -> String
(Int -> UpdateEnvironment -> ShowS)
-> (UpdateEnvironment -> String)
-> ([UpdateEnvironment] -> ShowS)
-> Show UpdateEnvironment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEnvironment] -> ShowS
$cshowList :: [UpdateEnvironment] -> ShowS
show :: UpdateEnvironment -> String
$cshow :: UpdateEnvironment -> String
showsPrec :: Int -> UpdateEnvironment -> ShowS
$cshowsPrec :: Int -> UpdateEnvironment -> ShowS
Prelude.Show, (forall x. UpdateEnvironment -> Rep UpdateEnvironment x)
-> (forall x. Rep UpdateEnvironment x -> UpdateEnvironment)
-> Generic UpdateEnvironment
forall x. Rep UpdateEnvironment x -> UpdateEnvironment
forall x. UpdateEnvironment -> Rep UpdateEnvironment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateEnvironment x -> UpdateEnvironment
$cfrom :: forall x. UpdateEnvironment -> Rep UpdateEnvironment x
Prelude.Generic)
newUpdateEnvironment ::
Prelude.Text ->
UpdateEnvironment
newUpdateEnvironment :: Text -> UpdateEnvironment
newUpdateEnvironment Text
pEnvironmentId_ =
UpdateEnvironment' :: Maybe ManagedCredentialsAction
-> Maybe Text
-> Maybe (Sensitive Text)
-> Text
-> UpdateEnvironment
UpdateEnvironment'
{ $sel:managedCredentialsAction:UpdateEnvironment' :: Maybe ManagedCredentialsAction
managedCredentialsAction =
Maybe ManagedCredentialsAction
forall a. Maybe a
Prelude.Nothing,
$sel:name:UpdateEnvironment' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdateEnvironment' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:environmentId:UpdateEnvironment' :: Text
environmentId = Text
pEnvironmentId_
}
updateEnvironment_managedCredentialsAction :: Lens.Lens' UpdateEnvironment (Prelude.Maybe ManagedCredentialsAction)
updateEnvironment_managedCredentialsAction :: (Maybe ManagedCredentialsAction
-> f (Maybe ManagedCredentialsAction))
-> UpdateEnvironment -> f UpdateEnvironment
updateEnvironment_managedCredentialsAction = (UpdateEnvironment -> Maybe ManagedCredentialsAction)
-> (UpdateEnvironment
-> Maybe ManagedCredentialsAction -> UpdateEnvironment)
-> Lens
UpdateEnvironment
UpdateEnvironment
(Maybe ManagedCredentialsAction)
(Maybe ManagedCredentialsAction)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnvironment' {Maybe ManagedCredentialsAction
managedCredentialsAction :: Maybe ManagedCredentialsAction
$sel:managedCredentialsAction:UpdateEnvironment' :: UpdateEnvironment -> Maybe ManagedCredentialsAction
managedCredentialsAction} -> Maybe ManagedCredentialsAction
managedCredentialsAction) (\s :: UpdateEnvironment
s@UpdateEnvironment' {} Maybe ManagedCredentialsAction
a -> UpdateEnvironment
s {$sel:managedCredentialsAction:UpdateEnvironment' :: Maybe ManagedCredentialsAction
managedCredentialsAction = Maybe ManagedCredentialsAction
a} :: UpdateEnvironment)
updateEnvironment_name :: Lens.Lens' UpdateEnvironment (Prelude.Maybe Prelude.Text)
updateEnvironment_name :: (Maybe Text -> f (Maybe Text))
-> UpdateEnvironment -> f UpdateEnvironment
updateEnvironment_name = (UpdateEnvironment -> Maybe Text)
-> (UpdateEnvironment -> Maybe Text -> UpdateEnvironment)
-> Lens
UpdateEnvironment UpdateEnvironment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnvironment' {Maybe Text
name :: Maybe Text
$sel:name:UpdateEnvironment' :: UpdateEnvironment -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateEnvironment
s@UpdateEnvironment' {} Maybe Text
a -> UpdateEnvironment
s {$sel:name:UpdateEnvironment' :: Maybe Text
name = Maybe Text
a} :: UpdateEnvironment)
updateEnvironment_description :: Lens.Lens' UpdateEnvironment (Prelude.Maybe Prelude.Text)
updateEnvironment_description :: (Maybe Text -> f (Maybe Text))
-> UpdateEnvironment -> f UpdateEnvironment
updateEnvironment_description = (UpdateEnvironment -> Maybe (Sensitive Text))
-> (UpdateEnvironment
-> Maybe (Sensitive Text) -> UpdateEnvironment)
-> Lens
UpdateEnvironment
UpdateEnvironment
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnvironment' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:UpdateEnvironment' :: UpdateEnvironment -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: UpdateEnvironment
s@UpdateEnvironment' {} Maybe (Sensitive Text)
a -> UpdateEnvironment
s {$sel:description:UpdateEnvironment' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: UpdateEnvironment) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> UpdateEnvironment -> f UpdateEnvironment)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> UpdateEnvironment
-> f UpdateEnvironment
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
updateEnvironment_environmentId :: Lens.Lens' UpdateEnvironment Prelude.Text
updateEnvironment_environmentId :: (Text -> f Text) -> UpdateEnvironment -> f UpdateEnvironment
updateEnvironment_environmentId = (UpdateEnvironment -> Text)
-> (UpdateEnvironment -> Text -> UpdateEnvironment)
-> Lens UpdateEnvironment UpdateEnvironment Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnvironment' {Text
environmentId :: Text
$sel:environmentId:UpdateEnvironment' :: UpdateEnvironment -> Text
environmentId} -> Text
environmentId) (\s :: UpdateEnvironment
s@UpdateEnvironment' {} Text
a -> UpdateEnvironment
s {$sel:environmentId:UpdateEnvironment' :: Text
environmentId = Text
a} :: UpdateEnvironment)
instance Core.AWSRequest UpdateEnvironment where
type
AWSResponse UpdateEnvironment =
UpdateEnvironmentResponse
request :: UpdateEnvironment -> Request UpdateEnvironment
request = Service -> UpdateEnvironment -> Request UpdateEnvironment
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateEnvironment
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateEnvironment)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateEnvironment))
-> Logger
-> Service
-> Proxy UpdateEnvironment
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateEnvironment)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateEnvironmentResponse
UpdateEnvironmentResponse'
(Int -> UpdateEnvironmentResponse)
-> Either String Int -> Either String UpdateEnvironmentResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable UpdateEnvironment
instance Prelude.NFData UpdateEnvironment
instance Core.ToHeaders UpdateEnvironment where
toHeaders :: UpdateEnvironment -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateEnvironment -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSCloud9WorkspaceManagementService.UpdateEnvironment" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateEnvironment where
toJSON :: UpdateEnvironment -> Value
toJSON UpdateEnvironment' {Maybe Text
Maybe (Sensitive Text)
Maybe ManagedCredentialsAction
Text
environmentId :: Text
description :: Maybe (Sensitive Text)
name :: Maybe Text
managedCredentialsAction :: Maybe ManagedCredentialsAction
$sel:environmentId:UpdateEnvironment' :: UpdateEnvironment -> Text
$sel:description:UpdateEnvironment' :: UpdateEnvironment -> Maybe (Sensitive Text)
$sel:name:UpdateEnvironment' :: UpdateEnvironment -> Maybe Text
$sel:managedCredentialsAction:UpdateEnvironment' :: UpdateEnvironment -> Maybe ManagedCredentialsAction
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"managedCredentialsAction" Text -> ManagedCredentialsAction -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ManagedCredentialsAction -> Pair)
-> Maybe ManagedCredentialsAction -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ManagedCredentialsAction
managedCredentialsAction,
(Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
(Text
"description" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
description,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"environmentId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
environmentId)
]
)
instance Core.ToPath UpdateEnvironment where
toPath :: UpdateEnvironment -> ByteString
toPath = ByteString -> UpdateEnvironment -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateEnvironment where
toQuery :: UpdateEnvironment -> QueryString
toQuery = QueryString -> UpdateEnvironment -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateEnvironmentResponse = UpdateEnvironmentResponse'
{
UpdateEnvironmentResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateEnvironmentResponse -> UpdateEnvironmentResponse -> Bool
(UpdateEnvironmentResponse -> UpdateEnvironmentResponse -> Bool)
-> (UpdateEnvironmentResponse -> UpdateEnvironmentResponse -> Bool)
-> Eq UpdateEnvironmentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEnvironmentResponse -> UpdateEnvironmentResponse -> Bool
$c/= :: UpdateEnvironmentResponse -> UpdateEnvironmentResponse -> Bool
== :: UpdateEnvironmentResponse -> UpdateEnvironmentResponse -> Bool
$c== :: UpdateEnvironmentResponse -> UpdateEnvironmentResponse -> Bool
Prelude.Eq, ReadPrec [UpdateEnvironmentResponse]
ReadPrec UpdateEnvironmentResponse
Int -> ReadS UpdateEnvironmentResponse
ReadS [UpdateEnvironmentResponse]
(Int -> ReadS UpdateEnvironmentResponse)
-> ReadS [UpdateEnvironmentResponse]
-> ReadPrec UpdateEnvironmentResponse
-> ReadPrec [UpdateEnvironmentResponse]
-> Read UpdateEnvironmentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEnvironmentResponse]
$creadListPrec :: ReadPrec [UpdateEnvironmentResponse]
readPrec :: ReadPrec UpdateEnvironmentResponse
$creadPrec :: ReadPrec UpdateEnvironmentResponse
readList :: ReadS [UpdateEnvironmentResponse]
$creadList :: ReadS [UpdateEnvironmentResponse]
readsPrec :: Int -> ReadS UpdateEnvironmentResponse
$creadsPrec :: Int -> ReadS UpdateEnvironmentResponse
Prelude.Read, Int -> UpdateEnvironmentResponse -> ShowS
[UpdateEnvironmentResponse] -> ShowS
UpdateEnvironmentResponse -> String
(Int -> UpdateEnvironmentResponse -> ShowS)
-> (UpdateEnvironmentResponse -> String)
-> ([UpdateEnvironmentResponse] -> ShowS)
-> Show UpdateEnvironmentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEnvironmentResponse] -> ShowS
$cshowList :: [UpdateEnvironmentResponse] -> ShowS
show :: UpdateEnvironmentResponse -> String
$cshow :: UpdateEnvironmentResponse -> String
showsPrec :: Int -> UpdateEnvironmentResponse -> ShowS
$cshowsPrec :: Int -> UpdateEnvironmentResponse -> ShowS
Prelude.Show, (forall x.
UpdateEnvironmentResponse -> Rep UpdateEnvironmentResponse x)
-> (forall x.
Rep UpdateEnvironmentResponse x -> UpdateEnvironmentResponse)
-> Generic UpdateEnvironmentResponse
forall x.
Rep UpdateEnvironmentResponse x -> UpdateEnvironmentResponse
forall x.
UpdateEnvironmentResponse -> Rep UpdateEnvironmentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEnvironmentResponse x -> UpdateEnvironmentResponse
$cfrom :: forall x.
UpdateEnvironmentResponse -> Rep UpdateEnvironmentResponse x
Prelude.Generic)
newUpdateEnvironmentResponse ::
Prelude.Int ->
UpdateEnvironmentResponse
newUpdateEnvironmentResponse :: Int -> UpdateEnvironmentResponse
newUpdateEnvironmentResponse Int
pHttpStatus_ =
UpdateEnvironmentResponse' :: Int -> UpdateEnvironmentResponse
UpdateEnvironmentResponse'
{ $sel:httpStatus:UpdateEnvironmentResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateEnvironmentResponse_httpStatus :: Lens.Lens' UpdateEnvironmentResponse Prelude.Int
updateEnvironmentResponse_httpStatus :: (Int -> f Int)
-> UpdateEnvironmentResponse -> f UpdateEnvironmentResponse
updateEnvironmentResponse_httpStatus = (UpdateEnvironmentResponse -> Int)
-> (UpdateEnvironmentResponse -> Int -> UpdateEnvironmentResponse)
-> Lens UpdateEnvironmentResponse UpdateEnvironmentResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnvironmentResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateEnvironmentResponse' :: UpdateEnvironmentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateEnvironmentResponse
s@UpdateEnvironmentResponse' {} Int
a -> UpdateEnvironmentResponse
s {$sel:httpStatus:UpdateEnvironmentResponse' :: Int
httpStatus = Int
a} :: UpdateEnvironmentResponse)
instance Prelude.NFData UpdateEnvironmentResponse