Skip to content

Commit 78b2504

Browse files
feat(api): manual updates (#48)
1 parent 1817924 commit 78b2504

23 files changed

+1184
-152
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
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-cd6a05ae99d2a050577fa0e729e6ae89b4eacd78f61366a77269398368f8a877.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d6a243325df36817d495ce6dd54f80766b77a97e1ca2f6d371c0a68b7d070e0f.yml

event.go

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,32 @@ func NewEventService(opts ...option.RequestOption) (r *EventService) {
3737
return
3838
}
3939

40-
// ListAuditLogs retrieves a paginated list of audit logs for the specified
41-
// organization
40+
// Lists audit logs with filtering and pagination options.
41+
//
42+
// Use this method to:
43+
//
44+
// - View audit history
45+
// - Track user actions
46+
// - Monitor system changes
47+
//
48+
// ### Examples
49+
//
50+
// - List all logs:
51+
//
52+
// ```yaml
53+
// pagination:
54+
// pageSize: 20
55+
// ```
56+
//
57+
// - Filter by actor:
58+
//
59+
// ```yaml
60+
// filter:
61+
// actorIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"]
62+
// actorPrincipals: ["PRINCIPAL_USER"]
63+
// pagination:
64+
// pageSize: 20
65+
// ```
4266
func (r *EventService) List(ctx context.Context, params EventListParams, opts ...option.RequestOption) (res *pagination.EntriesPage[EventListResponse], err error) {
4367
var raw *http.Response
4468
opts = append(r.Options[:], opts...)
@@ -56,13 +80,53 @@ func (r *EventService) List(ctx context.Context, params EventListParams, opts ..
5680
return res, nil
5781
}
5882

59-
// ListAuditLogs retrieves a paginated list of audit logs for the specified
60-
// organization
83+
// Lists audit logs with filtering and pagination options.
84+
//
85+
// Use this method to:
86+
//
87+
// - View audit history
88+
// - Track user actions
89+
// - Monitor system changes
90+
//
91+
// ### Examples
92+
//
93+
// - List all logs:
94+
//
95+
// ```yaml
96+
// pagination:
97+
// pageSize: 20
98+
// ```
99+
//
100+
// - Filter by actor:
101+
//
102+
// ```yaml
103+
// filter:
104+
// actorIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"]
105+
// actorPrincipals: ["PRINCIPAL_USER"]
106+
// pagination:
107+
// pageSize: 20
108+
// ```
61109
func (r *EventService) ListAutoPaging(ctx context.Context, params EventListParams, opts ...option.RequestOption) *pagination.EntriesPageAutoPager[EventListResponse] {
62110
return pagination.NewEntriesPageAutoPager(r.List(ctx, params, opts...))
63111
}
64112

65-
// WatchEvents streams all requests events to the client
113+
// Streams events for all projects, runners, environments, tasks, and services
114+
// based on the specified scope.
115+
//
116+
// Use this method to:
117+
//
118+
// - Monitor resource changes in real-time
119+
// - Track system events
120+
// - Receive notifications
121+
//
122+
// The scope parameter determines which events to watch:
123+
//
124+
// - Organization scope (default): Watch all organization-wide events including
125+
// projects, runners and environments. Task and service events are not included.
126+
// Use by setting organization=true or omitting the scope.
127+
// - Environment scope: Watch events for a specific environment, including its
128+
// tasks, task executions, and services. Use by setting environment_id to the
129+
// UUID of the environment to watch.
66130
func (r *EventService) WatchStreaming(ctx context.Context, body EventWatchParams, opts ...option.RequestOption) (stream *jsonl.Stream[EventWatchResponse]) {
67131
var (
68132
raw *http.Response

event_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ func TestEventListWithOptionalParams(t *testing.T) {
3131
Token: gitpod.F("token"),
3232
PageSize: gitpod.F(int64(0)),
3333
Filter: gitpod.F(gitpod.EventListParamsFilter{
34-
ActorIDs: gitpod.F([]string{"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}),
34+
ActorIDs: gitpod.F([]string{"d2c94c27-3b76-4a42-b88c-95a85e392c68"}),
3535
ActorPrincipals: gitpod.F([]shared.Principal{shared.PrincipalUnspecified}),
3636
SubjectIDs: gitpod.F([]string{"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"}),
3737
SubjectTypes: gitpod.F([]gitpod.ResourceType{gitpod.ResourceTypeUnspecified}),
3838
}),
3939
Pagination: gitpod.F(gitpod.EventListParamsPagination{
4040
Token: gitpod.F("token"),
41-
PageSize: gitpod.F(int64(100)),
41+
PageSize: gitpod.F(int64(20)),
4242
}),
4343
})
4444
if err != nil {

group.go

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,35 @@ func NewGroupService(opts ...option.RequestOption) (r *GroupService) {
3535
return
3636
}
3737

38-
// ListGroups lists groups
38+
// Lists groups with optional pagination.
39+
//
40+
// Use this method to:
41+
//
42+
// - View all groups
43+
// - Check group memberships
44+
// - Monitor group configurations
45+
// - Audit group access
46+
//
47+
// ### Examples
48+
//
49+
// - List all groups:
50+
//
51+
// Shows all groups with pagination.
52+
//
53+
// ```yaml
54+
// pagination:
55+
// pageSize: 20
56+
// ```
57+
//
58+
// - List with custom page size:
59+
//
60+
// Shows groups with specified page size.
61+
//
62+
// ```yaml
63+
// pagination:
64+
// pageSize: 50
65+
// token: "next-page-token-from-previous-response"
66+
// ```
3967
func (r *GroupService) List(ctx context.Context, params GroupListParams, opts ...option.RequestOption) (res *pagination.GroupsPage[Group], err error) {
4068
var raw *http.Response
4169
opts = append(r.Options[:], opts...)
@@ -53,7 +81,35 @@ func (r *GroupService) List(ctx context.Context, params GroupListParams, opts ..
5381
return res, nil
5482
}
5583

56-
// ListGroups lists groups
84+
// Lists groups with optional pagination.
85+
//
86+
// Use this method to:
87+
//
88+
// - View all groups
89+
// - Check group memberships
90+
// - Monitor group configurations
91+
// - Audit group access
92+
//
93+
// ### Examples
94+
//
95+
// - List all groups:
96+
//
97+
// Shows all groups with pagination.
98+
//
99+
// ```yaml
100+
// pagination:
101+
// pageSize: 20
102+
// ```
103+
//
104+
// - List with custom page size:
105+
//
106+
// Shows groups with specified page size.
107+
//
108+
// ```yaml
109+
// pagination:
110+
// pageSize: 50
111+
// token: "next-page-token-from-previous-response"
112+
// ```
57113
func (r *GroupService) ListAutoPaging(ctx context.Context, params GroupListParams, opts ...option.RequestOption) *pagination.GroupsPageAutoPager[Group] {
58114
return pagination.NewGroupsPageAutoPager(r.List(ctx, params, opts...))
59115
}

group_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func TestGroupListWithOptionalParams(t *testing.T) {
3131
PageSize: gitpod.F(int64(0)),
3232
Pagination: gitpod.F(gitpod.GroupListParamsPagination{
3333
Token: gitpod.F("token"),
34-
PageSize: gitpod.F(int64(100)),
34+
PageSize: gitpod.F(int64(20)),
3535
}),
3636
})
3737
if err != nil {

0 commit comments

Comments
 (0)