Skip to content

Commit f29b9ba

Browse files
feat(api): manual updates (#64)
1 parent a62be8a commit f29b9ba

35 files changed

+220
-1629
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-064a191bc556bcab46bb5d612c844437e1a4aef5981a4a99ab7f825a96ede4fa.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3655d5ad0ac3e228c1519af70dbf3d0bfa3c47a2d06d4cac92a650da051b49a6.yml

src/gitpod/resources/environments/environments.py

+12-10
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ def create(
164164
```
165165
166166
Args:
167-
spec: EnvironmentSpec specifies the configuration of an environment for an environment
168-
start
167+
spec: spec is the configuration of the environment that's required for the to start
168+
the environment
169169
170170
extra_headers: Send extra headers
171171
@@ -540,8 +540,9 @@ def create_from_project(
540540
```
541541
542542
Args:
543-
spec: EnvironmentSpec specifies the configuration of an environment for an environment
544-
start
543+
spec: Spec is the configuration of the environment that's required for the runner to
544+
start the environment Configuration already defined in the Project will override
545+
parts of the spec, if set
545546
546547
extra_headers: Send extra headers
547548
@@ -651,7 +652,7 @@ def mark_active(
651652
```
652653
653654
Args:
654-
activity_signal: EnvironmentActivitySignal used to signal activity for an environment.
655+
activity_signal: activity_signal specifies the activity.
655656
656657
environment_id: The ID of the environment to update activity for.
657658
@@ -880,8 +881,8 @@ async def create(
880881
```
881882
882883
Args:
883-
spec: EnvironmentSpec specifies the configuration of an environment for an environment
884-
start
884+
spec: spec is the configuration of the environment that's required for the to start
885+
the environment
885886
886887
extra_headers: Send extra headers
887888
@@ -1256,8 +1257,9 @@ async def create_from_project(
12561257
```
12571258
12581259
Args:
1259-
spec: EnvironmentSpec specifies the configuration of an environment for an environment
1260-
start
1260+
spec: Spec is the configuration of the environment that's required for the runner to
1261+
start the environment Configuration already defined in the Project will override
1262+
parts of the spec, if set
12611263
12621264
extra_headers: Send extra headers
12631265
@@ -1367,7 +1369,7 @@ async def mark_active(
13671369
```
13681370
13691371
Args:
1370-
activity_signal: EnvironmentActivitySignal used to signal activity for an environment.
1372+
activity_signal: activity_signal specifies the activity.
13711373
13721374
environment_id: The ID of the environment to update activity for.
13731375

src/gitpod/resources/projects/projects.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def create(
130130
```
131131
132132
Args:
133-
initializer: EnvironmentInitializer specifies how an environment is to be initialized
133+
initializer: initializer is the content initializer
134134
135135
automations_file_path: automations_file_path is the path to the automations file relative to the repo
136136
root path must not be absolute (start with a /):
@@ -284,7 +284,7 @@ def update(
284284
this.matches("^$|^[^/].*")
285285
```
286286
287-
initializer: EnvironmentInitializer specifies how an environment is to be initialized
287+
initializer: initializer is the content initializer
288288
289289
project_id: project_id specifies the project identifier
290290
@@ -571,7 +571,7 @@ async def create(
571571
```
572572
573573
Args:
574-
initializer: EnvironmentInitializer specifies how an environment is to be initialized
574+
initializer: initializer is the content initializer
575575
576576
automations_file_path: automations_file_path is the path to the automations file relative to the repo
577577
root path must not be absolute (start with a /):
@@ -725,7 +725,7 @@ async def update(
725725
this.matches("^$|^[^/].*")
726726
```
727727
728-
initializer: EnvironmentInitializer specifies how an environment is to be initialized
728+
initializer: initializer is the content initializer
729729
730730
project_id: project_id specifies the project identifier
731731

src/gitpod/resources/runners/runners.py

+12-8
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,15 @@ def create(
148148
```
149149
150150
Args:
151-
kind: RunnerKind represents the kind of a runner
151+
kind: The runner's kind This field is optional and here for backwards-compatibility.
152+
Use the provider field instead. If provider is set, the runner's kind will be
153+
deduced from the provider. Only one of kind and provider must be set.
152154
153155
name: The runner name for humans
154156
155-
provider: RunnerProvider identifies the specific implementation type of a runner. Each
156-
provider maps to a specific kind of runner (local or remote), as specified below
157-
for each provider.
157+
provider: The specific implementation type of the runner This field is optional for
158+
backwards compatibility but will be required in the future. When specified, kind
159+
must not be specified (will be deduced from provider)
158160
159161
extra_headers: Send extra headers
160162
@@ -699,13 +701,15 @@ async def create(
699701
```
700702
701703
Args:
702-
kind: RunnerKind represents the kind of a runner
704+
kind: The runner's kind This field is optional and here for backwards-compatibility.
705+
Use the provider field instead. If provider is set, the runner's kind will be
706+
deduced from the provider. Only one of kind and provider must be set.
703707
704708
name: The runner name for humans
705709
706-
provider: RunnerProvider identifies the specific implementation type of a runner. Each
707-
provider maps to a specific kind of runner (local or remote), as specified below
708-
for each provider.
710+
provider: The specific implementation type of the runner This field is optional for
711+
backwards compatibility but will be required in the future. When specified, kind
712+
must not be specified (will be deduced from provider)
709713
710714
extra_headers: Send extra headers
711715

src/gitpod/resources/secrets.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,12 @@ def create(
116116
117117
Args:
118118
container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have
119-
the docker registry host
119+
the docker registry host value must be a valid registry host (e.g.
120+
registry.docker.com, https://registry.docker.com, ghcr.io:5050):
121+
122+
```
123+
this.matches("^[a-zA-Z0-9.-/:]+(:[0-9]+)?$")
124+
```
120125
121126
environment_variable: secret will be created as an Environment Variable with the same name as the
122127
secret
@@ -469,7 +474,12 @@ async def create(
469474
470475
Args:
471476
container_registry_basic_auth_host: secret will be mounted as a docker config in the environment VM, mount will have
472-
the docker registry host
477+
the docker registry host value must be a valid registry host (e.g.
478+
registry.docker.com, https://registry.docker.com, ghcr.io:5050):
479+
480+
```
481+
this.matches("^[a-zA-Z0-9.-/:]+(:[0-9]+)?$")
482+
```
473483
474484
environment_variable: secret will be created as an Environment Variable with the same name as the
475485
secret

src/gitpod/types/environment.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ class Environment(BaseModel):
2020

2121
metadata: Optional[EnvironmentMetadata] = None
2222
"""
23-
EnvironmentMetadata is data associated with an environment that's required for
24-
other parts of the system to function
23+
Metadata is data associated with this environment that's required for other
24+
parts of Gitpod to function
2525
"""
2626

2727
spec: Optional[EnvironmentSpec] = None
2828
"""
29-
EnvironmentSpec specifies the configuration of an environment for an environment
30-
start
29+
Spec is the configuration of the environment that's required for the runner to
30+
start the environment
3131
"""
3232

3333
status: Optional[EnvironmentStatus] = None
34-
"""EnvironmentStatus describes an environment status"""
34+
"""Status is the current status of the environment"""

src/gitpod/types/environment_activity_signal.py

+2-88
Original file line numberDiff line numberDiff line change
@@ -18,92 +18,6 @@ class EnvironmentActivitySignal(BaseModel):
1818

1919
timestamp: Optional[datetime] = None
2020
"""
21-
A Timestamp represents a point in time independent of any time zone or local
22-
calendar, encoded as a count of seconds and fractions of seconds at nanosecond
23-
resolution. The count is relative to an epoch at UTC midnight on January 1,
24-
1970, in the proleptic Gregorian calendar which extends the Gregorian calendar
25-
backwards to year one.
26-
27-
All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
28-
second table is needed for interpretation, using a
29-
[24-hour linear smear](https://developers.google.com/time/smear).
30-
31-
The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
32-
restricting to that range, we ensure that we can convert to and from
33-
[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
34-
35-
# Examples
36-
37-
Example 1: Compute Timestamp from POSIX `time()`.
38-
39-
Timestamp timestamp;
40-
timestamp.set_seconds(time(NULL));
41-
timestamp.set_nanos(0);
42-
43-
Example 2: Compute Timestamp from POSIX `gettimeofday()`.
44-
45-
struct timeval tv;
46-
gettimeofday(&tv, NULL);
47-
48-
Timestamp timestamp;
49-
timestamp.set_seconds(tv.tv_sec);
50-
timestamp.set_nanos(tv.tv_usec * 1000);
51-
52-
Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
53-
54-
FILETIME ft;
55-
GetSystemTimeAsFileTime(&ft);
56-
UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
57-
58-
// A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
59-
// is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
60-
Timestamp timestamp;
61-
timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
62-
timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
63-
64-
Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
65-
66-
long millis = System.currentTimeMillis();
67-
68-
Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
69-
.setNanos((int) ((millis % 1000) * 1000000)).build();
70-
71-
Example 5: Compute Timestamp from Java `Instant.now()`.
72-
73-
Instant now = Instant.now();
74-
75-
Timestamp timestamp =
76-
Timestamp.newBuilder().setSeconds(now.getEpochSecond())
77-
.setNanos(now.getNano()).build();
78-
79-
Example 6: Compute Timestamp from current time in Python.
80-
81-
timestamp = Timestamp()
82-
timestamp.GetCurrentTime()
83-
84-
# JSON Mapping
85-
86-
In JSON format, the Timestamp type is encoded as a string in the
87-
[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is
88-
"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always
89-
expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are
90-
zero-padded to two digits each. The fractional seconds, which can go up to 9
91-
digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix
92-
indicates the timezone ("UTC"); the timezone is required. A proto3 JSON
93-
serializer should always use UTC (as indicated by "Z") when printing the
94-
Timestamp type and a proto3 JSON parser should be able to accept both UTC and
95-
other timezones (as indicated by an offset).
96-
97-
For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on
98-
January 15, 2017.
99-
100-
In JavaScript, one can convert a Date object to this format using the standard
101-
[toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
102-
method. In Python, a standard `datetime.datetime` object can be converted to
103-
this format using
104-
[`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the
105-
time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the
106-
Joda Time's
107-
[`ISODateTimeFormat.dateTime()`](<http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()>)
108-
to obtain a formatter capable of generating timestamps in this format.
21+
timestamp of when the activity was observed by the source. Only reported every 5
22+
minutes. Zero value means no activity was observed.
10923
"""

src/gitpod/types/environment_activity_signal_param.py

+2-88
Original file line numberDiff line numberDiff line change
@@ -21,92 +21,6 @@ class EnvironmentActivitySignalParam(TypedDict, total=False):
2121

2222
timestamp: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
2323
"""
24-
A Timestamp represents a point in time independent of any time zone or local
25-
calendar, encoded as a count of seconds and fractions of seconds at nanosecond
26-
resolution. The count is relative to an epoch at UTC midnight on January 1,
27-
1970, in the proleptic Gregorian calendar which extends the Gregorian calendar
28-
backwards to year one.
29-
30-
All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
31-
second table is needed for interpretation, using a
32-
[24-hour linear smear](https://developers.google.com/time/smear).
33-
34-
The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
35-
restricting to that range, we ensure that we can convert to and from
36-
[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
37-
38-
# Examples
39-
40-
Example 1: Compute Timestamp from POSIX `time()`.
41-
42-
Timestamp timestamp;
43-
timestamp.set_seconds(time(NULL));
44-
timestamp.set_nanos(0);
45-
46-
Example 2: Compute Timestamp from POSIX `gettimeofday()`.
47-
48-
struct timeval tv;
49-
gettimeofday(&tv, NULL);
50-
51-
Timestamp timestamp;
52-
timestamp.set_seconds(tv.tv_sec);
53-
timestamp.set_nanos(tv.tv_usec * 1000);
54-
55-
Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
56-
57-
FILETIME ft;
58-
GetSystemTimeAsFileTime(&ft);
59-
UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
60-
61-
// A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
62-
// is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
63-
Timestamp timestamp;
64-
timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
65-
timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
66-
67-
Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
68-
69-
long millis = System.currentTimeMillis();
70-
71-
Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
72-
.setNanos((int) ((millis % 1000) * 1000000)).build();
73-
74-
Example 5: Compute Timestamp from Java `Instant.now()`.
75-
76-
Instant now = Instant.now();
77-
78-
Timestamp timestamp =
79-
Timestamp.newBuilder().setSeconds(now.getEpochSecond())
80-
.setNanos(now.getNano()).build();
81-
82-
Example 6: Compute Timestamp from current time in Python.
83-
84-
timestamp = Timestamp()
85-
timestamp.GetCurrentTime()
86-
87-
# JSON Mapping
88-
89-
In JSON format, the Timestamp type is encoded as a string in the
90-
[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the format is
91-
"{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" where {year} is always
92-
expressed using four digits while {month}, {day}, {hour}, {min}, and {sec} are
93-
zero-padded to two digits each. The fractional seconds, which can go up to 9
94-
digits (i.e. up to 1 nanosecond resolution), are optional. The "Z" suffix
95-
indicates the timezone ("UTC"); the timezone is required. A proto3 JSON
96-
serializer should always use UTC (as indicated by "Z") when printing the
97-
Timestamp type and a proto3 JSON parser should be able to accept both UTC and
98-
other timezones (as indicated by an offset).
99-
100-
For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past 01:30 UTC on
101-
January 15, 2017.
102-
103-
In JavaScript, one can convert a Date object to this format using the standard
104-
[toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
105-
method. In Python, a standard `datetime.datetime` object can be converted to
106-
this format using
107-
[`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with the
108-
time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use the
109-
Joda Time's
110-
[`ISODateTimeFormat.dateTime()`](<http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()>)
111-
to obtain a formatter capable of generating timestamps in this format.
24+
timestamp of when the activity was observed by the source. Only reported every 5
25+
minutes. Zero value means no activity was observed.
11226
"""

src/gitpod/types/environment_create_from_project_params.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class EnvironmentCreateFromProjectParams(TypedDict, total=False):
1515

1616
spec: EnvironmentSpecParam
1717
"""
18-
EnvironmentSpec specifies the configuration of an environment for an environment
19-
start
18+
Spec is the configuration of the environment that's required for the runner to
19+
start the environment Configuration already defined in the Project will override
20+
parts of the spec, if set
2021
"""

0 commit comments

Comments
 (0)