## ListEnvironmentClasses `client.Environments.Classes.List(ctx, params) (*EnvironmentClassesPage[EnvironmentClass], error)` **post** `/gitpod.v1.EnvironmentService/ListEnvironmentClasses` Lists available environment classes with their specifications and resource limits. Use this method to understand what types of environments you can create and their capabilities. Environment classes define the compute resources and features available to your environments. ### Examples - List all available classes: Retrieves a list of all environment classes with their specifications. ```yaml {} ``` buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE ### Parameters - `params EnvironmentClassListParams` - `Token param.Field[string]` Query param - `PageSize param.Field[int64]` Query param - `Filter param.Field[EnvironmentClassListParamsFilter]` Body param - `CanCreateEnvironments bool` can_create_environments filters the response to only environment classes that can be used to create new environments by the caller. Unlike enabled, which indicates general availability, this ensures the caller only sees environment classes they are allowed to use. - `Enabled bool` enabled filters the response to only enabled or disabled environment classes. If not set, all environment classes are returned. - `RunnerIDs []string` runner_ids filters the response to only EnvironmentClasses of these Runner IDs - `RunnerKinds []RunnerKind` runner_kind filters the response to only environment classes from runners of these kinds. - `const RunnerKindUnspecified RunnerKind = "RUNNER_KIND_UNSPECIFIED"` - `const RunnerKindLocal RunnerKind = "RUNNER_KIND_LOCAL"` - `const RunnerKindRemote RunnerKind = "RUNNER_KIND_REMOTE"` - `const RunnerKindLocalConfiguration RunnerKind = "RUNNER_KIND_LOCAL_CONFIGURATION"` - `RunnerProviders []RunnerProvider` runner_providers filters the response to only environment classes from runners of these providers. - `const RunnerProviderUnspecified RunnerProvider = "RUNNER_PROVIDER_UNSPECIFIED"` - `const RunnerProviderAwsEc2 RunnerProvider = "RUNNER_PROVIDER_AWS_EC2"` - `const RunnerProviderLinuxHost RunnerProvider = "RUNNER_PROVIDER_LINUX_HOST"` - `const RunnerProviderDesktopMac RunnerProvider = "RUNNER_PROVIDER_DESKTOP_MAC"` - `const RunnerProviderManaged RunnerProvider = "RUNNER_PROVIDER_MANAGED"` - `const RunnerProviderGcp RunnerProvider = "RUNNER_PROVIDER_GCP"` - `const RunnerProviderDevAgent RunnerProvider = "RUNNER_PROVIDER_DEV_AGENT"` - `Pagination param.Field[EnvironmentClassListParamsPagination]` Body param: pagination contains the pagination options for listing environment classes - `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. ### Returns - `type EnvironmentClass struct{…}` - `ID string` id is the unique identifier of the environment class - `RunnerID string` runner_id is the unique identifier of the runner the environment class belongs to - `Configuration []FieldValue` configuration describes the configuration of the environment class - `Key string` - `Value string` - `Description string` description is a human readable description of the environment class - `DisplayName string` display_name is the human readable name of the environment class - `Enabled bool` enabled indicates whether the environment class can be used to create new environments. ### 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.Environments.Classes.List(context.TODO(), gitpod.EnvironmentClassListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "environmentClasses": [ { "id": "id", "runnerId": "runnerId", "configuration": [ { "key": "key", "value": "value" } ], "description": "xxx", "displayName": "xxx", "enabled": true } ], "pagination": { "nextToken": "nextToken" } } ```