Skip to content

Commit 04616ff

Browse files
feat(api): manual updates
1 parent ccca7e5 commit 04616ff

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 119
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-c850a6432597255fc1b788ba21a0494162e639f41dd80c0f9d07def239d31865.yml
3-
openapi_spec_hash: fba3f62e51d3ba39eea280abe29f39f1
4-
config_hash: 8e3b8fba844b78950ad4a13b75b7fffc
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-ca9a49ac7fbb63f55611fd7cd48a22a3ff8b38a797125c8513e891d9b7345550.yml
3+
openapi_spec_hash: fd6ffbdfaefcc555e61ca1c565e05214
4+
config_hash: bb9d0a0bdadbee0985dd7c1e4f0e9e8a

environment.go

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,15 +2001,24 @@ type EnvironmentUpdateParams struct {
20012001
// environment_id specifies which environment should be updated.
20022002
//
20032003
// +required
2004-
EnvironmentID param.Field[string] `json:"environmentId" format:"uuid"`
2005-
Metadata param.Field[interface{}] `json:"metadata"`
2006-
Spec param.Field[EnvironmentUpdateParamsSpec] `json:"spec"`
2004+
EnvironmentID param.Field[string] `json:"environmentId" format:"uuid"`
2005+
Metadata param.Field[EnvironmentUpdateParamsMetadata] `json:"metadata"`
2006+
Spec param.Field[EnvironmentUpdateParamsSpec] `json:"spec"`
20072007
}
20082008

20092009
func (r EnvironmentUpdateParams) MarshalJSON() (data []byte, err error) {
20102010
return apijson.MarshalRoot(r)
20112011
}
20122012

2013+
type EnvironmentUpdateParamsMetadata struct {
2014+
// name is the user-defined display name of the environment
2015+
Name param.Field[string] `json:"name"`
2016+
}
2017+
2018+
func (r EnvironmentUpdateParamsMetadata) MarshalJSON() (data []byte, err error) {
2019+
return apijson.MarshalRoot(r)
2020+
}
2021+
20132022
type EnvironmentUpdateParamsSpec struct {
20142023
// automations_file is the automations file spec of the environment
20152024
AutomationsFile param.Field[EnvironmentUpdateParamsSpecAutomationsFile] `json:"automationsFile"`

environment_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ func TestEnvironmentUpdateWithOptionalParams(t *testing.T) {
141141
)
142142
_, err := client.Environments.Update(context.TODO(), gitpod.EnvironmentUpdateParams{
143143
EnvironmentID: gitpod.F("07e03a28-65a5-4d98-b532-8ea67b188048"),
144-
Metadata: gitpod.F[any](map[string]interface{}{}),
144+
Metadata: gitpod.F(gitpod.EnvironmentUpdateParamsMetadata{
145+
Name: gitpod.F("name"),
146+
}),
145147
Spec: gitpod.F(gitpod.EnvironmentUpdateParamsSpec{
146148
AutomationsFile: gitpod.F(gitpod.EnvironmentUpdateParamsSpecAutomationsFile{
147149
AutomationsFilePath: gitpod.F("automationsFilePath"),

0 commit comments

Comments
 (0)