Skip to content

Commit cce80be

Browse files
feat(api): manual updates (#33)
1 parent 5518d32 commit cce80be

File tree

13 files changed

+883
-64
lines changed

13 files changed

+883
-64
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-cd6a05ae99d2a050577fa0e729e6ae89b4eacd78f61366a77269398368f8a877.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-d6a243325df36817d495ce6dd54f80766b77a97e1ca2f6d371c0a68b7d070e0f.yml

src/resources/events.ts

+43-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,32 @@ import { JSONLDecoder } from '../internal/decoders/jsonl';
1111

1212
export class Events extends APIResource {
1313
/**
14-
* ListAuditLogs retrieves a paginated list of audit logs for the specified
15-
* organization
14+
* Lists audit logs with filtering and pagination options.
15+
*
16+
* Use this method to:
17+
*
18+
* - View audit history
19+
* - Track user actions
20+
* - Monitor system changes
21+
*
22+
* ### Examples
23+
*
24+
* - List all logs:
25+
*
26+
* ```yaml
27+
* pagination:
28+
* pageSize: 20
29+
* ```
30+
*
31+
* - Filter by actor:
32+
*
33+
* ```yaml
34+
* filter:
35+
* actorIds: ["d2c94c27-3b76-4a42-b88c-95a85e392c68"]
36+
* actorPrincipals: ["PRINCIPAL_USER"]
37+
* pagination:
38+
* pageSize: 20
39+
* ```
1640
*/
1741
list(
1842
params: EventListParams,
@@ -28,7 +52,23 @@ export class Events extends APIResource {
2852
}
2953

3054
/**
31-
* WatchEvents streams all requests events to the client
55+
* Streams events for all projects, runners, environments, tasks, and services
56+
* based on the specified scope.
57+
*
58+
* Use this method to:
59+
*
60+
* - Monitor resource changes in real-time
61+
* - Track system events
62+
* - Receive notifications
63+
*
64+
* The scope parameter determines which events to watch:
65+
*
66+
* - Organization scope (default): Watch all organization-wide events including
67+
* projects, runners and environments. Task and service events are not included.
68+
* Use by setting organization=true or omitting the scope.
69+
* - Environment scope: Watch events for a specific environment, including its
70+
* tasks, task executions, and services. Use by setting environment_id to the
71+
* UUID of the environment to watch.
3272
*/
3373
watch(body: EventWatchParams, options?: RequestOptions): APIPromise<JSONLDecoder<EventWatchResponse>> {
3474
return this._client

src/resources/groups.ts

+29-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,35 @@ import { RequestOptions } from '../internal/request-options';
66

77
export class Groups extends APIResource {
88
/**
9-
* ListGroups lists groups
9+
* Lists groups with optional pagination.
10+
*
11+
* Use this method to:
12+
*
13+
* - View all groups
14+
* - Check group memberships
15+
* - Monitor group configurations
16+
* - Audit group access
17+
*
18+
* ### Examples
19+
*
20+
* - List all groups:
21+
*
22+
* Shows all groups with pagination.
23+
*
24+
* ```yaml
25+
* pagination:
26+
* pageSize: 20
27+
* ```
28+
*
29+
* - List with custom page size:
30+
*
31+
* Shows groups with specified page size.
32+
*
33+
* ```yaml
34+
* pagination:
35+
* pageSize: 50
36+
* token: "next-page-token-from-previous-response"
37+
* ```
1038
*/
1139
list(params: GroupListParams, options?: RequestOptions): PagePromise<GroupsGroupsPage, Group> {
1240
const { token, pageSize, ...body } = params;

src/resources/projects/policies.ts

+75-4
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,75 @@ import { RequestOptions } from '../../internal/request-options';
77

88
export class Policies extends APIResource {
99
/**
10-
* CreateProjectPolicy creates a Project Policy.
10+
* Creates a new policy for a project.
11+
*
12+
* Use this method to:
13+
*
14+
* - Set up access controls
15+
* - Define group permissions
16+
* - Configure role-based access
17+
*
18+
* ### Examples
19+
*
20+
* - Create admin policy:
21+
*
22+
* Grants admin access to a group.
23+
*
24+
* ```yaml
25+
* projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
26+
* groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60"
27+
* role: PROJECT_ROLE_ADMIN
28+
* ```
1129
*/
1230
create(body: PolicyCreateParams, options?: RequestOptions): APIPromise<PolicyCreateResponse> {
1331
return this._client.post('/gitpod.v1.ProjectService/CreateProjectPolicy', { body, ...options });
1432
}
1533

1634
/**
17-
* UpdateProjectPolicy updates a Project Policy.
35+
* Updates an existing project policy.
36+
*
37+
* Use this method to:
38+
*
39+
* - Modify access levels
40+
* - Change group roles
41+
* - Update permissions
42+
*
43+
* ### Examples
44+
*
45+
* - Update policy role:
46+
*
47+
* Changes a group's access level.
48+
*
49+
* ```yaml
50+
* projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
51+
* groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60"
52+
* role: PROJECT_ROLE_EDITOR
53+
* ```
1854
*/
1955
update(body: PolicyUpdateParams, options?: RequestOptions): APIPromise<PolicyUpdateResponse> {
2056
return this._client.post('/gitpod.v1.ProjectService/UpdateProjectPolicy', { body, ...options });
2157
}
2258

2359
/**
24-
* ListProjectPolicies lists policies for a project.
60+
* Lists policies for a project.
61+
*
62+
* Use this method to:
63+
*
64+
* - View access controls
65+
* - Check policy configurations
66+
* - Audit permissions
67+
*
68+
* ### Examples
69+
*
70+
* - List policies:
71+
*
72+
* Shows all policies for a project.
73+
*
74+
* ```yaml
75+
* projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
76+
* pagination:
77+
* pageSize: 20
78+
* ```
2579
*/
2680
list(
2781
params: PolicyListParams,
@@ -36,7 +90,24 @@ export class Policies extends APIResource {
3690
}
3791

3892
/**
39-
* DeleteProjectPolicy deletes a Project Policy.
93+
* Deletes a project policy.
94+
*
95+
* Use this method to:
96+
*
97+
* - Remove access controls
98+
* - Revoke permissions
99+
* - Clean up policies
100+
*
101+
* ### Examples
102+
*
103+
* - Delete policy:
104+
*
105+
* Removes a group's access policy.
106+
*
107+
* ```yaml
108+
* projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
109+
* groupId: "f53d2330-3795-4c5d-a1f3-453121af9c60"
110+
* ```
40111
*/
41112
delete(body: PolicyDeleteParams, options?: RequestOptions): APIPromise<unknown> {
42113
return this._client.post('/gitpod.v1.ProjectService/DeleteProjectPolicy', { body, ...options });

src/resources/projects/projects.ts

+139-6
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,128 @@ export class Projects extends APIResource {
2424
policies: PoliciesAPI.Policies = new PoliciesAPI.Policies(this._client);
2525

2626
/**
27-
* CreateProject creates a new Project.
27+
* Creates a new project with specified configuration.
28+
*
29+
* Use this method to:
30+
*
31+
* - Set up development projects
32+
* - Configure project environments
33+
* - Define project settings
34+
* - Initialize project content
35+
*
36+
* ### Examples
37+
*
38+
* - Create basic project:
39+
*
40+
* Creates a project with minimal configuration.
41+
*
42+
* ```yaml
43+
* name: "Web Application"
44+
* environmentClass:
45+
* environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
46+
* initializer:
47+
* specs:
48+
* - git:
49+
* remoteUri: "https://github.com/org/repo"
50+
* ```
51+
*
52+
* - Create project with devcontainer:
53+
*
54+
* Creates a project with custom development container.
55+
*
56+
* ```yaml
57+
* name: "Backend Service"
58+
* environmentClass:
59+
* environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
60+
* initializer:
61+
* specs:
62+
* - git:
63+
* remoteUri: "https://github.com/org/backend"
64+
* devcontainerFilePath: ".devcontainer/devcontainer.json"
65+
* automationsFilePath: ".gitpod/automations.yaml"
66+
* ```
2867
*/
2968
create(body: ProjectCreateParams, options?: RequestOptions): APIPromise<ProjectCreateResponse> {
3069
return this._client.post('/gitpod.v1.ProjectService/CreateProject', { body, ...options });
3170
}
3271

3372
/**
34-
* GetProject retrieves a single Project.
73+
* Gets details about a specific project.
74+
*
75+
* Use this method to:
76+
*
77+
* - View project configuration
78+
* - Check project status
79+
* - Get project metadata
80+
*
81+
* ### Examples
82+
*
83+
* - Get project details:
84+
*
85+
* Retrieves information about a specific project.
86+
*
87+
* ```yaml
88+
* projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
89+
* ```
3590
*/
3691
retrieve(body: ProjectRetrieveParams, options?: RequestOptions): APIPromise<ProjectRetrieveResponse> {
3792
return this._client.post('/gitpod.v1.ProjectService/GetProject', { body, ...options });
3893
}
3994

4095
/**
41-
* UpdateProject updates the properties of a Project.
96+
* Updates a project's configuration.
97+
*
98+
* Use this method to:
99+
*
100+
* - Modify project settings
101+
* - Update environment class
102+
* - Change project name
103+
* - Configure initializers
104+
*
105+
* ### Examples
106+
*
107+
* - Update project name:
108+
*
109+
* Changes the project's display name.
110+
*
111+
* ```yaml
112+
* projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
113+
* name: "New Project Name"
114+
* ```
115+
*
116+
* - Update environment class:
117+
*
118+
* Changes the project's environment class.
119+
*
120+
* ```yaml
121+
* projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
122+
* environmentClass:
123+
* environmentClassId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
124+
* ```
42125
*/
43126
update(body: ProjectUpdateParams, options?: RequestOptions): APIPromise<ProjectUpdateResponse> {
44127
return this._client.post('/gitpod.v1.ProjectService/UpdateProject', { body, ...options });
45128
}
46129

47130
/**
48-
* ListProjects lists all projects the caller has access to.
131+
* Lists projects with optional filtering.
132+
*
133+
* Use this method to:
134+
*
135+
* - View all accessible projects
136+
* - Browse project configurations
137+
* - Monitor project status
138+
*
139+
* ### Examples
140+
*
141+
* - List projects:
142+
*
143+
* Shows all projects with pagination.
144+
*
145+
* ```yaml
146+
* pagination:
147+
* pageSize: 20
148+
* ```
49149
*/
50150
list(params: ProjectListParams, options?: RequestOptions): PagePromise<ProjectsProjectsPage, Project> {
51151
const { token, pageSize, ...body } = params;
@@ -58,14 +158,47 @@ export class Projects extends APIResource {
58158
}
59159

60160
/**
61-
* DeleteProject deletes the specified project.
161+
* Deletes a project permanently.
162+
*
163+
* Use this method to:
164+
*
165+
* - Remove unused projects
166+
* - Clean up test projects
167+
* - Delete obsolete configurations
168+
*
169+
* ### Examples
170+
*
171+
* - Delete project:
172+
*
173+
* Permanently removes a project.
174+
*
175+
* ```yaml
176+
* projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047"
177+
* ```
62178
*/
63179
delete(body: ProjectDeleteParams, options?: RequestOptions): APIPromise<unknown> {
64180
return this._client.post('/gitpod.v1.ProjectService/DeleteProject', { body, ...options });
65181
}
66182

67183
/**
68-
* CreateProject creates a new Project using an environment as template.
184+
* Creates a new project using an existing environment as a template.
185+
*
186+
* Use this method to:
187+
*
188+
* - Clone environment configurations
189+
* - Create projects from templates
190+
* - Share environment setups
191+
*
192+
* ### Examples
193+
*
194+
* - Create from environment:
195+
*
196+
* Creates a project based on existing environment.
197+
*
198+
* ```yaml
199+
* name: "Frontend Project"
200+
* environmentId: "07e03a28-65a5-4d98-b532-8ea67b188048"
201+
* ```
69202
*/
70203
createFromEnvironment(
71204
body: ProjectCreateFromEnvironmentParams,

0 commit comments

Comments
 (0)