24
24
get_async_library ,
25
25
)
26
26
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
28
28
from ._streaming import Stream as Stream , AsyncStream as AsyncStream
29
- from ._exceptions import GitpodError , APIStatusError
29
+ from ._exceptions import APIStatusError
30
30
from ._base_client import (
31
31
DEFAULT_MAX_RETRIES ,
32
32
SyncAPIClient ,
41
41
42
42
43
43
class Gitpod (SyncAPIClient ):
44
- automations_files : automations_files .AutomationsFilesResource
45
- editors : editors .EditorsResource
46
44
environments : environments .EnvironmentsResource
47
- identity : identity .IdentityResource
48
45
environment_classes : environment_classes .EnvironmentClassesResource
49
46
organizations : organizations .OrganizationsResource
50
47
projects : projects .ProjectsResource
@@ -55,12 +52,10 @@ class Gitpod(SyncAPIClient):
55
52
with_streaming_response : GitpodWithStreamedResponse
56
53
57
54
# client options
58
- auth_token : str
59
55
60
56
def __init__ (
61
57
self ,
62
58
* ,
63
- auth_token : str | None = None ,
64
59
base_url : str | httpx .URL | None = None ,
65
60
timeout : Union [float , Timeout , None , NotGiven ] = NOT_GIVEN ,
66
61
max_retries : int = DEFAULT_MAX_RETRIES ,
@@ -80,18 +75,7 @@ def __init__(
80
75
# part of our public interface in the future.
81
76
_strict_response_validation : bool = False ,
82
77
) -> 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."""
95
79
if base_url is None :
96
80
base_url = os .environ .get ("GITPOD_BASE_URL" )
97
81
if base_url is None :
@@ -108,10 +92,7 @@ def __init__(
108
92
_strict_response_validation = _strict_response_validation ,
109
93
)
110
94
111
- self .automations_files = automations_files .AutomationsFilesResource (self )
112
- self .editors = editors .EditorsResource (self )
113
95
self .environments = environments .EnvironmentsResource (self )
114
- self .identity = identity .IdentityResource (self )
115
96
self .environment_classes = environment_classes .EnvironmentClassesResource (self )
116
97
self .organizations = organizations .OrganizationsResource (self )
117
98
self .projects = projects .ProjectsResource (self )
@@ -138,7 +119,6 @@ def default_headers(self) -> dict[str, str | Omit]:
138
119
def copy (
139
120
self ,
140
121
* ,
141
- auth_token : str | None = None ,
142
122
base_url : str | httpx .URL | None = None ,
143
123
timeout : float | Timeout | None | NotGiven = NOT_GIVEN ,
144
124
http_client : httpx .Client | None = None ,
@@ -172,7 +152,6 @@ def copy(
172
152
173
153
http_client = http_client or self ._client
174
154
return self .__class__ (
175
- auth_token = auth_token or self .auth_token ,
176
155
base_url = base_url or self .base_url ,
177
156
timeout = self .timeout if isinstance (timeout , NotGiven ) else timeout ,
178
157
http_client = http_client ,
@@ -221,10 +200,7 @@ def _make_status_error(
221
200
222
201
223
202
class AsyncGitpod (AsyncAPIClient ):
224
- automations_files : automations_files .AsyncAutomationsFilesResource
225
- editors : editors .AsyncEditorsResource
226
203
environments : environments .AsyncEnvironmentsResource
227
- identity : identity .AsyncIdentityResource
228
204
environment_classes : environment_classes .AsyncEnvironmentClassesResource
229
205
organizations : organizations .AsyncOrganizationsResource
230
206
projects : projects .AsyncProjectsResource
@@ -235,12 +211,10 @@ class AsyncGitpod(AsyncAPIClient):
235
211
with_streaming_response : AsyncGitpodWithStreamedResponse
236
212
237
213
# client options
238
- auth_token : str
239
214
240
215
def __init__ (
241
216
self ,
242
217
* ,
243
- auth_token : str | None = None ,
244
218
base_url : str | httpx .URL | None = None ,
245
219
timeout : Union [float , Timeout , None , NotGiven ] = NOT_GIVEN ,
246
220
max_retries : int = DEFAULT_MAX_RETRIES ,
@@ -260,18 +234,7 @@ def __init__(
260
234
# part of our public interface in the future.
261
235
_strict_response_validation : bool = False ,
262
236
) -> 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."""
275
238
if base_url is None :
276
239
base_url = os .environ .get ("GITPOD_BASE_URL" )
277
240
if base_url is None :
@@ -288,10 +251,7 @@ def __init__(
288
251
_strict_response_validation = _strict_response_validation ,
289
252
)
290
253
291
- self .automations_files = automations_files .AsyncAutomationsFilesResource (self )
292
- self .editors = editors .AsyncEditorsResource (self )
293
254
self .environments = environments .AsyncEnvironmentsResource (self )
294
- self .identity = identity .AsyncIdentityResource (self )
295
255
self .environment_classes = environment_classes .AsyncEnvironmentClassesResource (self )
296
256
self .organizations = organizations .AsyncOrganizationsResource (self )
297
257
self .projects = projects .AsyncProjectsResource (self )
@@ -318,7 +278,6 @@ def default_headers(self) -> dict[str, str | Omit]:
318
278
def copy (
319
279
self ,
320
280
* ,
321
- auth_token : str | None = None ,
322
281
base_url : str | httpx .URL | None = None ,
323
282
timeout : float | Timeout | None | NotGiven = NOT_GIVEN ,
324
283
http_client : httpx .AsyncClient | None = None ,
@@ -352,7 +311,6 @@ def copy(
352
311
353
312
http_client = http_client or self ._client
354
313
return self .__class__ (
355
- auth_token = auth_token or self .auth_token ,
356
314
base_url = base_url or self .base_url ,
357
315
timeout = self .timeout if isinstance (timeout , NotGiven ) else timeout ,
358
316
http_client = http_client ,
@@ -402,10 +360,7 @@ def _make_status_error(
402
360
403
361
class GitpodWithRawResponse :
404
362
def __init__ (self , client : Gitpod ) -> None :
405
- self .automations_files = automations_files .AutomationsFilesResourceWithRawResponse (client .automations_files )
406
- self .editors = editors .EditorsResourceWithRawResponse (client .editors )
407
363
self .environments = environments .EnvironmentsResourceWithRawResponse (client .environments )
408
- self .identity = identity .IdentityResourceWithRawResponse (client .identity )
409
364
self .environment_classes = environment_classes .EnvironmentClassesResourceWithRawResponse (
410
365
client .environment_classes
411
366
)
@@ -422,12 +377,7 @@ def __init__(self, client: Gitpod) -> None:
422
377
423
378
class AsyncGitpodWithRawResponse :
424
379
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 )
429
380
self .environments = environments .AsyncEnvironmentsResourceWithRawResponse (client .environments )
430
- self .identity = identity .AsyncIdentityResourceWithRawResponse (client .identity )
431
381
self .environment_classes = environment_classes .AsyncEnvironmentClassesResourceWithRawResponse (
432
382
client .environment_classes
433
383
)
@@ -444,12 +394,7 @@ def __init__(self, client: AsyncGitpod) -> None:
444
394
445
395
class GitpodWithStreamedResponse :
446
396
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 )
451
397
self .environments = environments .EnvironmentsResourceWithStreamingResponse (client .environments )
452
- self .identity = identity .IdentityResourceWithStreamingResponse (client .identity )
453
398
self .environment_classes = environment_classes .EnvironmentClassesResourceWithStreamingResponse (
454
399
client .environment_classes
455
400
)
@@ -466,12 +411,7 @@ def __init__(self, client: Gitpod) -> None:
466
411
467
412
class AsyncGitpodWithStreamedResponse :
468
413
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 )
473
414
self .environments = environments .AsyncEnvironmentsResourceWithStreamingResponse (client .environments )
474
- self .identity = identity .AsyncIdentityResourceWithStreamingResponse (client .identity )
475
415
self .environment_classes = environment_classes .AsyncEnvironmentClassesResourceWithStreamingResponse (
476
416
client .environment_classes
477
417
)
0 commit comments