Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
926c0dd
feat(api): aggregated API specs update
stainless-app[bot] Oct 22, 2025
434bf06
codegen metadata
stainless-app[bot] Oct 22, 2025
203e4ba
codegen metadata
stainless-app[bot] Oct 22, 2025
4dc12a7
codegen metadata
stainless-app[bot] Oct 22, 2025
a281b35
codegen metadata
stainless-app[bot] Oct 23, 2025
05ac34f
codegen metadata
stainless-app[bot] Oct 24, 2025
25247c7
codegen metadata
stainless-app[bot] Oct 24, 2025
d8886ce
chore(cloud): add *_and_poll() to *WithRawResponse and *WithStreaming
deferred Oct 24, 2025
18614cb
feat(api): aggregated API specs update
stainless-app[bot] Oct 27, 2025
da1429d
codegen metadata
stainless-app[bot] Oct 27, 2025
4e62953
feat(api): aggregated API specs update
stainless-app[bot] Oct 27, 2025
94f0e46
codegen metadata
stainless-app[bot] Oct 28, 2025
af54c88
feat(api): aggregated API specs update
stainless-app[bot] Oct 28, 2025
a253941
codegen metadata
stainless-app[bot] Oct 29, 2025
cd7152c
fix(client): close streams without requiring full consumption
stainless-app[bot] Oct 29, 2025
3ef8586
feat(api): aggregated API specs update
stainless-app[bot] Oct 29, 2025
67e4c77
chore(internal/tests): avoid race condition with implicit client cleanup
stainless-app[bot] Oct 30, 2025
62b23ee
codegen metadata
stainless-app[bot] Oct 30, 2025
9f6d1a7
codegen metadata
stainless-app[bot] Oct 30, 2025
01c7469
feat(api): aggregated API specs update
stainless-app[bot] Nov 3, 2025
9bf8a18
chore(internal): grammar fix (it's -> its)
stainless-app[bot] Nov 3, 2025
7e17f98
feat(api): aggregated API specs update
stainless-app[bot] Nov 4, 2025
e008291
feat(api): aggregated API specs update
stainless-app[bot] Nov 4, 2025
c69f622
feat(api): aggregated API specs update
stainless-app[bot] Nov 4, 2025
27bc07a
fix(cloud): members not optional in lb pools create_and_poll
pedrodeoliveira Nov 4, 2025
2802edf
feat(cloud): add support for postgres
stainless-app[bot] Nov 4, 2025
286449d
release: 0.18.0
stainless-app[bot] Nov 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.17.0"
".": "0.18.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 609
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-56132999d4ac773438df4415a4bb56c8cf7f067c3c340d80424bf968074f66dc.yml
openapi_spec_hash: c33cea043ddbfe20778e0774313fa7e6
config_hash: bb4a27712c30f7a2b52e1f3b31766f24
configured_endpoints: 618
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-1089f2c131ebee7df82e158c4210c07f019b47549d84fe6ea7f022117c83a008.yml
openapi_spec_hash: 9758acbadc1ee1bc0d826d4657e1ad4a
config_hash: 79098512b2ff15053f2813524c207add
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Changelog

## 0.18.0 (2025-11-04)

Full Changelog: [v0.17.0...v0.18.0](https://github.com/G-Core/gcore-python/compare/v0.17.0...v0.18.0)

### Features

* **api:** aggregated API specs update ([c69f622](https://github.com/G-Core/gcore-python/commit/c69f622f4d085d5c93978edbf4deb2ecbe4279d6))
* **api:** aggregated API specs update ([e008291](https://github.com/G-Core/gcore-python/commit/e008291499f90553d12deffbcef5c4a9b6752f61))
* **api:** aggregated API specs update ([7e17f98](https://github.com/G-Core/gcore-python/commit/7e17f98624fecfb8d1ad5a53a001dcd20ca15214))
* **api:** aggregated API specs update ([01c7469](https://github.com/G-Core/gcore-python/commit/01c746977c89d813e54b97c87513960a5cba42c3))
* **api:** aggregated API specs update ([3ef8586](https://github.com/G-Core/gcore-python/commit/3ef8586481df9533a0627310458bb72b9b458d2f))
* **api:** aggregated API specs update ([af54c88](https://github.com/G-Core/gcore-python/commit/af54c886222ea41e6ef57d8683fbb64e2b688a15))
* **api:** aggregated API specs update ([4e62953](https://github.com/G-Core/gcore-python/commit/4e629534e07db80d93c46e5ccc5e3d2ba48d9eb4))
* **api:** aggregated API specs update ([18614cb](https://github.com/G-Core/gcore-python/commit/18614cb786fd3ea9020cee18c2a23c4c81f116f3))
* **api:** aggregated API specs update ([926c0dd](https://github.com/G-Core/gcore-python/commit/926c0ddfcef420ba47eca7b399ea43462a18371a))
* **cloud:** add support for postgres ([2802edf](https://github.com/G-Core/gcore-python/commit/2802edf3bbac88b644ba8ff4d5b83dc0606e4b48))


### Bug Fixes

* **client:** close streams without requiring full consumption ([cd7152c](https://github.com/G-Core/gcore-python/commit/cd7152cd959a9984e5c60edb41d16fa2db342012))
* **cloud:** members not optional in lb pools create_and_poll ([27bc07a](https://github.com/G-Core/gcore-python/commit/27bc07acab63505e03f4a5b51e21544fe84877ec))


### Chores

* **cloud:** add *_and_poll() to *WithRawResponse and *WithStreaming ([d8886ce](https://github.com/G-Core/gcore-python/commit/d8886ce4abeadd3d260c3f533e72b778d521482c))
* **internal/tests:** avoid race condition with implicit client cleanup ([67e4c77](https://github.com/G-Core/gcore-python/commit/67e4c77936fca0b2192b931ec71003dd62383c81))
* **internal:** grammar fix (it's -> its) ([9bf8a18](https://github.com/G-Core/gcore-python/commit/9bf8a18f42a2122f43d9084ff3287e4d1aa7dd95))

## 0.17.0 (2025-10-21)

Full Changelog: [v0.16.0...v0.17.0](https://github.com/G-Core/gcore-python/compare/v0.16.0...v0.17.0)
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ client = Gcore(
)

project = client.cloud.projects.create(
name="New Project",
name="my-project",
)
print(project.id)
```
Expand All @@ -60,7 +60,7 @@ client = AsyncGcore(

async def main() -> None:
project = await client.cloud.projects.create(
name="New Project",
name="my-project",
)
print(project.id)

Expand Down Expand Up @@ -95,7 +95,7 @@ async def main() -> None:
http_client=DefaultAioHttpClient(),
) as client:
project = await client.cloud.projects.create(
name="New Project",
name="my-project",
)
print(project.id)

Expand Down Expand Up @@ -236,7 +236,7 @@ client = Gcore()

try:
client.cloud.projects.create(
name="New Project",
name="my-project",
)
except gcore.APIConnectionError as e:
print("The server could not be reached")
Expand Down Expand Up @@ -280,7 +280,7 @@ client = Gcore(

# Or, configure per-request:
client.with_options(max_retries=5).cloud.projects.create(
name="New Project",
name="my-project",
)
```

Expand All @@ -305,7 +305,7 @@ client = Gcore(

# Override per-request:
client.with_options(timeout=5.0).cloud.projects.create(
name="New Project",
name="my-project",
)
```

Expand Down Expand Up @@ -348,7 +348,7 @@ from gcore import Gcore

client = Gcore()
response = client.cloud.projects.with_raw_response.create(
name="New Project",
name="my-project",
)
print(response.headers.get('X-My-Header'))

Expand All @@ -368,7 +368,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi

```python
with client.cloud.projects.with_streaming_response.create(
name="New Project",
name="my-project",
) as response:
print(response.headers.get("X-My-Header"))

Expand Down
63 changes: 60 additions & 3 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ Methods:
- <code title="post /cloud/v1/lblisteners/{project_id}/{region_id}">client.cloud.load_balancers.listeners.<a href="./src/gcore/resources/cloud/load_balancers/listeners.py">create</a>(\*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/load_balancers/listener_create_params.py">params</a>) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
- <code title="patch /cloud/v2/lblisteners/{project_id}/{region_id}/{listener_id}">client.cloud.load_balancers.listeners.<a href="./src/gcore/resources/cloud/load_balancers/listeners.py">update</a>(listener_id, \*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/load_balancers/listener_update_params.py">params</a>) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
- <code title="get /cloud/v1/lblisteners/{project_id}/{region_id}">client.cloud.load_balancers.listeners.<a href="./src/gcore/resources/cloud/load_balancers/listeners.py">list</a>(\*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/load_balancers/listener_list_params.py">params</a>) -> <a href="./src/gcore/types/cloud/load_balancer_listener_list.py">LoadBalancerListenerList</a></code>
- <code title="delete /cloud/v1/lblisteners/{project_id}/{region_id}/{listener_id}">client.cloud.load_balancers.listeners.<a href="./src/gcore/resources/cloud/load_balancers/listeners.py">delete</a>(listener_id, \*, project_id, region_id) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
- <code title="delete /cloud/v1/lblisteners/{project_id}/{region_id}/{listener_id}">client.cloud.load_balancers.listeners.<a href="./src/gcore/resources/cloud/load_balancers/listeners.py">delete</a>(listener_id, \*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/load_balancers/listener_delete_params.py">params</a>) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
- <code title="get /cloud/v1/lblisteners/{project_id}/{region_id}/{listener_id}">client.cloud.load_balancers.listeners.<a href="./src/gcore/resources/cloud/load_balancers/listeners.py">get</a>(listener_id, \*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/load_balancers/listener_get_params.py">params</a>) -> <a href="./src/gcore/types/cloud/load_balancer_listener_detail.py">LoadBalancerListenerDetail</a></code>

### Pools
Expand Down Expand Up @@ -1006,6 +1006,63 @@ Methods:

- <code title="post /cloud/v1/usage_report">client.cloud.usage_reports.<a href="./src/gcore/resources/cloud/usage_reports.py">get</a>(\*\*<a href="src/gcore/types/cloud/usage_report_get_params.py">params</a>) -> <a href="./src/gcore/types/cloud/usage_report.py">UsageReport</a></code>

## Databases

### Postgres

#### Clusters

Types:

```python
from gcore.types.cloud.databases.postgres import PostgresCluster, PostgresClusterShort
```

Methods:

- <code title="post /cloud/v1/dbaas/postgres/clusters/{project_id}/{region_id}">client.cloud.databases.postgres.clusters.<a href="./src/gcore/resources/cloud/databases/postgres/clusters/clusters.py">create</a>(\*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/databases/postgres/cluster_create_params.py">params</a>) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
- <code title="patch /cloud/v1/dbaas/postgres/clusters/{project_id}/{region_id}/{cluster_name}">client.cloud.databases.postgres.clusters.<a href="./src/gcore/resources/cloud/databases/postgres/clusters/clusters.py">update</a>(cluster_name, \*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/databases/postgres/cluster_update_params.py">params</a>) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
- <code title="get /cloud/v1/dbaas/postgres/clusters/{project_id}/{region_id}">client.cloud.databases.postgres.clusters.<a href="./src/gcore/resources/cloud/databases/postgres/clusters/clusters.py">list</a>(\*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/databases/postgres/cluster_list_params.py">params</a>) -> <a href="./src/gcore/types/cloud/databases/postgres/postgres_cluster_short.py">SyncOffsetPage[PostgresClusterShort]</a></code>
- <code title="delete /cloud/v1/dbaas/postgres/clusters/{project_id}/{region_id}/{cluster_name}">client.cloud.databases.postgres.clusters.<a href="./src/gcore/resources/cloud/databases/postgres/clusters/clusters.py">delete</a>(cluster_name, \*, project_id, region_id) -> <a href="./src/gcore/types/cloud/task_id_list.py">TaskIDList</a></code>
- <code title="get /cloud/v1/dbaas/postgres/clusters/{project_id}/{region_id}/{cluster_name}">client.cloud.databases.postgres.clusters.<a href="./src/gcore/resources/cloud/databases/postgres/clusters/clusters.py">get</a>(cluster_name, \*, project_id, region_id) -> <a href="./src/gcore/types/cloud/databases/postgres/postgres_cluster.py">PostgresCluster</a></code>

##### UserCredentials

Types:

```python
from gcore.types.cloud.databases.postgres.clusters import PostgresUserCredentials
```

Methods:

- <code title="get /cloud/v1/dbaas/postgres/clusters/{project_id}/{region_id}/{cluster_name}/users/{username}/credentials">client.cloud.databases.postgres.clusters.user_credentials.<a href="./src/gcore/resources/cloud/databases/postgres/clusters/user_credentials.py">get</a>(username, \*, project_id, region_id, cluster_name) -> <a href="./src/gcore/types/cloud/databases/postgres/clusters/postgres_user_credentials.py">PostgresUserCredentials</a></code>
- <code title="post /cloud/v1/dbaas/postgres/clusters/{project_id}/{region_id}/{cluster_name}/users/{username}/credentials">client.cloud.databases.postgres.clusters.user_credentials.<a href="./src/gcore/resources/cloud/databases/postgres/clusters/user_credentials.py">regenerate</a>(username, \*, project_id, region_id, cluster_name) -> <a href="./src/gcore/types/cloud/databases/postgres/clusters/postgres_user_credentials.py">PostgresUserCredentials</a></code>

#### Configurations

Types:

```python
from gcore.types.cloud.databases.postgres import PostgresConfiguration
```

Methods:

- <code title="get /cloud/v1/dbaas/postgres/configuration/{project_id}/{region_id}">client.cloud.databases.postgres.configurations.<a href="./src/gcore/resources/cloud/databases/postgres/configurations.py">get</a>(\*, project_id, region_id) -> <a href="./src/gcore/types/cloud/databases/postgres/postgres_configuration.py">PostgresConfiguration</a></code>

#### CustomConfigurations

Types:

```python
from gcore.types.cloud.databases.postgres import PgConfValidation
```

Methods:

- <code title="post /cloud/v1/dbaas/postgres/validate_pg_conf/{project_id}/{region_id}">client.cloud.databases.postgres.custom_configurations.<a href="./src/gcore/resources/cloud/databases/postgres/custom_configurations.py">validate</a>(\*, project_id, region_id, \*\*<a href="src/gcore/types/cloud/databases/postgres/custom_configuration_validate_params.py">params</a>) -> <a href="./src/gcore/types/cloud/databases/postgres/pg_conf_validation.py">PgConfValidation</a></code>

# Waap

Types:
Expand Down Expand Up @@ -2383,5 +2440,5 @@ from gcore.types.cdn import PublicIPList, PublicNetworkList

Methods:

- <code title="get /cdn/public-net-list">client.cdn.ip_ranges.<a href="./src/gcore/resources/cdn/ip_ranges.py">list</a>() -> <a href="./src/gcore/types/cdn/public_network_list.py">PublicNetworkList</a></code>
- <code title="get /cdn/public-ip-list">client.cdn.ip_ranges.<a href="./src/gcore/resources/cdn/ip_ranges.py">list_ips</a>() -> <a href="./src/gcore/types/cdn/public_ip_list.py">PublicIPList</a></code>
- <code title="get /cdn/public-net-list">client.cdn.ip_ranges.<a href="./src/gcore/resources/cdn/ip_ranges.py">list</a>(\*\*<a href="src/gcore/types/cdn/ip_range_list_params.py">params</a>) -> <a href="./src/gcore/types/cdn/public_network_list.py">PublicNetworkList</a></code>
- <code title="get /cdn/public-ip-list">client.cdn.ip_ranges.<a href="./src/gcore/resources/cdn/ip_ranges.py">list_ips</a>(\*\*<a href="src/gcore/types/cdn/ip_range_list_ips_params.py">params</a>) -> <a href="./src/gcore/types/cdn/public_ip_list.py">PublicIPList</a></code>
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "gcore"
version = "0.17.0"
version = "0.18.0"
description = "The official Python library for the gcore API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
10 changes: 4 additions & 6 deletions src/gcore/_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ def __stream__(self) -> Iterator[_T]:
for sse in iterator:
yield process_data(data=sse.json(), cast_to=cast_to, response=response)

# Ensure the entire stream is consumed
for _sse in iterator:
...
# As we might not fully consume the response stream, we need to close it explicitly
response.close()

def __enter__(self) -> Self:
return self
Expand Down Expand Up @@ -121,9 +120,8 @@ async def __stream__(self) -> AsyncIterator[_T]:
async for sse in iterator:
yield process_data(data=sse.json(), cast_to=cast_to, response=response)

# Ensure the entire stream is consumed
async for _sse in iterator:
...
# As we might not fully consume the response stream, we need to close it explicitly
await response.aclose()

async def __aenter__(self) -> Self:
return self
Expand Down
2 changes: 1 addition & 1 deletion src/gcore/_utils/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]:
# Type safe methods for narrowing types with TypeVars.
# The default narrowing for isinstance(obj, dict) is dict[unknown, unknown],
# however this cause Pyright to rightfully report errors. As we know we don't
# care about the contained types we can safely use `object` in it's place.
# care about the contained types we can safely use `object` in its place.
#
# There are two separate functions defined, `is_*` and `is_*_t` for different use cases.
# `is_*` is for when you're dealing with an unknown input
Expand Down
2 changes: 1 addition & 1 deletion src/gcore/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "gcore"
__version__ = "0.17.0" # x-release-please-version
__version__ = "0.18.0" # x-release-please-version
Loading
Loading