# Environment Clases ## ListProjectEnvironmentClasses `client.projects.environmentClases.list(EnvironmentClaseListParamsparams, RequestOptionsoptions?): ProjectEnvironmentClassesPage` **post** `/gitpod.v1.ProjectService/ListProjectEnvironmentClasses` Lists environment classes of a project. Use this method to: - View all environment classes of a project ### Examples - List project environment classes: Shows all environment classes of a project. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" pagination: pageSize: 20 ``` ### Parameters - `params: EnvironmentClaseListParams` - `token?: string` Query param - `pageSize?: number` Query param - `pagination?: Pagination` Body param: pagination contains the pagination options for listing project policies - `token?: string` Token for the next set of results that was returned as next_token of a PaginationResponse - `pageSize?: number` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. - `projectId?: string` Body param: project_id specifies the project identifier ### Returns - `ProjectEnvironmentClass` - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); // Automatically fetches more pages as needed. for await (const projectEnvironmentClass of client.projects.environmentClases.list({ pagination: { pageSize: 20 }, projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', })) { console.log(projectEnvironmentClass.environmentClassId); } ``` #### Response ```json { "pagination": { "nextToken": "nextToken" }, "projectEnvironmentClasses": [ { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "localRunner": true, "order": 0 } ] } ``` ## UpdateProjectEnvironmentClasses `client.projects.environmentClases.update(EnvironmentClaseUpdateParamsbody, RequestOptionsoptions?): EnvironmentClaseUpdateResponse` **post** `/gitpod.v1.ProjectService/UpdateProjectEnvironmentClasses` Updates all environment classes of a project. Use this method to: - Modify all environment classea of a project ### Examples - Update project environment classes: Updates all environment classes for a project. ```yaml projectId: "b0e12f6c-4c67-429d-a4a6-d9838b5da047" projectEnvironmentClasses: - environmentClassId: "b0e12f6c-4c67-429d-a4a6-d9838b5da041" order: 0 - localRunner: true order: 1 ``` ### Parameters - `body: EnvironmentClaseUpdateParams` - `projectEnvironmentClasses?: Array` - `environmentClassId?: string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `localRunner?: boolean` Use a local runner for the user - `order?: number` order is the priority of this entry - `projectId?: string` project_id specifies the project identifier ### Returns - `EnvironmentClaseUpdateResponse = unknown` ### Example ```typescript import Gitpod from '@gitpod/sdk'; const client = new Gitpod({ bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted }); const environmentClase = await client.projects.environmentClases.update({ projectEnvironmentClasses: [ { environmentClassId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da041', order: 0 }, { localRunner: true, order: 1 }, ], projectId: 'b0e12f6c-4c67-429d-a4a6-d9838b5da047', }); console.log(environmentClase); ``` #### Response ```json {} ``` ## Domain Types ### Environment Clase Update Response - `EnvironmentClaseUpdateResponse = unknown`