Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ec4b950
codegen metadata
stainless-app[bot] Sep 16, 2025
adf8df6
chore(internal): update pydantic dependency
stainless-app[bot] Sep 16, 2025
fc88cbd
feat(api): aggregated API specs update
stainless-app[bot] Sep 18, 2025
2c7bead
codegen metadata
stainless-app[bot] Sep 18, 2025
24bebe1
chore(types): change optional parameter type from NotGiven to Omit
stainless-app[bot] Sep 18, 2025
2a4abf1
chore: use Omit in more places
RobertCraigie Sep 19, 2025
9482c47
chore: do not install brew dependencies in ./scripts/bootstrap by def…
stainless-app[bot] Sep 19, 2025
f1ff659
feat(api): aggregated API specs update
stainless-app[bot] Sep 22, 2025
d8b63db
codegen metadata
stainless-app[bot] Sep 22, 2025
0784cf9
feat(api): aggregated API specs update
stainless-app[bot] Sep 22, 2025
2560541
chore: improve example values
stainless-app[bot] Sep 22, 2025
92ed2a3
codegen metadata
stainless-app[bot] Sep 23, 2025
0199b8c
feat(api): aggregated API specs update
stainless-app[bot] Sep 23, 2025
de1f58f
codegen metadata
stainless-app[bot] Sep 24, 2025
0e7967b
feat(api): aggregated API specs update
stainless-app[bot] Sep 24, 2025
ed887c6
codegen metadata
stainless-app[bot] Sep 25, 2025
7850a7a
codegen metadata
stainless-app[bot] Sep 25, 2025
634f34b
feat(cloud): enable TF for floating IPs
stainless-app[bot] Sep 25, 2025
b1cf92b
codegen metadata
stainless-app[bot] Sep 26, 2025
cca7d43
codegen metadata
stainless-app[bot] Sep 29, 2025
e5961ca
fix(client): correctly generate K8sClusterSlurmAddonV2Serializers
stainless-app[bot] Sep 29, 2025
e07d4e7
feat(cdn): add API support
stainless-app[bot] Sep 30, 2025
0281f97
release: 0.14.0
stainless-app[bot] Sep 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
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.13.0"
".": "0.14.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: 524
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-3721d496395e684887e9ba0386375910a4fe68253893ccfce4e79c2e8a5b84af.yml
openapi_spec_hash: f95b9f70ed1b3b8230ef3a092c6acedd
config_hash: bfac9dcd59fec1e54559dc11fcba758e
configured_endpoints: 612
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-d59e09eb6882032973e42339edbc5170a0d695dcb127e28e29109f1a1f088afd.yml
openapi_spec_hash: 8768c88e22bbe1d3042539be56ea8469
config_hash: 11eb703eee66609eba76695b18f8cb4a
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## 0.14.0 (2025-09-30)

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

### Features

* **api:** aggregated API specs update ([0e7967b](https://github.com/G-Core/gcore-python/commit/0e7967b1f6be77cac807f5a1e3d3483c9151902b))
* **api:** aggregated API specs update ([0199b8c](https://github.com/G-Core/gcore-python/commit/0199b8ccce3fc74ba60586b9cbe6411b29bf9ece))
* **api:** aggregated API specs update ([0784cf9](https://github.com/G-Core/gcore-python/commit/0784cf918ef8d820a7a5ecfd9dc5b185829041a1))
* **api:** aggregated API specs update ([f1ff659](https://github.com/G-Core/gcore-python/commit/f1ff65992ff4992554d00f10b1b17794155cc129))
* **api:** aggregated API specs update ([fc88cbd](https://github.com/G-Core/gcore-python/commit/fc88cbd66531167d50927d4a87c53d5f05fbdce1))
* **cdn:** add API support ([e07d4e7](https://github.com/G-Core/gcore-python/commit/e07d4e7427042c2996c6dae86f70f0cc86a8d6d5))
* **cloud:** enable TF for floating IPs ([634f34b](https://github.com/G-Core/gcore-python/commit/634f34b96fb7e74f7566493af8716f90d85016b9))


### Bug Fixes

* **client:** correctly generate K8sClusterSlurmAddonV2Serializers ([e5961ca](https://github.com/G-Core/gcore-python/commit/e5961ca7683a89bf6e551bd4bedd82c1b76e4052))


### Chores

* do not install brew dependencies in ./scripts/bootstrap by default ([9482c47](https://github.com/G-Core/gcore-python/commit/9482c4755e629b9411290d189efc5f1de4bbbec1))
* improve example values ([2560541](https://github.com/G-Core/gcore-python/commit/25605419cf1878d28e77251f44246b68212efb8a))
* **internal:** update pydantic dependency ([adf8df6](https://github.com/G-Core/gcore-python/commit/adf8df69810c6e978395aefe12b4ba6f88772d16))
* **types:** change optional parameter type from NotGiven to Omit ([24bebe1](https://github.com/G-Core/gcore-python/commit/24bebe1a809b38732c6b960f5cc6703fa2d6d1be))
* use Omit in more places ([2a4abf1](https://github.com/G-Core/gcore-python/commit/2a4abf1aa6f07c9c9f8d16150caed76e8e35a146))

## 0.13.0 (2025-09-16)

Full Changelog: [v0.12.0...v0.13.0](https://github.com/G-Core/gcore-python/compare/v0.12.0...v0.13.0)
Expand Down
315 changes: 315 additions & 0 deletions api.md

Large diffs are not rendered by default.

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.13.0"
version = "0.14.0"
description = "The official Python library for the gcore API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
7 changes: 5 additions & 2 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ pluggy==1.5.0
propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.10.3
pydantic==2.11.9
# via gcore
pydantic-core==2.27.1
pydantic-core==2.33.2
# via pydantic
pygments==2.18.0
# via rich
Expand Down Expand Up @@ -130,6 +130,9 @@ typing-extensions==4.12.2
# via pydantic
# via pydantic-core
# via pyright
# via typing-inspection
typing-inspection==0.4.1
# via pydantic
virtualenv==20.24.5
# via nox
yarl==1.20.0
Expand Down
7 changes: 5 additions & 2 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ multidict==6.4.4
propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.10.3
pydantic==2.11.9
# via gcore
pydantic-core==2.27.1
pydantic-core==2.33.2
# via pydantic
sniffio==1.3.0
# via anyio
Expand All @@ -68,5 +68,8 @@ typing-extensions==4.12.2
# via multidict
# via pydantic
# via pydantic-core
# via typing-inspection
typing-inspection==0.4.1
# via pydantic
yarl==1.20.0
# via aiohttp
14 changes: 11 additions & 3 deletions scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ set -e

cd "$(dirname "$0")/.."

if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then
brew bundle check >/dev/null 2>&1 || {
echo "==> Installing Homebrew dependencies…"
brew bundle
echo -n "==> Install Homebrew dependencies? (y/N): "
read -r response
case "$response" in
[yY][eE][sS]|[yY])
brew bundle
;;
*)
;;
esac
echo
}
fi

Expand Down
4 changes: 3 additions & 1 deletion src/gcore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import typing as _t

from . import types
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
from ._utils import file_from_path
from ._client import Gcore, Client, Stream, Timeout, Transport, AsyncGcore, AsyncClient, AsyncStream, RequestOptions
from ._models import BaseModel
Expand Down Expand Up @@ -38,7 +38,9 @@
"ProxiesTypes",
"NotGiven",
"NOT_GIVEN",
"not_given",
"Omit",
"omit",
"GcoreError",
"APIError",
"APIStatusError",
Expand Down
18 changes: 9 additions & 9 deletions src/gcore/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
from ._qs import Querystring
from ._files import to_httpx_files, async_to_httpx_files
from ._types import (
NOT_GIVEN,
Body,
Omit,
Query,
Expand All @@ -57,6 +56,7 @@
RequestOptions,
HttpxRequestFiles,
ModelBuilderProtocol,
not_given,
)
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
from ._compat import PYDANTIC_V1, model_copy, model_dump
Expand Down Expand Up @@ -145,9 +145,9 @@ def __init__(
def __init__(
self,
*,
url: URL | NotGiven = NOT_GIVEN,
json: Body | NotGiven = NOT_GIVEN,
params: Query | NotGiven = NOT_GIVEN,
url: URL | NotGiven = not_given,
json: Body | NotGiven = not_given,
params: Query | NotGiven = not_given,
) -> None:
self.url = url
self.json = json
Expand Down Expand Up @@ -595,7 +595,7 @@ def _maybe_override_cast_to(self, cast_to: type[ResponseT], options: FinalReques
# we internally support defining a temporary header to override the
# default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response`
# see _response.py for implementation details
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN)
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given)
if is_given(override_cast_to):
options.headers = headers
return cast(Type[ResponseT], override_cast_to)
Expand Down Expand Up @@ -825,7 +825,7 @@ def __init__(
version: str,
base_url: str | URL,
max_retries: int = DEFAULT_MAX_RETRIES,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.Client | None = None,
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -1356,7 +1356,7 @@ def __init__(
base_url: str | URL,
_strict_response_validation: bool,
max_retries: int = DEFAULT_MAX_RETRIES,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.AsyncClient | None = None,
custom_headers: Mapping[str, str] | None = None,
custom_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -1818,8 +1818,8 @@ def make_request_options(
extra_query: Query | None = None,
extra_body: Body | None = None,
idempotency_key: str | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
post_parser: PostParser | NotGiven = NOT_GIVEN,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
post_parser: PostParser | NotGiven = not_given,
) -> RequestOptions:
"""Create a dict of type RequestOptions without keys of NotGiven values."""
options: RequestOptions = {}
Expand Down
35 changes: 25 additions & 10 deletions src/gcore/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
from __future__ import annotations

import os
from typing import Any, Union, Mapping
from typing import Any, Mapping
from typing_extensions import Self, override

import httpx

from . import _exceptions
from ._qs import Querystring
from ._types import (
NOT_GIVEN,
Omit,
Timeout,
NotGiven,
Transport,
ProxiesTypes,
RequestOptions,
not_given,
)
from ._utils import is_given, get_async_library, maybe_coerce_integer
from ._version import __version__
Expand All @@ -28,6 +28,7 @@
SyncAPIClient,
AsyncAPIClient,
)
from .resources.cdn import cdn
from .resources.dns import dns
from .resources.iam import iam
from .resources.waap import waap
Expand All @@ -49,6 +50,7 @@ class Gcore(SyncAPIClient):
security: security.SecurityResource
dns: dns.DNSResource
storage: storage.StorageResource
cdn: cdn.CdnResource
with_raw_response: GcoreWithRawResponse
with_streaming_response: GcoreWithStreamedResponse

Expand All @@ -66,7 +68,7 @@ def __init__(
cloud_region_id: int | None = None,
cloud_polling_interval_seconds: int | None = 3,
base_url: str | httpx.URL | None = None,
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
max_retries: int = DEFAULT_MAX_RETRIES,
default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -113,6 +115,7 @@ def __init__(

if base_url is None:
base_url = os.environ.get("GCORE_BASE_URL")
self._base_url_overridden = base_url is not None
if base_url is None:
base_url = f"https://api.gcore.com"

Expand All @@ -135,6 +138,7 @@ def __init__(
self.security = security.SecurityResource(self)
self.dns = dns.DNSResource(self)
self.storage = storage.StorageResource(self)
self.cdn = cdn.CdnResource(self)
self.with_raw_response = GcoreWithRawResponse(self)
self.with_streaming_response = GcoreWithStreamedResponse(self)

Expand Down Expand Up @@ -166,9 +170,9 @@ def copy(
cloud_region_id: int | None = None,
cloud_polling_interval_seconds: int | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.Client | None = None,
max_retries: int | NotGiven = NOT_GIVEN,
max_retries: int | NotGiven = not_given,
default_headers: Mapping[str, str] | None = None,
set_default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -197,7 +201,7 @@ def copy(
params = set_default_query

http_client = http_client or self._client
return self.__class__(
client = self.__class__(
api_key=api_key or self.api_key,
cloud_project_id=cloud_project_id or self.cloud_project_id,
cloud_region_id=cloud_region_id or self.cloud_region_id,
Expand All @@ -210,6 +214,8 @@ def copy(
default_query=params,
**_extra_kwargs,
)
client._base_url_overridden = self._base_url_overridden or base_url is not None
return client

# Alias for `copy` for nicer inline usage, e.g.
# client.with_options(timeout=10).foo.create(...)
Expand Down Expand Up @@ -276,6 +282,7 @@ class AsyncGcore(AsyncAPIClient):
security: security.AsyncSecurityResource
dns: dns.AsyncDNSResource
storage: storage.AsyncStorageResource
cdn: cdn.AsyncCdnResource
with_raw_response: AsyncGcoreWithRawResponse
with_streaming_response: AsyncGcoreWithStreamedResponse

Expand All @@ -293,7 +300,7 @@ def __init__(
cloud_region_id: int | None = None,
cloud_polling_interval_seconds: int | None = 3,
base_url: str | httpx.URL | None = None,
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
max_retries: int = DEFAULT_MAX_RETRIES,
default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -340,6 +347,7 @@ def __init__(

if base_url is None:
base_url = os.environ.get("GCORE_BASE_URL")
self._base_url_overridden = base_url is not None
if base_url is None:
base_url = f"https://api.gcore.com"

Expand All @@ -362,6 +370,7 @@ def __init__(
self.security = security.AsyncSecurityResource(self)
self.dns = dns.AsyncDNSResource(self)
self.storage = storage.AsyncStorageResource(self)
self.cdn = cdn.AsyncCdnResource(self)
self.with_raw_response = AsyncGcoreWithRawResponse(self)
self.with_streaming_response = AsyncGcoreWithStreamedResponse(self)

Expand Down Expand Up @@ -393,9 +402,9 @@ def copy(
cloud_region_id: int | None = None,
cloud_polling_interval_seconds: int | None = None,
base_url: str | httpx.URL | None = None,
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
timeout: float | Timeout | None | NotGiven = not_given,
http_client: httpx.AsyncClient | None = None,
max_retries: int | NotGiven = NOT_GIVEN,
max_retries: int | NotGiven = not_given,
default_headers: Mapping[str, str] | None = None,
set_default_headers: Mapping[str, str] | None = None,
default_query: Mapping[str, object] | None = None,
Expand Down Expand Up @@ -424,7 +433,7 @@ def copy(
params = set_default_query

http_client = http_client or self._client
return self.__class__(
client = self.__class__(
api_key=api_key or self.api_key,
cloud_project_id=cloud_project_id or self.cloud_project_id,
cloud_region_id=cloud_region_id or self.cloud_region_id,
Expand All @@ -437,6 +446,8 @@ def copy(
default_query=params,
**_extra_kwargs,
)
client._base_url_overridden = self._base_url_overridden or base_url is not None
return client

# Alias for `copy` for nicer inline usage, e.g.
# client.with_options(timeout=10).foo.create(...)
Expand Down Expand Up @@ -504,6 +515,7 @@ def __init__(self, client: Gcore) -> None:
self.security = security.SecurityResourceWithRawResponse(client.security)
self.dns = dns.DNSResourceWithRawResponse(client.dns)
self.storage = storage.StorageResourceWithRawResponse(client.storage)
self.cdn = cdn.CdnResourceWithRawResponse(client.cdn)


class AsyncGcoreWithRawResponse:
Expand All @@ -516,6 +528,7 @@ def __init__(self, client: AsyncGcore) -> None:
self.security = security.AsyncSecurityResourceWithRawResponse(client.security)
self.dns = dns.AsyncDNSResourceWithRawResponse(client.dns)
self.storage = storage.AsyncStorageResourceWithRawResponse(client.storage)
self.cdn = cdn.AsyncCdnResourceWithRawResponse(client.cdn)


class GcoreWithStreamedResponse:
Expand All @@ -528,6 +541,7 @@ def __init__(self, client: Gcore) -> None:
self.security = security.SecurityResourceWithStreamingResponse(client.security)
self.dns = dns.DNSResourceWithStreamingResponse(client.dns)
self.storage = storage.StorageResourceWithStreamingResponse(client.storage)
self.cdn = cdn.CdnResourceWithStreamingResponse(client.cdn)


class AsyncGcoreWithStreamedResponse:
Expand All @@ -540,6 +554,7 @@ def __init__(self, client: AsyncGcore) -> None:
self.security = security.AsyncSecurityResourceWithStreamingResponse(client.security)
self.dns = dns.AsyncDNSResourceWithStreamingResponse(client.dns)
self.storage = storage.AsyncStorageResourceWithStreamingResponse(client.storage)
self.cdn = cdn.AsyncCdnResourceWithStreamingResponse(client.cdn)


Client = Gcore
Expand Down
Loading
Loading