# Environment Clases ## ListProjectEnvironmentClasses `client.Projects.EnvironmentClases.List(ctx, params) (*ProjectEnvironmentClassesPage[ProjectEnvironmentClass], error)` **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 ProjectEnvironmentClaseListParams` - `Token param.Field[string]` Query param - `PageSize param.Field[int64]` Query param - `Pagination param.Field[ProjectEnvironmentClaseListParamsPagination]` 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 int64` Page size is the maximum number of results to retrieve per page. Defaults to 25. Maximum 100. - `ProjectID param.Field[string]` Body param: project_id specifies the project identifier ### Returns - `type ProjectEnvironmentClass struct{…}` - `EnvironmentClassID string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `LocalRunner bool` Use a local runner for the user - `Order int64` order is the priority of this entry ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) page, err := client.Projects.EnvironmentClases.List(context.TODO(), gitpod.ProjectEnvironmentClaseListParams{ Pagination: gitpod.F(gitpod.ProjectEnvironmentClaseListParamsPagination{ PageSize: gitpod.F(int64(20)), }), ProjectID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "pagination": { "nextToken": "nextToken" }, "projectEnvironmentClasses": [ { "environmentClassId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "localRunner": true, "order": 0 } ] } ``` ## UpdateProjectEnvironmentClasses `client.Projects.EnvironmentClases.Update(ctx, body) (*ProjectEnvironmentClaseUpdateResponse, error)` **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 ProjectEnvironmentClaseUpdateParams` - `ProjectEnvironmentClasses param.Field[[]ProjectEnvironmentClass]` - `EnvironmentClassID string` Use a fixed environment class on a given Runner. This cannot be a local runner's environment class. - `LocalRunner bool` Use a local runner for the user - `Order int64` order is the priority of this entry - `ProjectID param.Field[string]` project_id specifies the project identifier ### Returns - `type ProjectEnvironmentClaseUpdateResponse interface{…}` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" "github.com/gitpod-io/gitpod-sdk-go/shared" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) environmentClase, err := client.Projects.EnvironmentClases.Update(context.TODO(), gitpod.ProjectEnvironmentClaseUpdateParams{ ProjectEnvironmentClasses: gitpod.F([]shared.ProjectEnvironmentClassParam{shared.ProjectEnvironmentClassParam{ EnvironmentClassID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da041"), Order: gitpod.F(int64(0)), }, shared.ProjectEnvironmentClassParam{ LocalRunner: gitpod.F(true), Order: gitpod.F(int64(1)), }}), ProjectID: gitpod.F("b0e12f6c-4c67-429d-a4a6-d9838b5da047"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", environmentClase) } ``` #### Response ```json {} ```