Skip to content

Commit 22863b2

Browse files
feat(api): manual updates (#36)
1 parent 6246721 commit 22863b2

24 files changed

+1200
-129
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 111
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-0c37e687e2a070abfe49501156af6d906ff166b6eaad779ee6c2b568515f2b7e.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-f6598ab5d6827f66b642201769e92590ea32af84ebbf24b18cc32b33dee5107e.yml

account.go

+121-8
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,119 @@ func NewAccountService(opts ...option.RequestOption) (r *AccountService) {
3636
return
3737
}
3838

39-
// GetAccount retrieves a single Account.
39+
// Gets information about the currently authenticated account.
40+
//
41+
// Use this method to:
42+
//
43+
// - Retrieve account profile information
44+
// - Check organization memberships
45+
// - View account settings
46+
// - Get joinable organizations
47+
//
48+
// ### Examples
49+
//
50+
// - Get account details:
51+
//
52+
// Retrieves information about the authenticated account.
53+
//
54+
// ```yaml
55+
// {}
56+
// ```
4057
func (r *AccountService) Get(ctx context.Context, body AccountGetParams, opts ...option.RequestOption) (res *AccountGetResponse, err error) {
4158
opts = append(r.Options[:], opts...)
4259
path := "gitpod.v1.AccountService/GetAccount"
4360
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
4461
return
4562
}
4663

47-
// DeleteAccount deletes an Account. To Delete an Account, the Account must not be
48-
// an active member of any Organization.
64+
// Deletes an account permanently.
65+
//
66+
// Use this method to:
67+
//
68+
// - Remove unused accounts
69+
// - Clean up test accounts
70+
// - Complete account deletion requests
71+
//
72+
// The account must not be an active member of any organization.
73+
//
74+
// ### Examples
75+
//
76+
// - Delete account:
77+
//
78+
// Permanently removes an account.
79+
//
80+
// ```yaml
81+
// accountId: "f53d2330-3795-4c5d-a1f3-453121af9c60"
82+
// ```
4983
func (r *AccountService) Delete(ctx context.Context, body AccountDeleteParams, opts ...option.RequestOption) (res *AccountDeleteResponse, err error) {
5084
opts = append(r.Options[:], opts...)
5185
path := "gitpod.v1.AccountService/DeleteAccount"
5286
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
5387
return
5488
}
5589

56-
// GetSSOLoginURL returns the URL to redirect the user to for SSO login.
90+
// Gets the SSO login URL for a specific email domain.
91+
//
92+
// Use this method to:
93+
//
94+
// - Initiate SSO authentication
95+
// - Get organization-specific login URLs
96+
// - Handle SSO redirects
97+
//
98+
// ### Examples
99+
//
100+
// - Get login URL:
101+
//
102+
// Retrieves SSO URL for email domain.
103+
//
104+
// ```yaml
105+
// email: "[email protected]"
106+
// ```
107+
//
108+
// - Get URL with return path:
109+
//
110+
// Gets SSO URL with specific return location.
111+
//
112+
// ```yaml
113+
// email: "[email protected]"
114+
// returnTo: "https://gitpod.io/workspaces"
115+
// ```
57116
func (r *AccountService) GetSSOLoginURL(ctx context.Context, body AccountGetSSOLoginURLParams, opts ...option.RequestOption) (res *AccountGetSSOLoginURLResponse, err error) {
58117
opts = append(r.Options[:], opts...)
59118
path := "gitpod.v1.AccountService/GetSSOLoginURL"
60119
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
61120
return
62121
}
63122

64-
// ListLoginProviders returns the list of login providers matching the provided
65-
// filters.
123+
// Lists available login providers with optional filtering.
124+
//
125+
// Use this method to:
126+
//
127+
// - View supported authentication methods
128+
// - Get provider-specific login URLs
129+
// - Filter providers by invite
130+
//
131+
// ### Examples
132+
//
133+
// - List all providers:
134+
//
135+
// Shows all available login providers.
136+
//
137+
// ```yaml
138+
// pagination:
139+
// pageSize: 20
140+
// ```
141+
//
142+
// - List for specific invite:
143+
//
144+
// Shows providers available for an invite.
145+
//
146+
// ```yaml
147+
// filter:
148+
// inviteId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
149+
// pagination:
150+
// pageSize: 20
151+
// ```
66152
func (r *AccountService) ListLoginProviders(ctx context.Context, params AccountListLoginProvidersParams, opts ...option.RequestOption) (res *pagination.LoginProvidersPage[LoginProvider], err error) {
67153
var raw *http.Response
68154
opts = append(r.Options[:], opts...)
@@ -80,8 +166,35 @@ func (r *AccountService) ListLoginProviders(ctx context.Context, params AccountL
80166
return res, nil
81167
}
82168

83-
// ListLoginProviders returns the list of login providers matching the provided
84-
// filters.
169+
// Lists available login providers with optional filtering.
170+
//
171+
// Use this method to:
172+
//
173+
// - View supported authentication methods
174+
// - Get provider-specific login URLs
175+
// - Filter providers by invite
176+
//
177+
// ### Examples
178+
//
179+
// - List all providers:
180+
//
181+
// Shows all available login providers.
182+
//
183+
// ```yaml
184+
// pagination:
185+
// pageSize: 20
186+
// ```
187+
//
188+
// - List for specific invite:
189+
//
190+
// Shows providers available for an invite.
191+
//
192+
// ```yaml
193+
// filter:
194+
// inviteId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
195+
// pagination:
196+
// pageSize: 20
197+
// ```
85198
func (r *AccountService) ListLoginProvidersAutoPaging(ctx context.Context, params AccountListLoginProvidersParams, opts ...option.RequestOption) *pagination.LoginProvidersPageAutoPager[LoginProvider] {
86199
return pagination.NewLoginProvidersPageAutoPager(r.ListLoginProviders(ctx, params, opts...))
87200
}

account_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func TestAccountDelete(t *testing.T) {
5252
option.WithBearerToken("My Bearer Token"),
5353
)
5454
_, err := client.Accounts.Delete(context.TODO(), gitpod.AccountDeleteParams{
55-
AccountID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
55+
AccountID: gitpod.F("f53d2330-3795-4c5d-a1f3-453121af9c60"),
5656
})
5757
if err != nil {
5858
var apierr *gitpod.Error
@@ -77,7 +77,7 @@ func TestAccountGetSSOLoginURLWithOptionalParams(t *testing.T) {
7777
option.WithBearerToken("My Bearer Token"),
7878
)
7979
_, err := client.Accounts.GetSSOLoginURL(context.TODO(), gitpod.AccountGetSSOLoginURLParams{
80-
Email: gitpod.F("dev@stainlessapi.com"),
80+
Email: gitpod.F("user@company.com"),
8181
ReturnTo: gitpod.F("https://example.com"),
8282
})
8383
if err != nil {
@@ -110,7 +110,7 @@ func TestAccountListLoginProvidersWithOptionalParams(t *testing.T) {
110110
}),
111111
Pagination: gitpod.F(gitpod.AccountListLoginProvidersParamsPagination{
112112
Token: gitpod.F("token"),
113-
PageSize: gitpod.F(int64(100)),
113+
PageSize: gitpod.F(int64(20)),
114114
}),
115115
})
116116
if err != nil {

editor.go

+74-4
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,48 @@ func NewEditorService(opts ...option.RequestOption) (r *EditorService) {
3434
return
3535
}
3636

37-
// GetEditor returns the editor with the given ID
37+
// Gets details about a specific editor.
38+
//
39+
// Use this method to:
40+
//
41+
// - View editor information
42+
// - Get editor configuration
43+
//
44+
// ### Examples
45+
//
46+
// - Get editor details:
47+
//
48+
// Retrieves information about a specific editor.
49+
//
50+
// ```yaml
51+
// id: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
52+
// ```
3853
func (r *EditorService) Get(ctx context.Context, body EditorGetParams, opts ...option.RequestOption) (res *EditorGetResponse, err error) {
3954
opts = append(r.Options[:], opts...)
4055
path := "gitpod.v1.EditorService/GetEditor"
4156
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
4257
return
4358
}
4459

45-
// ListEditors lists all editors available to the caller
60+
// Lists all available code editors.
61+
//
62+
// Use this method to:
63+
//
64+
// - View supported editors
65+
// - Get editor capabilities
66+
// - Browse editor options
67+
// - Check editor availability
68+
//
69+
// ### Examples
70+
//
71+
// - List editors:
72+
//
73+
// Shows all available editors with pagination.
74+
//
75+
// ```yaml
76+
// pagination:
77+
// pageSize: 20
78+
// ```
4679
func (r *EditorService) List(ctx context.Context, params EditorListParams, opts ...option.RequestOption) (res *pagination.EditorsPage[Editor], err error) {
4780
var raw *http.Response
4881
opts = append(r.Options[:], opts...)
@@ -60,12 +93,49 @@ func (r *EditorService) List(ctx context.Context, params EditorListParams, opts
6093
return res, nil
6194
}
6295

63-
// ListEditors lists all editors available to the caller
96+
// Lists all available code editors.
97+
//
98+
// Use this method to:
99+
//
100+
// - View supported editors
101+
// - Get editor capabilities
102+
// - Browse editor options
103+
// - Check editor availability
104+
//
105+
// ### Examples
106+
//
107+
// - List editors:
108+
//
109+
// Shows all available editors with pagination.
110+
//
111+
// ```yaml
112+
// pagination:
113+
// pageSize: 20
114+
// ```
64115
func (r *EditorService) ListAutoPaging(ctx context.Context, params EditorListParams, opts ...option.RequestOption) *pagination.EditorsPageAutoPager[Editor] {
65116
return pagination.NewEditorsPageAutoPager(r.List(ctx, params, opts...))
66117
}
67118

68-
// ResolveEditorURL resolves the editor's URL for an environment
119+
// Resolves the URL for accessing an editor in a specific environment.
120+
//
121+
// Use this method to:
122+
//
123+
// - Get editor access URLs
124+
// - Launch editors for environments
125+
// - Set up editor connections
126+
// - Configure editor access
127+
//
128+
// ### Examples
129+
//
130+
// - Resolve editor URL:
131+
//
132+
// Gets the URL for accessing an editor in an environment.
133+
//
134+
// ```yaml
135+
// editorId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
136+
// environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
137+
// organizationId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
138+
// ```
69139
func (r *EditorService) ResolveURL(ctx context.Context, body EditorResolveURLParams, opts ...option.RequestOption) (res *EditorResolveURLResponse, err error) {
70140
opts = append(r.Options[:], opts...)
71141
path := "gitpod.v1.EditorService/ResolveEditorURL"

editor_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestEditorGet(t *testing.T) {
2727
option.WithBearerToken("My Bearer Token"),
2828
)
2929
_, err := client.Editors.Get(context.TODO(), gitpod.EditorGetParams{
30-
ID: gitpod.F("id"),
30+
ID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"),
3131
})
3232
if err != nil {
3333
var apierr *gitpod.Error
@@ -56,7 +56,7 @@ func TestEditorListWithOptionalParams(t *testing.T) {
5656
PageSize: gitpod.F(int64(0)),
5757
Pagination: gitpod.F(gitpod.EditorListParamsPagination{
5858
Token: gitpod.F("token"),
59-
PageSize: gitpod.F(int64(100)),
59+
PageSize: gitpod.F(int64(20)),
6060
}),
6161
})
6262
if err != nil {
@@ -82,9 +82,9 @@ func TestEditorResolveURL(t *testing.T) {
8282
option.WithBearerToken("My Bearer Token"),
8383
)
8484
_, err := client.Editors.ResolveURL(context.TODO(), gitpod.EditorResolveURLParams{
85-
EditorID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
86-
EnvironmentID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
87-
OrganizationID: gitpod.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),
85+
EditorID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"),
86+
EnvironmentID: gitpod.F("07e03a28-65a5-4d98-b532-8ea67b188048"),
87+
OrganizationID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"),
8888
})
8989
if err != nil {
9090
var apierr *gitpod.Error

environment.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ func (r AdmissionLevel) IsKnown() bool {
464464
type Environment struct {
465465
// ID is a unique identifier of this environment. No other environment with the
466466
// same name must be managed by this environment manager
467-
ID string `json:"id"`
467+
ID string `json:"id,required"`
468468
// EnvironmentMetadata is data associated with an environment that's required for
469469
// other parts of the system to function
470470
Metadata EnvironmentMetadata `json:"metadata"`

environmentautomation.go

+34-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,40 @@ func NewEnvironmentAutomationService(opts ...option.RequestOption) (r *Environme
3636
return
3737
}
3838

39-
// UpsertAutomationsFile upserts the automations file for the given environment.
39+
// Upserts the automations file for the given environment.
40+
//
41+
// Use this method to:
42+
//
43+
// - Configure environment automations
44+
// - Update automation settings
45+
// - Manage automation files
46+
//
47+
// ### Examples
48+
//
49+
// - Update automations file:
50+
//
51+
// Updates or creates the automations configuration.
52+
//
53+
// ```yaml
54+
// environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
55+
// automationsFile:
56+
// services:
57+
// web-server:
58+
// name: "Web Server"
59+
// description: "Development web server"
60+
// commands:
61+
// start: "npm run dev"
62+
// ready: "curl -s http://localhost:3000"
63+
// triggeredBy:
64+
// - postDevcontainerStart
65+
// tasks:
66+
// build:
67+
// name: "Build Project"
68+
// description: "Builds the project artifacts"
69+
// command: "npm run build"
70+
// triggeredBy:
71+
// - postEnvironmentStart
72+
// ```
4073
func (r *EnvironmentAutomationService) Upsert(ctx context.Context, body EnvironmentAutomationUpsertParams, opts ...option.RequestOption) (res *EnvironmentAutomationUpsertResponse, err error) {
4174
opts = append(r.Options[:], opts...)
4275
path := "gitpod.v1.EnvironmentAutomationService/UpsertAutomationsFile"

0 commit comments

Comments
 (0)