Skip to content

Commit 0ce1c80

Browse files
feat(api): manual updates
1 parent c2514e2 commit 0ce1c80

25 files changed

+2259
-2904
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ with additional helper methods like `.GetNextPage()`, e.g.:
171171
```go
172172
page, err := client.Environments.Automations.Services.List(context.TODO(), gitpod.EnvironmentAutomationServiceListParams{})
173173
for page != nil {
174-
for _, service := range page.Pagination.PersonalAccessTokens {
174+
for _, service := range page.Services {
175175
fmt.Printf("%+v\n", service)
176176
}
177177
page, err = page.GetNextPage()

account.go

+3-20
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"github.com/stainless-sdks/gitpod-go/internal/param"
1313
"github.com/stainless-sdks/gitpod-go/internal/requestconfig"
1414
"github.com/stainless-sdks/gitpod-go/option"
15-
"github.com/stainless-sdks/gitpod-go/packages/pagination"
1615
)
1716

1817
// AccountService contains methods and other services that help with interacting
@@ -61,27 +60,11 @@ func (r *AccountService) GetSSOLoginURL(ctx context.Context, body AccountGetSSOL
6160

6261
// ListLoginProviders returns the list of login providers matching the provided
6362
// filters.
64-
func (r *AccountService) ListLoginProviders(ctx context.Context, params AccountListLoginProvidersParams, opts ...option.RequestOption) (res *pagination.PersonalAccessTokensPage[AccountListLoginProvidersResponse], err error) {
65-
var raw *http.Response
63+
func (r *AccountService) ListLoginProviders(ctx context.Context, params AccountListLoginProvidersParams, opts ...option.RequestOption) (res *AccountListLoginProvidersResponse, err error) {
6664
opts = append(r.Options[:], opts...)
67-
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
6865
path := "gitpod.v1.AccountService/ListLoginProviders"
69-
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodPost, path, params, &res, opts...)
70-
if err != nil {
71-
return nil, err
72-
}
73-
err = cfg.Execute()
74-
if err != nil {
75-
return nil, err
76-
}
77-
res.SetPageConfig(cfg, raw)
78-
return res, nil
79-
}
80-
81-
// ListLoginProviders returns the list of login providers matching the provided
82-
// filters.
83-
func (r *AccountService) ListLoginProvidersAutoPaging(ctx context.Context, params AccountListLoginProvidersParams, opts ...option.RequestOption) *pagination.PersonalAccessTokensPageAutoPager[AccountListLoginProvidersResponse] {
84-
return pagination.NewPersonalAccessTokensPageAutoPager(r.ListLoginProviders(ctx, params, opts...))
66+
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &res, opts...)
67+
return
8568
}
8669

8770
type AccountGetResponse struct {

api.md

+21-21
Large diffs are not rendered by default.

editor.go

+13-66
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (r *EditorService) Get(ctx context.Context, body EditorGetParams, opts ...o
4343
}
4444

4545
// ListEditors lists all editors available to the caller
46-
func (r *EditorService) List(ctx context.Context, params EditorListParams, opts ...option.RequestOption) (res *pagination.PersonalAccessTokensPage[EditorListResponse], err error) {
46+
func (r *EditorService) List(ctx context.Context, params EditorListParams, opts ...option.RequestOption) (res *pagination.EditorsPage[EditorListResponse], err error) {
4747
var raw *http.Response
4848
opts = append(r.Options[:], opts...)
4949
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
@@ -61,8 +61,8 @@ func (r *EditorService) List(ctx context.Context, params EditorListParams, opts
6161
}
6262

6363
// ListEditors lists all editors available to the caller
64-
func (r *EditorService) ListAutoPaging(ctx context.Context, params EditorListParams, opts ...option.RequestOption) *pagination.PersonalAccessTokensPageAutoPager[EditorListResponse] {
65-
return pagination.NewPersonalAccessTokensPageAutoPager(r.List(ctx, params, opts...))
64+
func (r *EditorService) ListAutoPaging(ctx context.Context, params EditorListParams, opts ...option.RequestOption) *pagination.EditorsPageAutoPager[EditorListResponse] {
65+
return pagination.NewEditorsPageAutoPager(r.List(ctx, params, opts...))
6666
}
6767

6868
// ResolveEditorURL resolves the editor's URL for an environment
@@ -130,44 +130,19 @@ func (r editorGetResponseEditorJSON) RawJSON() string {
130130
}
131131

132132
type EditorListResponse struct {
133-
// editors contains the list of editors
134-
Editors []EditorListResponseEditor `json:"editors"`
135-
// pagination contains the pagination options for listing environments
136-
Pagination EditorListResponsePagination `json:"pagination"`
137-
JSON editorListResponseJSON `json:"-"`
133+
ID string `json:"id"`
134+
Alias string `json:"alias"`
135+
IconURL string `json:"iconUrl"`
136+
InstallationInstructions string `json:"installationInstructions"`
137+
Name string `json:"name"`
138+
ShortDescription string `json:"shortDescription"`
139+
URLTemplate string `json:"urlTemplate"`
140+
JSON editorListResponseJSON `json:"-"`
138141
}
139142

140143
// editorListResponseJSON contains the JSON metadata for the struct
141144
// [EditorListResponse]
142145
type editorListResponseJSON struct {
143-
Editors apijson.Field
144-
Pagination apijson.Field
145-
raw string
146-
ExtraFields map[string]apijson.Field
147-
}
148-
149-
func (r *EditorListResponse) UnmarshalJSON(data []byte) (err error) {
150-
return apijson.UnmarshalRoot(data, r)
151-
}
152-
153-
func (r editorListResponseJSON) RawJSON() string {
154-
return r.raw
155-
}
156-
157-
type EditorListResponseEditor struct {
158-
ID string `json:"id"`
159-
Alias string `json:"alias"`
160-
IconURL string `json:"iconUrl"`
161-
InstallationInstructions string `json:"installationInstructions"`
162-
Name string `json:"name"`
163-
ShortDescription string `json:"shortDescription"`
164-
URLTemplate string `json:"urlTemplate"`
165-
JSON editorListResponseEditorJSON `json:"-"`
166-
}
167-
168-
// editorListResponseEditorJSON contains the JSON metadata for the struct
169-
// [EditorListResponseEditor]
170-
type editorListResponseEditorJSON struct {
171146
ID apijson.Field
172147
Alias apijson.Field
173148
IconURL apijson.Field
@@ -179,39 +154,11 @@ type editorListResponseEditorJSON struct {
179154
ExtraFields map[string]apijson.Field
180155
}
181156

182-
func (r *EditorListResponseEditor) UnmarshalJSON(data []byte) (err error) {
183-
return apijson.UnmarshalRoot(data, r)
184-
}
185-
186-
func (r editorListResponseEditorJSON) RawJSON() string {
187-
return r.raw
188-
}
189-
190-
// pagination contains the pagination options for listing environments
191-
type EditorListResponsePagination struct {
192-
// Token for the next set of results that was returned as next_token of a
193-
// PaginationResponse
194-
Token string `json:"token"`
195-
// Page size is the maximum number of results to retrieve per page. Defaults to 25.
196-
// Maximum 100.
197-
PageSize int64 `json:"pageSize"`
198-
JSON editorListResponsePaginationJSON `json:"-"`
199-
}
200-
201-
// editorListResponsePaginationJSON contains the JSON metadata for the struct
202-
// [EditorListResponsePagination]
203-
type editorListResponsePaginationJSON struct {
204-
Token apijson.Field
205-
PageSize apijson.Field
206-
raw string
207-
ExtraFields map[string]apijson.Field
208-
}
209-
210-
func (r *EditorListResponsePagination) UnmarshalJSON(data []byte) (err error) {
157+
func (r *EditorListResponse) UnmarshalJSON(data []byte) (err error) {
211158
return apijson.UnmarshalRoot(data, r)
212159
}
213160

214-
func (r editorListResponsePaginationJSON) RawJSON() string {
161+
func (r editorListResponseJSON) RawJSON() string {
215162
return r.raw
216163
}
217164

0 commit comments

Comments
 (0)