Skip to content

Commit 762e8f7

Browse files
feat(api): manual updates (#17)
1 parent 254b61a commit 762e8f7

11 files changed

+97
-50
lines changed

Diff for: .stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 106
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-da4c36c6b1d973f481abb8eefdeb085d88eaf37eeaba30d276cb3daa405b6f0c.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-36f9d46890bf3667f5a6529bdb156fe1560834ad8187c4271aa0b0024de1adb5.yml

Diff for: environment.go

+18-13
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,10 @@ func (r environmentSpecPortJSON) RawJSON() string {
892892
}
893893

894894
type EnvironmentSpecSecret struct {
895-
EnvironmentVariable string `json:"environmentVariable"`
895+
// container_registry_basic_auth_host is the hostname of the container registry
896+
// that supports basic auth
897+
ContainerRegistryBasicAuthHost string `json:"containerRegistryBasicAuthHost"`
898+
EnvironmentVariable string `json:"environmentVariable"`
896899
// file_path is the path inside the devcontainer where the secret is mounted
897900
FilePath string `json:"filePath"`
898901
GitCredentialHost string `json:"gitCredentialHost"`
@@ -911,15 +914,16 @@ type EnvironmentSpecSecret struct {
911914
// environmentSpecSecretJSON contains the JSON metadata for the struct
912915
// [EnvironmentSpecSecret]
913916
type environmentSpecSecretJSON struct {
914-
EnvironmentVariable apijson.Field
915-
FilePath apijson.Field
916-
GitCredentialHost apijson.Field
917-
Name apijson.Field
918-
Session apijson.Field
919-
Source apijson.Field
920-
SourceRef apijson.Field
921-
raw string
922-
ExtraFields map[string]apijson.Field
917+
ContainerRegistryBasicAuthHost apijson.Field
918+
EnvironmentVariable apijson.Field
919+
FilePath apijson.Field
920+
GitCredentialHost apijson.Field
921+
Name apijson.Field
922+
Session apijson.Field
923+
Source apijson.Field
924+
SourceRef apijson.Field
925+
raw string
926+
ExtraFields map[string]apijson.Field
923927
}
924928

925929
func (r *EnvironmentSpecSecret) UnmarshalJSON(data []byte) (err error) {
@@ -1140,7 +1144,10 @@ func (r EnvironmentSpecPortParam) MarshalJSON() (data []byte, err error) {
11401144
}
11411145

11421146
type EnvironmentSpecSecretParam struct {
1143-
EnvironmentVariable param.Field[string] `json:"environmentVariable"`
1147+
// container_registry_basic_auth_host is the hostname of the container registry
1148+
// that supports basic auth
1149+
ContainerRegistryBasicAuthHost param.Field[string] `json:"containerRegistryBasicAuthHost"`
1150+
EnvironmentVariable param.Field[string] `json:"environmentVariable"`
11441151
// file_path is the path inside the devcontainer where the secret is mounted
11451152
FilePath param.Field[string] `json:"filePath"`
11461153
GitCredentialHost param.Field[string] `json:"gitCredentialHost"`
@@ -2231,8 +2238,6 @@ type EnvironmentListParams struct {
22312238
Token param.Field[string] `query:"token"`
22322239
PageSize param.Field[int64] `query:"pageSize"`
22332240
Filter param.Field[EnvironmentListParamsFilter] `json:"filter"`
2234-
// organization_id is the ID of the organization that contains the environments
2235-
OrganizationID param.Field[string] `json:"organizationId" format:"uuid"`
22362241
// pagination contains the pagination options for listing environments
22372242
Pagination param.Field[EnvironmentListParamsPagination] `json:"pagination"`
22382243
}

Diff for: environment_test.go

+16-15
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,14 @@ func TestEnvironmentNewWithOptionalParams(t *testing.T) {
6868
Port: gitpod.F(int64(1)),
6969
}}),
7070
Secrets: gitpod.F([]gitpod.EnvironmentSpecSecretParam{{
71-
EnvironmentVariable: gitpod.F("environmentVariable"),
72-
FilePath: gitpod.F("filePath"),
73-
GitCredentialHost: gitpod.F("gitCredentialHost"),
74-
Name: gitpod.F("name"),
75-
Session: gitpod.F("session"),
76-
Source: gitpod.F("source"),
77-
SourceRef: gitpod.F("sourceRef"),
71+
ContainerRegistryBasicAuthHost: gitpod.F("containerRegistryBasicAuthHost"),
72+
EnvironmentVariable: gitpod.F("environmentVariable"),
73+
FilePath: gitpod.F("filePath"),
74+
GitCredentialHost: gitpod.F("gitCredentialHost"),
75+
Name: gitpod.F("name"),
76+
Session: gitpod.F("session"),
77+
Source: gitpod.F("source"),
78+
SourceRef: gitpod.F("sourceRef"),
7879
}}),
7980
SpecVersion: gitpod.F("specVersion"),
8081
SSHPublicKeys: gitpod.F([]gitpod.EnvironmentSpecSSHPublicKeyParam{{
@@ -210,7 +211,6 @@ func TestEnvironmentListWithOptionalParams(t *testing.T) {
210211
RunnerKinds: gitpod.F([]gitpod.RunnerKind{gitpod.RunnerKindUnspecified}),
211212
StatusPhases: gitpod.F([]gitpod.EnvironmentPhase{gitpod.EnvironmentPhaseUnspecified}),
212213
}),
213-
OrganizationID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
214214
Pagination: gitpod.F(gitpod.EnvironmentListParamsPagination{
215215
Token: gitpod.F("token"),
216216
PageSize: gitpod.F(int64(100)),
@@ -306,13 +306,14 @@ func TestEnvironmentNewFromProjectWithOptionalParams(t *testing.T) {
306306
Port: gitpod.F(int64(1)),
307307
}}),
308308
Secrets: gitpod.F([]gitpod.EnvironmentSpecSecretParam{{
309-
EnvironmentVariable: gitpod.F("environmentVariable"),
310-
FilePath: gitpod.F("filePath"),
311-
GitCredentialHost: gitpod.F("gitCredentialHost"),
312-
Name: gitpod.F("name"),
313-
Session: gitpod.F("session"),
314-
Source: gitpod.F("source"),
315-
SourceRef: gitpod.F("sourceRef"),
309+
ContainerRegistryBasicAuthHost: gitpod.F("containerRegistryBasicAuthHost"),
310+
EnvironmentVariable: gitpod.F("environmentVariable"),
311+
FilePath: gitpod.F("filePath"),
312+
GitCredentialHost: gitpod.F("gitCredentialHost"),
313+
Name: gitpod.F("name"),
314+
Session: gitpod.F("session"),
315+
Source: gitpod.F("source"),
316+
SourceRef: gitpod.F("sourceRef"),
316317
}}),
317318
SpecVersion: gitpod.F("specVersion"),
318319
SSHPublicKeys: gitpod.F([]gitpod.EnvironmentSpecSSHPublicKeyParam{{

Diff for: environmentclass.go

+11
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,22 @@ func (r EnvironmentClassListParams) URLQuery() (v url.Values) {
8484
}
8585

8686
type EnvironmentClassListParamsFilter struct {
87+
// can_create_environments filters the response to only environment classes that
88+
// can be used to create new environments by the caller. Unlike enabled, which
89+
// indicates general availability, this ensures the caller only sees environment
90+
// classes they are allowed to use.
91+
CanCreateEnvironments param.Field[bool] `json:"canCreateEnvironments"`
8792
// enabled filters the response to only enabled or disabled environment classes. If
8893
// not set, all environment classes are returned.
8994
Enabled param.Field[bool] `json:"enabled"`
9095
// runner_ids filters the response to only EnvironmentClasses of these Runner IDs
9196
RunnerIDs param.Field[[]string] `json:"runnerIds" format:"uuid"`
97+
// runner_kind filters the response to only environment classes from runners of
98+
// these kinds.
99+
RunnerKinds param.Field[[]RunnerKind] `json:"runnerKinds"`
100+
// runner_providers filters the response to only environment classes from runners
101+
// of these providers.
102+
RunnerProviders param.Field[[]RunnerProvider] `json:"runnerProviders"`
92103
}
93104

94105
func (r EnvironmentClassListParamsFilter) MarshalJSON() (data []byte, err error) {

Diff for: environmentclass_test.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ func TestEnvironmentClassListWithOptionalParams(t *testing.T) {
3030
Token: gitpod.F("token"),
3131
PageSize: gitpod.F(int64(0)),
3232
Filter: gitpod.F(gitpod.EnvironmentClassListParamsFilter{
33-
Enabled: gitpod.F(true),
34-
RunnerIDs: gitpod.F([]string{"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}),
33+
CanCreateEnvironments: gitpod.F(true),
34+
Enabled: gitpod.F(true),
35+
RunnerIDs: gitpod.F([]string{"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}),
36+
RunnerKinds: gitpod.F([]gitpod.RunnerKind{gitpod.RunnerKindUnspecified}),
37+
RunnerProviders: gitpod.F([]gitpod.RunnerProvider{gitpod.RunnerProviderUnspecified}),
3538
}),
3639
Pagination: gitpod.F(gitpod.EnvironmentClassListParamsPagination{
3740
Token: gitpod.F("token"),

Diff for: event.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,12 @@ const (
114114
ResourceTypeServiceAccount ResourceType = "RESOURCE_TYPE_SERVICE_ACCOUNT"
115115
ResourceTypeSecret ResourceType = "RESOURCE_TYPE_SECRET"
116116
ResourceTypeSSOConfig ResourceType = "RESOURCE_TYPE_SSO_CONFIG"
117+
ResourceTypeDomainVerification ResourceType = "RESOURCE_TYPE_DOMAIN_VERIFICATION"
117118
)
118119

119120
func (r ResourceType) IsKnown() bool {
120121
switch r {
121-
case ResourceTypeUnspecified, ResourceTypeEnvironment, ResourceTypeRunner, ResourceTypeProject, ResourceTypeTask, ResourceTypeTaskExecution, ResourceTypeService, ResourceTypeOrganization, ResourceTypeUser, ResourceTypeEnvironmentClass, ResourceTypeRunnerScmIntegration, ResourceTypeHostAuthenticationToken, ResourceTypeGroup, ResourceTypePersonalAccessToken, ResourceTypeUserPreference, ResourceTypeServiceAccount, ResourceTypeSecret, ResourceTypeSSOConfig:
122+
case ResourceTypeUnspecified, ResourceTypeEnvironment, ResourceTypeRunner, ResourceTypeProject, ResourceTypeTask, ResourceTypeTaskExecution, ResourceTypeService, ResourceTypeOrganization, ResourceTypeUser, ResourceTypeEnvironmentClass, ResourceTypeRunnerScmIntegration, ResourceTypeHostAuthenticationToken, ResourceTypeGroup, ResourceTypePersonalAccessToken, ResourceTypeUserPreference, ResourceTypeServiceAccount, ResourceTypeSecret, ResourceTypeSSOConfig, ResourceTypeDomainVerification:
122123
return true
123124
}
124125
return false

Diff for: projectpolicy.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,12 @@ const (
110110
ProjectRoleUnspecified ProjectRole = "PROJECT_ROLE_UNSPECIFIED"
111111
ProjectRoleAdmin ProjectRole = "PROJECT_ROLE_ADMIN"
112112
ProjectRoleUser ProjectRole = "PROJECT_ROLE_USER"
113+
ProjectRoleEditor ProjectRole = "PROJECT_ROLE_EDITOR"
113114
)
114115

115116
func (r ProjectRole) IsKnown() bool {
116117
switch r {
117-
case ProjectRoleUnspecified, ProjectRoleAdmin, ProjectRoleUser:
118+
case ProjectRoleUnspecified, ProjectRoleAdmin, ProjectRoleUser, ProjectRoleEditor:
118119
return true
119120
}
120121
return false

Diff for: runnerconfigurationenvironmentclass.go

+11
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,22 @@ func (r RunnerConfigurationEnvironmentClassListParams) URLQuery() (v url.Values)
181181
}
182182

183183
type RunnerConfigurationEnvironmentClassListParamsFilter struct {
184+
// can_create_environments filters the response to only environment classes that
185+
// can be used to create new environments by the caller. Unlike enabled, which
186+
// indicates general availability, this ensures the caller only sees environment
187+
// classes they are allowed to use.
188+
CanCreateEnvironments param.Field[bool] `json:"canCreateEnvironments"`
184189
// enabled filters the response to only enabled or disabled environment classes. If
185190
// not set, all environment classes are returned.
186191
Enabled param.Field[bool] `json:"enabled"`
187192
// runner_ids filters the response to only EnvironmentClasses of these Runner IDs
188193
RunnerIDs param.Field[[]string] `json:"runnerIds" format:"uuid"`
194+
// runner_kind filters the response to only environment classes from runners of
195+
// these kinds.
196+
RunnerKinds param.Field[[]RunnerKind] `json:"runnerKinds"`
197+
// runner_providers filters the response to only environment classes from runners
198+
// of these providers.
199+
RunnerProviders param.Field[[]RunnerProvider] `json:"runnerProviders"`
189200
}
190201

191202
func (r RunnerConfigurationEnvironmentClassListParamsFilter) MarshalJSON() (data []byte, err error) {

Diff for: runnerconfigurationenvironmentclass_test.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,11 @@ func TestRunnerConfigurationEnvironmentClassListWithOptionalParams(t *testing.T)
115115
Token: gitpod.F("token"),
116116
PageSize: gitpod.F(int64(0)),
117117
Filter: gitpod.F(gitpod.RunnerConfigurationEnvironmentClassListParamsFilter{
118-
Enabled: gitpod.F(true),
119-
RunnerIDs: gitpod.F([]string{"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}),
118+
CanCreateEnvironments: gitpod.F(true),
119+
Enabled: gitpod.F(true),
120+
RunnerIDs: gitpod.F([]string{"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}),
121+
RunnerKinds: gitpod.F([]gitpod.RunnerKind{gitpod.RunnerKindUnspecified}),
122+
RunnerProviders: gitpod.F([]gitpod.RunnerProvider{gitpod.RunnerProviderUnspecified}),
120123
}),
121124
Pagination: gitpod.F(gitpod.RunnerConfigurationEnvironmentClassListParamsPagination{
122125
Token: gitpod.F("token"),

Diff for: secret.go

+20-10
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ func (r *SecretService) UpdateValue(ctx context.Context, body SecretUpdateValueP
9494

9595
type Secret struct {
9696
ID string `json:"id" format:"uuid"`
97+
// secret will be mounted as a registry secret
98+
ContainerRegistryBasicAuthHost string `json:"containerRegistryBasicAuthHost"`
9799
// A Timestamp represents a point in time independent of any time zone or local
98100
// calendar, encoded as a count of seconds and fractions of seconds at nanosecond
99101
// resolution. The count is relative to an epoch at UTC midnight on January 1,
@@ -288,16 +290,17 @@ type Secret struct {
288290

289291
// secretJSON contains the JSON metadata for the struct [Secret]
290292
type secretJSON struct {
291-
ID apijson.Field
292-
CreatedAt apijson.Field
293-
Creator apijson.Field
294-
EnvironmentVariable apijson.Field
295-
FilePath apijson.Field
296-
Name apijson.Field
297-
ProjectID apijson.Field
298-
UpdatedAt apijson.Field
299-
raw string
300-
ExtraFields map[string]apijson.Field
293+
ID apijson.Field
294+
ContainerRegistryBasicAuthHost apijson.Field
295+
CreatedAt apijson.Field
296+
Creator apijson.Field
297+
EnvironmentVariable apijson.Field
298+
FilePath apijson.Field
299+
Name apijson.Field
300+
ProjectID apijson.Field
301+
UpdatedAt apijson.Field
302+
raw string
303+
ExtraFields map[string]apijson.Field
301304
}
302305

303306
func (r *Secret) UnmarshalJSON(data []byte) (err error) {
@@ -355,6 +358,13 @@ func (r secretGetValueResponseJSON) RawJSON() string {
355358
type SecretUpdateValueResponse = interface{}
356359

357360
type SecretNewParams struct {
361+
// secret will be mounted as a docker config in the environment VM, mount will have
362+
// the docker host value must be a valid registry hostname with optional port:
363+
//
364+
// ```
365+
// this.matches('^[a-zA-Z0-9][a-zA-Z0-9.-]*[a-zA-Z0-9](:[0-9]+)?$')
366+
// ```
367+
ContainerRegistryBasicAuthHost param.Field[string] `json:"containerRegistryBasicAuthHost"`
358368
// secret will be created as an Environment Variable with the same name as the
359369
// secret
360370
EnvironmentVariable param.Field[bool] `json:"environmentVariable"`

Diff for: secret_test.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ func TestSecretNewWithOptionalParams(t *testing.T) {
2727
option.WithBearerToken("My Bearer Token"),
2828
)
2929
_, err := client.Secrets.New(context.TODO(), gitpod.SecretNewParams{
30-
EnvironmentVariable: gitpod.F(true),
31-
FilePath: gitpod.F("filePath"),
32-
Name: gitpod.F("name"),
33-
ProjectID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
34-
Value: gitpod.F("x"),
30+
ContainerRegistryBasicAuthHost: gitpod.F("containerRegistryBasicAuthHost"),
31+
EnvironmentVariable: gitpod.F(true),
32+
FilePath: gitpod.F("filePath"),
33+
Name: gitpod.F("name"),
34+
ProjectID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
35+
Value: gitpod.F("x"),
3536
})
3637
if err != nil {
3738
var apierr *gitpod.Error

0 commit comments

Comments
 (0)