-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathclasses.ts
113 lines (100 loc) · 3.38 KB
/
classes.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../resource';
import * as Shared from '../shared';
import { EnvironmentClassesEnvironmentClassesPage } from '../shared';
import * as RunnersAPI from '../runners/runners';
import { EnvironmentClassesPage, type EnvironmentClassesPageParams, PagePromise } from '../../pagination';
import { RequestOptions } from '../../internal/request-options';
export class Classes extends APIResource {
/**
* 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
*/
list(
params: ClassListParams,
options?: RequestOptions,
): PagePromise<EnvironmentClassesEnvironmentClassesPage, Shared.EnvironmentClass> {
const { token, pageSize, ...body } = params;
return this._client.getAPIList(
'/gitpod.v1.EnvironmentService/ListEnvironmentClasses',
EnvironmentClassesPage<Shared.EnvironmentClass>,
{ query: { token, pageSize }, body, method: 'post', ...options },
);
}
}
export interface ClassListParams extends EnvironmentClassesPageParams {
/**
* Body param:
*/
filter?: ClassListParams.Filter;
/**
* Body param: pagination contains the pagination options for listing environment
* classes
*/
pagination?: ClassListParams.Pagination;
}
export namespace ClassListParams {
export interface Filter {
/**
* 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.
*/
canCreateEnvironments?: boolean | null;
/**
* enabled filters the response to only enabled or disabled environment classes. If
* not set, all environment classes are returned.
*/
enabled?: boolean | null;
/**
* runner_ids filters the response to only EnvironmentClasses of these Runner IDs
*/
runnerIds?: Array<string>;
/**
* runner_kind filters the response to only environment classes from runners of
* these kinds.
*/
runnerKinds?: Array<RunnersAPI.RunnerKind>;
/**
* runner_providers filters the response to only environment classes from runners
* of these providers.
*/
runnerProviders?: Array<RunnersAPI.RunnerProvider>;
}
/**
* pagination contains the pagination options for listing environment classes
*/
export interface Pagination {
/**
* Token for the next set of results that was returned as next_token of a
* PaginationResponse
*/
token?: string;
/**
* Page size is the maximum number of results to retrieve per page. Defaults to 25.
* Maximum 100.
*/
pageSize?: number;
}
}
export declare namespace Classes {
export { type ClassListParams as ClassListParams };
}
export { type EnvironmentClassesEnvironmentClassesPage };