Skip to content

Commit c8930ae

Browse files
feat(api): update via SDK Studio
1 parent 4a94a89 commit c8930ae

File tree

99 files changed

+4556
-2278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+4556
-2278
lines changed

Diff for: .stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 51
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-b81ab7eb96e1bf876ada508a9db17fdb4b336c92b5bee7196f43a07fdc18c3be.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-6d44c8845e1deee92c3e6406d5b67aa72616ec5e21ab8c722ae0a2c214c14784.yml

Diff for: README.md

+5-19
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ The full API of this library can be found in [api.md](api.md).
2929
```python
3030
from gitpod import Gitpod
3131

32-
client = Gitpod(
33-
auth_token="My Auth Token",
34-
)
32+
client = Gitpod()
3533

3634
runner = client.runners.create(
3735
connect_protocol_version=1,
@@ -47,9 +45,7 @@ Simply import `AsyncGitpod` instead of `Gitpod` and use `await` with each API ca
4745
import asyncio
4846
from gitpod import AsyncGitpod
4947

50-
client = AsyncGitpod(
51-
auth_token="My Auth Token",
52-
)
48+
client = AsyncGitpod()
5349

5450

5551
async def main() -> None:
@@ -86,9 +82,7 @@ All errors inherit from `gitpod.APIError`.
8682
import gitpod
8783
from gitpod import Gitpod
8884

89-
client = Gitpod(
90-
auth_token="My Auth Token",
91-
)
85+
client = Gitpod()
9286

9387
try:
9488
client.runners.create(
@@ -133,7 +127,6 @@ from gitpod import Gitpod
133127
client = Gitpod(
134128
# default is 2
135129
max_retries=0,
136-
auth_token="My Auth Token",
137130
)
138131

139132
# Or, configure per-request:
@@ -154,13 +147,11 @@ from gitpod import Gitpod
154147
client = Gitpod(
155148
# 20 seconds (default is 1 minute)
156149
timeout=20.0,
157-
auth_token="My Auth Token",
158150
)
159151

160152
# More granular control:
161153
client = Gitpod(
162154
timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
163-
auth_token="My Auth Token",
164155
)
165156

166157
# Override per-request:
@@ -206,9 +197,7 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
206197
```py
207198
from gitpod import Gitpod
208199

209-
client = Gitpod(
210-
auth_token="My Auth Token",
211-
)
200+
client = Gitpod()
212201
response = client.runners.with_raw_response.create(
213202
connect_protocol_version=1,
214203
)
@@ -293,7 +282,6 @@ client = Gitpod(
293282
proxy="http://my.test.proxy.example.com",
294283
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
295284
),
296-
auth_token="My Auth Token",
297285
)
298286
```
299287

@@ -310,9 +298,7 @@ By default the library closes underlying HTTP connections whenever the client is
310298
```py
311299
from gitpod import Gitpod
312300

313-
with Gitpod(
314-
auth_token="My Auth Token",
315-
) as client:
301+
with Gitpod() as client:
316302
# make requests here
317303
...
318304

Diff for: api.md

+47-46
Large diffs are not rendered by default.

Diff for: src/gitpod/_client.py

+4-64
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
get_async_library,
2525
)
2626
from ._version import __version__
27-
from .resources import editors, identity, projects, automations_files, environment_classes, personal_access_tokens
27+
from .resources import projects, environment_classes, personal_access_tokens
2828
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
29-
from ._exceptions import GitpodError, APIStatusError
29+
from ._exceptions import APIStatusError
3030
from ._base_client import (
3131
DEFAULT_MAX_RETRIES,
3232
SyncAPIClient,
@@ -41,10 +41,7 @@
4141

4242

4343
class Gitpod(SyncAPIClient):
44-
automations_files: automations_files.AutomationsFilesResource
45-
editors: editors.EditorsResource
4644
environments: environments.EnvironmentsResource
47-
identity: identity.IdentityResource
4845
environment_classes: environment_classes.EnvironmentClassesResource
4946
organizations: organizations.OrganizationsResource
5047
projects: projects.ProjectsResource
@@ -55,12 +52,10 @@ class Gitpod(SyncAPIClient):
5552
with_streaming_response: GitpodWithStreamedResponse
5653

5754
# client options
58-
auth_token: str
5955

6056
def __init__(
6157
self,
6258
*,
63-
auth_token: str | None = None,
6459
base_url: str | httpx.URL | None = None,
6560
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
6661
max_retries: int = DEFAULT_MAX_RETRIES,
@@ -80,18 +75,7 @@ def __init__(
8075
# part of our public interface in the future.
8176
_strict_response_validation: bool = False,
8277
) -> None:
83-
"""Construct a new synchronous gitpod client instance.
84-
85-
This automatically infers the `auth_token` argument from the `GITPOD_API_KEY` environment variable if it is not provided.
86-
"""
87-
if auth_token is None:
88-
auth_token = os.environ.get("GITPOD_API_KEY")
89-
if auth_token is None:
90-
raise GitpodError(
91-
"The auth_token client option must be set either by passing auth_token to the client or by setting the GITPOD_API_KEY environment variable"
92-
)
93-
self.auth_token = auth_token
94-
78+
"""Construct a new synchronous gitpod client instance."""
9579
if base_url is None:
9680
base_url = os.environ.get("GITPOD_BASE_URL")
9781
if base_url is None:
@@ -108,10 +92,7 @@ def __init__(
10892
_strict_response_validation=_strict_response_validation,
10993
)
11094

111-
self.automations_files = automations_files.AutomationsFilesResource(self)
112-
self.editors = editors.EditorsResource(self)
11395
self.environments = environments.EnvironmentsResource(self)
114-
self.identity = identity.IdentityResource(self)
11596
self.environment_classes = environment_classes.EnvironmentClassesResource(self)
11697
self.organizations = organizations.OrganizationsResource(self)
11798
self.projects = projects.ProjectsResource(self)
@@ -138,7 +119,6 @@ def default_headers(self) -> dict[str, str | Omit]:
138119
def copy(
139120
self,
140121
*,
141-
auth_token: str | None = None,
142122
base_url: str | httpx.URL | None = None,
143123
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
144124
http_client: httpx.Client | None = None,
@@ -172,7 +152,6 @@ def copy(
172152

173153
http_client = http_client or self._client
174154
return self.__class__(
175-
auth_token=auth_token or self.auth_token,
176155
base_url=base_url or self.base_url,
177156
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
178157
http_client=http_client,
@@ -221,10 +200,7 @@ def _make_status_error(
221200

222201

223202
class AsyncGitpod(AsyncAPIClient):
224-
automations_files: automations_files.AsyncAutomationsFilesResource
225-
editors: editors.AsyncEditorsResource
226203
environments: environments.AsyncEnvironmentsResource
227-
identity: identity.AsyncIdentityResource
228204
environment_classes: environment_classes.AsyncEnvironmentClassesResource
229205
organizations: organizations.AsyncOrganizationsResource
230206
projects: projects.AsyncProjectsResource
@@ -235,12 +211,10 @@ class AsyncGitpod(AsyncAPIClient):
235211
with_streaming_response: AsyncGitpodWithStreamedResponse
236212

237213
# client options
238-
auth_token: str
239214

240215
def __init__(
241216
self,
242217
*,
243-
auth_token: str | None = None,
244218
base_url: str | httpx.URL | None = None,
245219
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
246220
max_retries: int = DEFAULT_MAX_RETRIES,
@@ -260,18 +234,7 @@ def __init__(
260234
# part of our public interface in the future.
261235
_strict_response_validation: bool = False,
262236
) -> None:
263-
"""Construct a new async gitpod client instance.
264-
265-
This automatically infers the `auth_token` argument from the `GITPOD_API_KEY` environment variable if it is not provided.
266-
"""
267-
if auth_token is None:
268-
auth_token = os.environ.get("GITPOD_API_KEY")
269-
if auth_token is None:
270-
raise GitpodError(
271-
"The auth_token client option must be set either by passing auth_token to the client or by setting the GITPOD_API_KEY environment variable"
272-
)
273-
self.auth_token = auth_token
274-
237+
"""Construct a new async gitpod client instance."""
275238
if base_url is None:
276239
base_url = os.environ.get("GITPOD_BASE_URL")
277240
if base_url is None:
@@ -288,10 +251,7 @@ def __init__(
288251
_strict_response_validation=_strict_response_validation,
289252
)
290253

291-
self.automations_files = automations_files.AsyncAutomationsFilesResource(self)
292-
self.editors = editors.AsyncEditorsResource(self)
293254
self.environments = environments.AsyncEnvironmentsResource(self)
294-
self.identity = identity.AsyncIdentityResource(self)
295255
self.environment_classes = environment_classes.AsyncEnvironmentClassesResource(self)
296256
self.organizations = organizations.AsyncOrganizationsResource(self)
297257
self.projects = projects.AsyncProjectsResource(self)
@@ -318,7 +278,6 @@ def default_headers(self) -> dict[str, str | Omit]:
318278
def copy(
319279
self,
320280
*,
321-
auth_token: str | None = None,
322281
base_url: str | httpx.URL | None = None,
323282
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
324283
http_client: httpx.AsyncClient | None = None,
@@ -352,7 +311,6 @@ def copy(
352311

353312
http_client = http_client or self._client
354313
return self.__class__(
355-
auth_token=auth_token or self.auth_token,
356314
base_url=base_url or self.base_url,
357315
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
358316
http_client=http_client,
@@ -402,10 +360,7 @@ def _make_status_error(
402360

403361
class GitpodWithRawResponse:
404362
def __init__(self, client: Gitpod) -> None:
405-
self.automations_files = automations_files.AutomationsFilesResourceWithRawResponse(client.automations_files)
406-
self.editors = editors.EditorsResourceWithRawResponse(client.editors)
407363
self.environments = environments.EnvironmentsResourceWithRawResponse(client.environments)
408-
self.identity = identity.IdentityResourceWithRawResponse(client.identity)
409364
self.environment_classes = environment_classes.EnvironmentClassesResourceWithRawResponse(
410365
client.environment_classes
411366
)
@@ -422,12 +377,7 @@ def __init__(self, client: Gitpod) -> None:
422377

423378
class AsyncGitpodWithRawResponse:
424379
def __init__(self, client: AsyncGitpod) -> None:
425-
self.automations_files = automations_files.AsyncAutomationsFilesResourceWithRawResponse(
426-
client.automations_files
427-
)
428-
self.editors = editors.AsyncEditorsResourceWithRawResponse(client.editors)
429380
self.environments = environments.AsyncEnvironmentsResourceWithRawResponse(client.environments)
430-
self.identity = identity.AsyncIdentityResourceWithRawResponse(client.identity)
431381
self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithRawResponse(
432382
client.environment_classes
433383
)
@@ -444,12 +394,7 @@ def __init__(self, client: AsyncGitpod) -> None:
444394

445395
class GitpodWithStreamedResponse:
446396
def __init__(self, client: Gitpod) -> None:
447-
self.automations_files = automations_files.AutomationsFilesResourceWithStreamingResponse(
448-
client.automations_files
449-
)
450-
self.editors = editors.EditorsResourceWithStreamingResponse(client.editors)
451397
self.environments = environments.EnvironmentsResourceWithStreamingResponse(client.environments)
452-
self.identity = identity.IdentityResourceWithStreamingResponse(client.identity)
453398
self.environment_classes = environment_classes.EnvironmentClassesResourceWithStreamingResponse(
454399
client.environment_classes
455400
)
@@ -466,12 +411,7 @@ def __init__(self, client: Gitpod) -> None:
466411

467412
class AsyncGitpodWithStreamedResponse:
468413
def __init__(self, client: AsyncGitpod) -> None:
469-
self.automations_files = automations_files.AsyncAutomationsFilesResourceWithStreamingResponse(
470-
client.automations_files
471-
)
472-
self.editors = editors.AsyncEditorsResourceWithStreamingResponse(client.editors)
473414
self.environments = environments.AsyncEnvironmentsResourceWithStreamingResponse(client.environments)
474-
self.identity = identity.AsyncIdentityResourceWithStreamingResponse(client.identity)
475415
self.environment_classes = environment_classes.AsyncEnvironmentClassesResourceWithStreamingResponse(
476416
client.environment_classes
477417
)

Diff for: src/gitpod/resources/__init__.py

-42
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from .editors import (
4-
EditorsResource,
5-
AsyncEditorsResource,
6-
EditorsResourceWithRawResponse,
7-
AsyncEditorsResourceWithRawResponse,
8-
EditorsResourceWithStreamingResponse,
9-
AsyncEditorsResourceWithStreamingResponse,
10-
)
113
from .runners import (
124
RunnersResource,
135
AsyncRunnersResource,
@@ -16,14 +8,6 @@
168
RunnersResourceWithStreamingResponse,
179
AsyncRunnersResourceWithStreamingResponse,
1810
)
19-
from .identity import (
20-
IdentityResource,
21-
AsyncIdentityResource,
22-
IdentityResourceWithRawResponse,
23-
AsyncIdentityResourceWithRawResponse,
24-
IdentityResourceWithStreamingResponse,
25-
AsyncIdentityResourceWithStreamingResponse,
26-
)
2711
from .projects import (
2812
ProjectsResource,
2913
AsyncProjectsResource,
@@ -48,14 +32,6 @@
4832
OrganizationsResourceWithStreamingResponse,
4933
AsyncOrganizationsResourceWithStreamingResponse,
5034
)
51-
from .automations_files import (
52-
AutomationsFilesResource,
53-
AsyncAutomationsFilesResource,
54-
AutomationsFilesResourceWithRawResponse,
55-
AsyncAutomationsFilesResourceWithRawResponse,
56-
AutomationsFilesResourceWithStreamingResponse,
57-
AsyncAutomationsFilesResourceWithStreamingResponse,
58-
)
5935
from .environment_classes import (
6036
EnvironmentClassesResource,
6137
AsyncEnvironmentClassesResource,
@@ -82,30 +58,12 @@
8258
)
8359

8460
__all__ = [
85-
"AutomationsFilesResource",
86-
"AsyncAutomationsFilesResource",
87-
"AutomationsFilesResourceWithRawResponse",
88-
"AsyncAutomationsFilesResourceWithRawResponse",
89-
"AutomationsFilesResourceWithStreamingResponse",
90-
"AsyncAutomationsFilesResourceWithStreamingResponse",
91-
"EditorsResource",
92-
"AsyncEditorsResource",
93-
"EditorsResourceWithRawResponse",
94-
"AsyncEditorsResourceWithRawResponse",
95-
"EditorsResourceWithStreamingResponse",
96-
"AsyncEditorsResourceWithStreamingResponse",
9761
"EnvironmentsResource",
9862
"AsyncEnvironmentsResource",
9963
"EnvironmentsResourceWithRawResponse",
10064
"AsyncEnvironmentsResourceWithRawResponse",
10165
"EnvironmentsResourceWithStreamingResponse",
10266
"AsyncEnvironmentsResourceWithStreamingResponse",
103-
"IdentityResource",
104-
"AsyncIdentityResource",
105-
"IdentityResourceWithRawResponse",
106-
"AsyncIdentityResourceWithRawResponse",
107-
"IdentityResourceWithStreamingResponse",
108-
"AsyncIdentityResourceWithStreamingResponse",
10967
"EnvironmentClassesResource",
11068
"AsyncEnvironmentClassesResource",
11169
"EnvironmentClassesResourceWithRawResponse",

0 commit comments

Comments
 (0)