Skip to content

Commit 72320f5

Browse files
feat(api): manual updates
1 parent 530d80c commit 72320f5

Some content is hidden

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

57 files changed

+1385
-236
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,30 @@ jobs:
3030
- name: Run lints
3131
run: ./scripts/lint
3232

33+
upload:
34+
if: github.repository == 'stainless-sdks/gitpod-python'
35+
timeout-minutes: 10
36+
name: upload
37+
permissions:
38+
contents: read
39+
id-token: write
40+
runs-on: depot-ubuntu-24.04
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Get GitHub OIDC Token
45+
id: github-oidc
46+
uses: actions/github-script@v6
47+
with:
48+
script: core.setOutput('github_token', await core.getIDToken());
49+
50+
- name: Upload tarball
51+
env:
52+
URL: https://pkg.stainless.com/s
53+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
54+
SHA: ${{ github.sha }}
55+
run: ./scripts/utils/upload-artifact.sh
56+
3357
test:
3458
timeout-minutes: 10
3559
name: test

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 116
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-2e6ddfc9da00e33fcf13baf0b67012b97f051fa986658ff114fde989e56caa94.yml
3-
openapi_spec_hash: 5af02ea2008312d609394e548756e761
4-
config_hash: 60929489bdc1eaf979e7ef74fdd17b94
1+
configured_endpoints: 119
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-c850a6432597255fc1b788ba21a0494162e639f41dd80c0f9d07def239d31865.yml
3+
openapi_spec_hash: fba3f62e51d3ba39eea280abe29f39f1
4+
config_hash: 8e3b8fba844b78950ad4a13b75b7fffc

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ $ rye sync --all-features
1717
You can then run scripts using `rye run python script.py` or by activating the virtual environment:
1818

1919
```sh
20-
$ rye shell
21-
# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
20+
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
2221
$ source .venv/bin/activate
2322

2423
# now you can omit the `rye run` prefix

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ from gitpod import Gitpod
146146
client = Gitpod()
147147

148148
page = client.accounts.list_login_providers(
149-
filter={"invite_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"},
149+
filter={},
150150
)
151151
print(page.login_providers)
152152
```

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ before making any information public.
1616
## Reporting Non-SDK Related Security Issues
1717

1818
If you encounter security issues that are not directly related to SDKs but pertain to the services
19-
or products provided by Gitpod please follow the respective company's security reporting guidelines.
19+
or products provided by Gitpod, please follow the respective company's security reporting guidelines.
2020

2121
### Gitpod Terms and Policies
2222

23-
Please contact [email protected] for any questions or concerns regarding security of our services.
23+
Please contact [email protected] for any questions or concerns regarding the security of our services.
2424

2525
---
2626

api.md

Lines changed: 54 additions & 85 deletions
Large diffs are not rendered by default.

scripts/utils/upload-artifact.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
set -exuo pipefail
3+
4+
RESPONSE=$(curl -X POST "$URL" \
5+
-H "Authorization: Bearer $AUTH" \
6+
-H "Content-Type: application/json")
7+
8+
SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url')
9+
10+
if [[ "$SIGNED_URL" == "null" ]]; then
11+
echo -e "\033[31mFailed to get signed URL.\033[0m"
12+
exit 1
13+
fi
14+
15+
UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \
16+
-H "Content-Type: application/gzip" \
17+
--data-binary @- "$SIGNED_URL" 2>&1)
18+
19+
if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
20+
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
21+
echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/gitpod-python/$SHA'\033[0m"
22+
else
23+
echo -e "\033[31mFailed to upload artifact.\033[0m"
24+
exit 1
25+
fi

src/gitpod/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
import typing as _t
4+
35
from . import types
46
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
57
from ._utils import file_from_path
@@ -68,6 +70,9 @@
6870
"DefaultAsyncHttpxClient",
6971
]
7072

73+
if not _t.TYPE_CHECKING:
74+
from ._utils._resources_proxy import resources as resources
75+
7176
_setup_logging()
7277

7378
# Update the __module__ attribute for exported symbols so that

src/gitpod/_base_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,9 @@ def request(
960960
if self.custom_auth is not None:
961961
kwargs["auth"] = self.custom_auth
962962

963+
if options.follow_redirects is not None:
964+
kwargs["follow_redirects"] = options.follow_redirects
965+
963966
log.debug("Sending HTTP Request: %s %s", request.method, request.url)
964967

965968
response = None
@@ -1460,6 +1463,9 @@ async def request(
14601463
if self.custom_auth is not None:
14611464
kwargs["auth"] = self.custom_auth
14621465

1466+
if options.follow_redirects is not None:
1467+
kwargs["follow_redirects"] = options.follow_redirects
1468+
14631469
log.debug("Sending HTTP Request: %s %s", request.method, request.url)
14641470

14651471
response = None

src/gitpod/_client.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
)
2222
from ._utils import is_given, get_async_library
2323
from ._version import __version__
24-
from .resources import usage, events, groups, editors, secrets, accounts, identity
24+
from .resources import usage, events, groups, editors, secrets, accounts, gateways, identity
2525
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
2626
from ._exceptions import GitpodError, APIStatusError
2727
from ._base_client import (
@@ -43,6 +43,7 @@ class Gitpod(SyncAPIClient):
4343
editors: editors.EditorsResource
4444
environments: environments.EnvironmentsResource
4545
events: events.EventsResource
46+
gateways: gateways.GatewaysResource
4647
groups: groups.GroupsResource
4748
identity: identity.IdentityResource
4849
organizations: organizations.OrganizationsResource
@@ -112,6 +113,7 @@ def __init__(
112113
self.editors = editors.EditorsResource(self)
113114
self.environments = environments.EnvironmentsResource(self)
114115
self.events = events.EventsResource(self)
116+
self.gateways = gateways.GatewaysResource(self)
115117
self.groups = groups.GroupsResource(self)
116118
self.identity = identity.IdentityResource(self)
117119
self.organizations = organizations.OrganizationsResource(self)
@@ -233,6 +235,7 @@ class AsyncGitpod(AsyncAPIClient):
233235
editors: editors.AsyncEditorsResource
234236
environments: environments.AsyncEnvironmentsResource
235237
events: events.AsyncEventsResource
238+
gateways: gateways.AsyncGatewaysResource
236239
groups: groups.AsyncGroupsResource
237240
identity: identity.AsyncIdentityResource
238241
organizations: organizations.AsyncOrganizationsResource
@@ -302,6 +305,7 @@ def __init__(
302305
self.editors = editors.AsyncEditorsResource(self)
303306
self.environments = environments.AsyncEnvironmentsResource(self)
304307
self.events = events.AsyncEventsResource(self)
308+
self.gateways = gateways.AsyncGatewaysResource(self)
305309
self.groups = groups.AsyncGroupsResource(self)
306310
self.identity = identity.AsyncIdentityResource(self)
307311
self.organizations = organizations.AsyncOrganizationsResource(self)
@@ -424,6 +428,7 @@ def __init__(self, client: Gitpod) -> None:
424428
self.editors = editors.EditorsResourceWithRawResponse(client.editors)
425429
self.environments = environments.EnvironmentsResourceWithRawResponse(client.environments)
426430
self.events = events.EventsResourceWithRawResponse(client.events)
431+
self.gateways = gateways.GatewaysResourceWithRawResponse(client.gateways)
427432
self.groups = groups.GroupsResourceWithRawResponse(client.groups)
428433
self.identity = identity.IdentityResourceWithRawResponse(client.identity)
429434
self.organizations = organizations.OrganizationsResourceWithRawResponse(client.organizations)
@@ -440,6 +445,7 @@ def __init__(self, client: AsyncGitpod) -> None:
440445
self.editors = editors.AsyncEditorsResourceWithRawResponse(client.editors)
441446
self.environments = environments.AsyncEnvironmentsResourceWithRawResponse(client.environments)
442447
self.events = events.AsyncEventsResourceWithRawResponse(client.events)
448+
self.gateways = gateways.AsyncGatewaysResourceWithRawResponse(client.gateways)
443449
self.groups = groups.AsyncGroupsResourceWithRawResponse(client.groups)
444450
self.identity = identity.AsyncIdentityResourceWithRawResponse(client.identity)
445451
self.organizations = organizations.AsyncOrganizationsResourceWithRawResponse(client.organizations)
@@ -456,6 +462,7 @@ def __init__(self, client: Gitpod) -> None:
456462
self.editors = editors.EditorsResourceWithStreamingResponse(client.editors)
457463
self.environments = environments.EnvironmentsResourceWithStreamingResponse(client.environments)
458464
self.events = events.EventsResourceWithStreamingResponse(client.events)
465+
self.gateways = gateways.GatewaysResourceWithStreamingResponse(client.gateways)
459466
self.groups = groups.GroupsResourceWithStreamingResponse(client.groups)
460467
self.identity = identity.IdentityResourceWithStreamingResponse(client.identity)
461468
self.organizations = organizations.OrganizationsResourceWithStreamingResponse(client.organizations)
@@ -472,6 +479,7 @@ def __init__(self, client: AsyncGitpod) -> None:
472479
self.editors = editors.AsyncEditorsResourceWithStreamingResponse(client.editors)
473480
self.environments = environments.AsyncEnvironmentsResourceWithStreamingResponse(client.environments)
474481
self.events = events.AsyncEventsResourceWithStreamingResponse(client.events)
482+
self.gateways = gateways.AsyncGatewaysResourceWithStreamingResponse(client.gateways)
475483
self.groups = groups.AsyncGroupsResourceWithStreamingResponse(client.groups)
476484
self.identity = identity.AsyncIdentityResourceWithStreamingResponse(client.identity)
477485
self.organizations = organizations.AsyncOrganizationsResourceWithStreamingResponse(client.organizations)

src/gitpod/_models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ class FinalRequestOptionsInput(TypedDict, total=False):
737737
idempotency_key: str
738738
json_data: Body
739739
extra_json: AnyMapping
740+
follow_redirects: bool
740741

741742

742743
@final
@@ -750,6 +751,7 @@ class FinalRequestOptions(pydantic.BaseModel):
750751
files: Union[HttpxRequestFiles, None] = None
751752
idempotency_key: Union[str, None] = None
752753
post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven()
754+
follow_redirects: Union[bool, None] = None
753755

754756
# It should be noted that we cannot use `json` here as that would override
755757
# a BaseModel method in an incompatible fashion.

src/gitpod/_types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class RequestOptions(TypedDict, total=False):
100100
params: Query
101101
extra_json: AnyMapping
102102
idempotency_key: str
103+
follow_redirects: bool
103104

104105

105106
# Sentinel class used until PEP 0661 is accepted
@@ -215,3 +216,4 @@ class _GenericAlias(Protocol):
215216

216217
class HttpxSendArgs(TypedDict, total=False):
217218
auth: httpx.Auth
219+
follow_redirects: bool

src/gitpod/_utils/_proxy.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ def __dir__(self) -> Iterable[str]:
4646
@property # type: ignore
4747
@override
4848
def __class__(self) -> type: # pyright: ignore
49-
proxied = self.__get_proxied__()
49+
try:
50+
proxied = self.__get_proxied__()
51+
except Exception:
52+
return type(self)
5053
if issubclass(type(proxied), LazyProxy):
5154
return type(proxied)
5255
return proxied.__class__

src/gitpod/_utils/_resources_proxy.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from __future__ import annotations
2+
3+
from typing import Any
4+
from typing_extensions import override
5+
6+
from ._proxy import LazyProxy
7+
8+
9+
class ResourcesProxy(LazyProxy[Any]):
10+
"""A proxy for the `gitpod.resources` module.
11+
12+
This is used so that we can lazily import `gitpod.resources` only when
13+
needed *and* so that users can just import `gitpod` and reference `gitpod.resources`
14+
"""
15+
16+
@override
17+
def __load__(self) -> Any:
18+
import importlib
19+
20+
mod = importlib.import_module("gitpod.resources")
21+
return mod
22+
23+
24+
resources = ResourcesProxy().__as_proxied__()

0 commit comments

Comments
 (0)