diff --git a/.release-please-manifest.json b/.release-please-manifest.json index cb9d2541..7f3f5c84 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.22.0" + ".": "0.23.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 0da4a381..c2b1ebe1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 633 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-61246c736228a6c005ecc784c08b6339b9afff6b3ea7225ef6bad7112e158355.yml -openapi_spec_hash: 2dfeaccd1623885572ec0f968f8f50c0 -config_hash: ed81680ad8f1babe06844ab73e7148d1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-415b3e1ff98241ebe58f65df0e6ee1381f07ced3d6e9af8bbf9ff8ba25ad655d.yml +openapi_spec_hash: cbcb8f94fedaa853d6fa4763016ce6e0 +config_hash: c71c5fd84e30d315500ae54ec3a83b71 diff --git a/CHANGELOG.md b/CHANGELOG.md index c3346843..09e7067c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,29 @@ # Changelog +## 0.23.0 (2025-12-01) + +Full Changelog: [v0.22.0...v0.23.0](https://github.com/G-Core/gcore-python/compare/v0.22.0...v0.23.0) + +### ⚠ BREAKING CHANGES + +* **cloud:** change *_and_poll signature types to correspond to regular methods + +### Features + +* **api:** aggregated API specs update ([66af572](https://github.com/G-Core/gcore-python/commit/66af57201d06fc54c6b79a59690982bcc107fbfa)) +* **api:** aggregated API specs update ([8e6e84f](https://github.com/G-Core/gcore-python/commit/8e6e84f26b4dfc56558641e3996529f7552a7b9f)) + + +### Bug Fixes + +* **cloud:** change *_and_poll signature types to correspond to regular methods ([d58e9b4](https://github.com/G-Core/gcore-python/commit/d58e9b48d2aa104beef736c57b6170886bea6072)) +* ensure streams are always closed ([e2716cb](https://github.com/G-Core/gcore-python/commit/e2716cbc3b7de2b3fe7eef68fa1c07dcf4014385)) + + +### Chores + +* **deps:** mypy 1.18.1 has a regression, pin to 1.17 ([7703d53](https://github.com/G-Core/gcore-python/commit/7703d534a550a9465212e391aeeef906cf589dd0)) + ## 0.22.0 (2025-11-25) Full Changelog: [v0.21.0...v0.22.0](https://github.com/G-Core/gcore-python/compare/v0.21.0...v0.22.0) diff --git a/pyproject.toml b/pyproject.toml index ae458cfd..73044cac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gcore" -version = "0.22.0" +version = "0.23.0" description = "The official Python library for the gcore API" dynamic = ["readme"] license = "Apache-2.0" @@ -46,7 +46,7 @@ managed = true # version pins are in requirements-dev.lock dev-dependencies = [ "pyright==1.1.399", - "mypy", + "mypy==1.17", "respx", "pytest", "pytest-asyncio", diff --git a/requirements-dev.lock b/requirements-dev.lock index 558fe7ca..62af3e02 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -75,7 +75,7 @@ mdurl==0.1.2 multidict==6.4.4 # via aiohttp # via yarl -mypy==1.14.1 +mypy==1.17.0 mypy-extensions==1.0.0 # via mypy nodeenv==1.8.0 @@ -84,6 +84,8 @@ nox==2023.4.22 packaging==23.2 # via nox # via pytest +pathspec==0.12.1 + # via mypy platformdirs==3.11.0 # via virtualenv pluggy==1.5.0 diff --git a/requirements.lock b/requirements.lock index bdcade78..5275f060 100644 --- a/requirements.lock +++ b/requirements.lock @@ -55,21 +55,21 @@ multidict==6.4.4 propcache==0.3.1 # via aiohttp # via yarl -pydantic==2.11.9 +pydantic==2.12.5 # via gcore -pydantic-core==2.33.2 +pydantic-core==2.41.5 # via pydantic sniffio==1.3.0 # via anyio # via gcore -typing-extensions==4.12.2 +typing-extensions==4.15.0 # via anyio # via gcore # via multidict # via pydantic # via pydantic-core # via typing-inspection -typing-inspection==0.4.1 +typing-inspection==0.4.2 # via pydantic yarl==1.20.0 # via aiohttp diff --git a/src/gcore/_streaming.py b/src/gcore/_streaming.py index 16c106ae..82ff9d32 100644 --- a/src/gcore/_streaming.py +++ b/src/gcore/_streaming.py @@ -54,11 +54,12 @@ def __stream__(self) -> Iterator[_T]: process_data = self._client._process_response_data iterator = self._iter_events() - for sse in iterator: - yield process_data(data=sse.json(), cast_to=cast_to, response=response) - - # As we might not fully consume the response stream, we need to close it explicitly - response.close() + try: + for sse in iterator: + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + finally: + # Ensure the response is closed even if the consumer doesn't read all data + response.close() def __enter__(self) -> Self: return self @@ -117,11 +118,12 @@ async def __stream__(self) -> AsyncIterator[_T]: process_data = self._client._process_response_data iterator = self._iter_events() - async for sse in iterator: - yield process_data(data=sse.json(), cast_to=cast_to, response=response) - - # As we might not fully consume the response stream, we need to close it explicitly - await response.aclose() + try: + async for sse in iterator: + yield process_data(data=sse.json(), cast_to=cast_to, response=response) + finally: + # Ensure the response is closed even if the consumer doesn't read all data + await response.aclose() async def __aenter__(self) -> Self: return self diff --git a/src/gcore/_version.py b/src/gcore/_version.py index 58fc4d82..addbcdc6 100644 --- a/src/gcore/_version.py +++ b/src/gcore/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "gcore" -__version__ = "0.22.0" # x-release-please-version +__version__ = "0.23.0" # x-release-please-version diff --git a/src/gcore/resources/cloud/baremetal/servers.py b/src/gcore/resources/cloud/baremetal/servers.py index 14aca2a2..b8be6814 100644 --- a/src/gcore/resources/cloud/baremetal/servers.py +++ b/src/gcore/resources/cloud/baremetal/servers.py @@ -54,7 +54,7 @@ def create( region_id: int | None = None, flavor: str, interfaces: Iterable[server_create_params.Interface], - app_config: Optional[object] | Omit = omit, + app_config: Optional[Dict[str, object]] | Omit = omit, apptemplate_id: str | Omit = omit, ddos_profile: server_create_params.DDOSProfile | Omit = omit, image_id: str | Omit = omit, @@ -404,7 +404,7 @@ def create_and_poll( region_id: int | None = None, flavor: str, interfaces: Iterable[server_create_params.Interface], - app_config: Optional[object] | Omit = omit, + app_config: Optional[Dict[str, object]] | Omit = omit, apptemplate_id: str | Omit = omit, ddos_profile: server_create_params.DDOSProfile | Omit = omit, image_id: str | Omit = omit, @@ -546,7 +546,7 @@ async def create( region_id: int | None = None, flavor: str, interfaces: Iterable[server_create_params.Interface], - app_config: Optional[object] | Omit = omit, + app_config: Optional[Dict[str, object]] | Omit = omit, apptemplate_id: str | Omit = omit, ddos_profile: server_create_params.DDOSProfile | Omit = omit, image_id: str | Omit = omit, @@ -896,7 +896,7 @@ async def create_and_poll( region_id: int | None = None, flavor: str, interfaces: Iterable[server_create_params.Interface], - app_config: Optional[object] | Omit = omit, + app_config: Optional[Dict[str, object]] | Omit = omit, apptemplate_id: str | Omit = omit, ddos_profile: server_create_params.DDOSProfile | Omit = omit, image_id: str | Omit = omit, diff --git a/src/gcore/resources/cloud/billing_reservations.py b/src/gcore/resources/cloud/billing_reservations.py index 19127d09..12ea8829 100644 --- a/src/gcore/resources/cloud/billing_reservations.py +++ b/src/gcore/resources/cloud/billing_reservations.py @@ -62,7 +62,7 @@ def list( configurations and associated pricing. Args: - metric_name: Name from billing features for specific resource + metric_name: Metric name for the resource (e.g., 'bm1-hf-`medium_min`') order_by: Order by field and direction. @@ -138,7 +138,7 @@ async def list( configurations and associated pricing. Args: - metric_name: Name from billing features for specific resource + metric_name: Metric name for the resource (e.g., 'bm1-hf-`medium_min`') order_by: Order by field and direction. diff --git a/src/gcore/resources/cloud/instances/instances.py b/src/gcore/resources/cloud/instances/instances.py index 87e224e7..68723851 100644 --- a/src/gcore/resources/cloud/instances/instances.py +++ b/src/gcore/resources/cloud/instances/instances.py @@ -118,7 +118,7 @@ def create( interfaces: Iterable[instance_create_params.Interface], volumes: Iterable[instance_create_params.Volume], allow_app_ports: bool | Omit = omit, - configuration: Optional[object] | Omit = omit, + configuration: Optional[Dict[str, object]] | Omit = omit, name: str | Omit = omit, name_template: str | Omit = omit, password: str | Omit = omit, @@ -272,7 +272,7 @@ def create_and_poll( interfaces: Iterable[instance_create_params.Interface], volumes: Iterable[instance_create_params.Volume], allow_app_ports: bool | Omit = omit, - configuration: Optional[object] | Omit = omit, + configuration: Optional[Dict[str, object]] | Omit = omit, name: str | Omit = omit, name_template: str | Omit = omit, password: str | Omit = omit, @@ -1542,7 +1542,7 @@ async def create( interfaces: Iterable[instance_create_params.Interface], volumes: Iterable[instance_create_params.Volume], allow_app_ports: bool | Omit = omit, - configuration: Optional[object] | Omit = omit, + configuration: Optional[Dict[str, object]] | Omit = omit, name: str | Omit = omit, name_template: str | Omit = omit, password: str | Omit = omit, @@ -1696,7 +1696,7 @@ async def create_and_poll( interfaces: Iterable[instance_create_params.Interface], volumes: Iterable[instance_create_params.Volume], allow_app_ports: bool | Omit = omit, - configuration: Optional[object] | Omit = omit, + configuration: Optional[Dict[str, object]] | Omit = omit, name: str | Omit = omit, name_template: str | Omit = omit, password: str | Omit = omit, diff --git a/src/gcore/resources/cloud/security_groups/security_groups.py b/src/gcore/resources/cloud/security_groups/security_groups.py index 5a9cc544..498e06b7 100644 --- a/src/gcore/resources/cloud/security_groups/security_groups.py +++ b/src/gcore/resources/cloud/security_groups/security_groups.py @@ -80,6 +80,10 @@ def create( Create a new security group with the specified configuration. Args: + project_id: Project ID + + region_id: Region ID + security_group: Security group instances: List of instances @@ -212,13 +216,17 @@ def list( List all security groups in the specified project and region. Args: - limit: Limit the number of returned security groups + project_id: Project ID + + region_id: Region ID + + limit: Limit of items on a single page - offset: Offset value is used to exclude the first set of records from the result + offset: Offset in results list - tag_key: Filter by tag keys. + tag_key: Optional. Filter by tag keys. - tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string. + tag_key_value: Optional. Filter by tag key-value pairs. Must be a valid JSON string. extra_headers: Send extra headers @@ -457,6 +465,10 @@ async def create( Create a new security group with the specified configuration. Args: + project_id: Project ID + + region_id: Region ID + security_group: Security group instances: List of instances @@ -589,13 +601,17 @@ def list( List all security groups in the specified project and region. Args: - limit: Limit the number of returned security groups + project_id: Project ID + + region_id: Region ID + + limit: Limit of items on a single page - offset: Offset value is used to exclude the first set of records from the result + offset: Offset in results list - tag_key: Filter by tag keys. + tag_key: Optional. Filter by tag keys. - tag_key_value: Filter by tag key-value pairs. Must be a valid JSON string. + tag_key_value: Optional. Filter by tag key-value pairs. Must be a valid JSON string. extra_headers: Send extra headers diff --git a/src/gcore/types/cloud/audit_log_entry.py b/src/gcore/types/cloud/audit_log_entry.py index 3dd7ea87..56dcac38 100644 --- a/src/gcore/types/cloud/audit_log_entry.py +++ b/src/gcore/types/cloud/audit_log_entry.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional from datetime import datetime from typing_extensions import Literal @@ -81,7 +81,7 @@ class Resource(BaseModel): ] """Resource type""" - resource_body: Optional[object] = None + resource_body: Optional[Dict[str, object]] = None """Free-form object, resource body.""" search_field: Optional[str] = None @@ -115,7 +115,7 @@ class AuditLogEntry(BaseModel): User action log was successfully received by its subscriber in case there is one """ - action_data: Optional[object] = None + action_data: Optional[Dict[str, object]] = None """Additional information about the action""" action_type: Literal[ diff --git a/src/gcore/types/cloud/baremetal/server_create_params.py b/src/gcore/types/cloud/baremetal/server_create_params.py index e477245e..79ba71d7 100644 --- a/src/gcore/types/cloud/baremetal/server_create_params.py +++ b/src/gcore/types/cloud/baremetal/server_create_params.py @@ -44,7 +44,7 @@ class ServerCreateParams(TypedDict, total=False): You can create one or more interfaces - private, public, or both. """ - app_config: Optional[object] + app_config: Optional[Dict[str, object]] """ Parameters for the application template if creating the instance from an `apptemplate`. diff --git a/src/gcore/types/cloud/baremetal_flavor.py b/src/gcore/types/cloud/baremetal_flavor.py index b5967afb..5bc0b974 100644 --- a/src/gcore/types/cloud/baremetal_flavor.py +++ b/src/gcore/types/cloud/baremetal_flavor.py @@ -50,9 +50,3 @@ class BaremetalFlavor(BaseModel): price_status: Optional[Literal["error", "hide", "show"]] = None """Price status for the UI""" - - reserved_in_stock: Optional[int] = None - """Count of reserved but not used nodes. - - If a client don't have reservations for the flavor, it's None. - """ diff --git a/src/gcore/types/cloud/billing_reservation_list_params.py b/src/gcore/types/cloud/billing_reservation_list_params.py index b0c40c5c..86c5fed6 100644 --- a/src/gcore/types/cloud/billing_reservation_list_params.py +++ b/src/gcore/types/cloud/billing_reservation_list_params.py @@ -9,7 +9,7 @@ class BillingReservationListParams(TypedDict, total=False): metric_name: str - """Name from billing features for specific resource""" + """Metric name for the resource (e.g., 'bm1-hf-`medium_min`')""" order_by: Literal["active_from.asc", "active_from.desc", "active_to.asc", "active_to.desc"] """Order by field and direction.""" diff --git a/src/gcore/types/cloud/instance_create_params.py b/src/gcore/types/cloud/instance_create_params.py index 0a279d23..93b160be 100644 --- a/src/gcore/types/cloud/instance_create_params.py +++ b/src/gcore/types/cloud/instance_create_params.py @@ -63,7 +63,7 @@ class InstanceCreateParams(TypedDict, total=False): marketplace application template. """ - configuration: Optional[object] + configuration: Optional[Dict[str, object]] """ Parameters for the application template if creating the instance from an `apptemplate`. diff --git a/src/gcore/types/cloud/load_balancer_flavor_detail.py b/src/gcore/types/cloud/load_balancer_flavor_detail.py index 33eb224b..6088eff6 100644 --- a/src/gcore/types/cloud/load_balancer_flavor_detail.py +++ b/src/gcore/types/cloud/load_balancer_flavor_detail.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union, Optional +from typing import Dict, Union, Optional from typing_extensions import Literal, TypeAlias from ..._models import BaseModel @@ -8,7 +8,7 @@ __all__ = ["LoadBalancerFlavorDetail", "HardwareDescription"] -HardwareDescription: TypeAlias = Union[FlavorHardwareDescription, object] +HardwareDescription: TypeAlias = Union[FlavorHardwareDescription, Dict[str, object]] class LoadBalancerFlavorDetail(BaseModel): diff --git a/src/gcore/types/cloud/load_balancer_listener_detail.py b/src/gcore/types/cloud/load_balancer_listener_detail.py index e230a736..c04b3d43 100644 --- a/src/gcore/types/cloud/load_balancer_listener_detail.py +++ b/src/gcore/types/cloud/load_balancer_listener_detail.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Dict, List, Optional from ..._models import BaseModel from .provisioning_status import ProvisioningStatus @@ -32,7 +32,7 @@ class LoadBalancerListenerDetail(BaseModel): creator_task_id: Optional[str] = None """Task that created this entity""" - insert_headers: object + insert_headers: Dict[str, object] """Dictionary of additional header insertion into HTTP headers. Only used with HTTP and `TERMINATED_HTTPS` protocols. diff --git a/src/gcore/types/cloud/region.py b/src/gcore/types/cloud/region.py index 977637ba..d44747af 100644 --- a/src/gcore/types/cloud/region.py +++ b/src/gcore/types/cloud/region.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import List, Union, Optional from datetime import datetime from typing_extensions import Literal @@ -10,9 +10,9 @@ class Coordinates(BaseModel): - latitude: float + latitude: Union[float, str] - longitude: float + longitude: Union[float, str] class Region(BaseModel): diff --git a/src/gcore/types/cloud/security_group_create_params.py b/src/gcore/types/cloud/security_group_create_params.py index 35527106..8847cbb1 100644 --- a/src/gcore/types/cloud/security_group_create_params.py +++ b/src/gcore/types/cloud/security_group_create_params.py @@ -12,8 +12,10 @@ class SecurityGroupCreateParams(TypedDict, total=False): project_id: int + """Project ID""" region_id: int + """Region ID""" security_group: Required[SecurityGroup] """Security group""" diff --git a/src/gcore/types/cloud/security_group_list_params.py b/src/gcore/types/cloud/security_group_list_params.py index 676a5d48..c6bfc34d 100644 --- a/src/gcore/types/cloud/security_group_list_params.py +++ b/src/gcore/types/cloud/security_group_list_params.py @@ -11,17 +11,19 @@ class SecurityGroupListParams(TypedDict, total=False): project_id: int + """Project ID""" region_id: int + """Region ID""" limit: int - """Limit the number of returned security groups""" + """Limit of items on a single page""" offset: int - """Offset value is used to exclude the first set of records from the result""" + """Offset in results list""" tag_key: SequenceNotStr[str] - """Filter by tag keys.""" + """Optional. Filter by tag keys.""" tag_key_value: str - """Filter by tag key-value pairs. Must be a valid JSON string.""" + """Optional. Filter by tag key-value pairs. Must be a valid JSON string.""" diff --git a/tests/api_resources/cloud/baremetal/test_servers.py b/tests/api_resources/cloud/baremetal/test_servers.py index 7482ef7b..564217ee 100644 --- a/tests/api_resources/cloud/baremetal/test_servers.py +++ b/tests/api_resources/cloud/baremetal/test_servers.py @@ -44,7 +44,7 @@ def test_method_create_with_all_params(self, client: Gcore) -> None: "port_group": 0, } ], - app_config={}, + app_config={"foo": "bar"}, apptemplate_id="apptemplate_id", ddos_profile={ "profile_template": 123, @@ -248,7 +248,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGcore) -> "port_group": 0, } ], - app_config={}, + app_config={"foo": "bar"}, apptemplate_id="apptemplate_id", ddos_profile={ "profile_template": 123, diff --git a/tests/api_resources/cloud/test_instances.py b/tests/api_resources/cloud/test_instances.py index 3ab8c850..7b908015 100644 --- a/tests/api_resources/cloud/test_instances.py +++ b/tests/api_resources/cloud/test_instances.py @@ -66,7 +66,7 @@ def test_method_create_with_all_params(self, client: Gcore) -> None: } ], allow_app_ports=True, - configuration={}, + configuration={"foo": "bar"}, name="my-instance", name_template="name_template", password="password", @@ -936,7 +936,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGcore) -> } ], allow_app_ports=True, - configuration={}, + configuration={"foo": "bar"}, name="my-instance", name_template="name_template", password="password", diff --git a/tests/api_resources/cloud/test_security_groups.py b/tests/api_resources/cloud/test_security_groups.py index d1ca3713..69777f00 100644 --- a/tests/api_resources/cloud/test_security_groups.py +++ b/tests/api_resources/cloud/test_security_groups.py @@ -23,8 +23,8 @@ class TestSecurityGroups: @parametrize def test_method_create(self, client: Gcore) -> None: security_group = client.cloud.security_groups.create( - project_id=0, - region_id=0, + project_id=1, + region_id=1, security_group={"name": "my_security_group"}, ) assert_matches_type(SecurityGroup, security_group, path=["response"]) @@ -32,8 +32,8 @@ def test_method_create(self, client: Gcore) -> None: @parametrize def test_method_create_with_all_params(self, client: Gcore) -> None: security_group = client.cloud.security_groups.create( - project_id=0, - region_id=0, + project_id=1, + region_id=1, security_group={ "name": "my_security_group", "description": "Some description", @@ -58,8 +58,8 @@ def test_method_create_with_all_params(self, client: Gcore) -> None: @parametrize def test_raw_response_create(self, client: Gcore) -> None: response = client.cloud.security_groups.with_raw_response.create( - project_id=0, - region_id=0, + project_id=1, + region_id=1, security_group={"name": "my_security_group"}, ) @@ -71,8 +71,8 @@ def test_raw_response_create(self, client: Gcore) -> None: @parametrize def test_streaming_response_create(self, client: Gcore) -> None: with client.cloud.security_groups.with_streaming_response.create( - project_id=0, - region_id=0, + project_id=1, + region_id=1, security_group={"name": "my_security_group"}, ) as response: assert not response.is_closed @@ -157,19 +157,19 @@ def test_path_params_update(self, client: Gcore) -> None: @parametrize def test_method_list(self, client: Gcore) -> None: security_group = client.cloud.security_groups.list( - project_id=0, - region_id=0, + project_id=1, + region_id=1, ) assert_matches_type(SyncOffsetPage[SecurityGroup], security_group, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Gcore) -> None: security_group = client.cloud.security_groups.list( - project_id=0, - region_id=0, - limit=0, + project_id=1, + region_id=1, + limit=10, offset=0, - tag_key=["string"], + tag_key=["my-tag"], tag_key_value="tag_key_value", ) assert_matches_type(SyncOffsetPage[SecurityGroup], security_group, path=["response"]) @@ -177,8 +177,8 @@ def test_method_list_with_all_params(self, client: Gcore) -> None: @parametrize def test_raw_response_list(self, client: Gcore) -> None: response = client.cloud.security_groups.with_raw_response.list( - project_id=0, - region_id=0, + project_id=1, + region_id=1, ) assert response.is_closed is True @@ -189,8 +189,8 @@ def test_raw_response_list(self, client: Gcore) -> None: @parametrize def test_streaming_response_list(self, client: Gcore) -> None: with client.cloud.security_groups.with_streaming_response.list( - project_id=0, - region_id=0, + project_id=1, + region_id=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -397,8 +397,8 @@ class TestAsyncSecurityGroups: @parametrize async def test_method_create(self, async_client: AsyncGcore) -> None: security_group = await async_client.cloud.security_groups.create( - project_id=0, - region_id=0, + project_id=1, + region_id=1, security_group={"name": "my_security_group"}, ) assert_matches_type(SecurityGroup, security_group, path=["response"]) @@ -406,8 +406,8 @@ async def test_method_create(self, async_client: AsyncGcore) -> None: @parametrize async def test_method_create_with_all_params(self, async_client: AsyncGcore) -> None: security_group = await async_client.cloud.security_groups.create( - project_id=0, - region_id=0, + project_id=1, + region_id=1, security_group={ "name": "my_security_group", "description": "Some description", @@ -432,8 +432,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncGcore) -> @parametrize async def test_raw_response_create(self, async_client: AsyncGcore) -> None: response = await async_client.cloud.security_groups.with_raw_response.create( - project_id=0, - region_id=0, + project_id=1, + region_id=1, security_group={"name": "my_security_group"}, ) @@ -445,8 +445,8 @@ async def test_raw_response_create(self, async_client: AsyncGcore) -> None: @parametrize async def test_streaming_response_create(self, async_client: AsyncGcore) -> None: async with async_client.cloud.security_groups.with_streaming_response.create( - project_id=0, - region_id=0, + project_id=1, + region_id=1, security_group={"name": "my_security_group"}, ) as response: assert not response.is_closed @@ -531,19 +531,19 @@ async def test_path_params_update(self, async_client: AsyncGcore) -> None: @parametrize async def test_method_list(self, async_client: AsyncGcore) -> None: security_group = await async_client.cloud.security_groups.list( - project_id=0, - region_id=0, + project_id=1, + region_id=1, ) assert_matches_type(AsyncOffsetPage[SecurityGroup], security_group, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncGcore) -> None: security_group = await async_client.cloud.security_groups.list( - project_id=0, - region_id=0, - limit=0, + project_id=1, + region_id=1, + limit=10, offset=0, - tag_key=["string"], + tag_key=["my-tag"], tag_key_value="tag_key_value", ) assert_matches_type(AsyncOffsetPage[SecurityGroup], security_group, path=["response"]) @@ -551,8 +551,8 @@ async def test_method_list_with_all_params(self, async_client: AsyncGcore) -> No @parametrize async def test_raw_response_list(self, async_client: AsyncGcore) -> None: response = await async_client.cloud.security_groups.with_raw_response.list( - project_id=0, - region_id=0, + project_id=1, + region_id=1, ) assert response.is_closed is True @@ -563,8 +563,8 @@ async def test_raw_response_list(self, async_client: AsyncGcore) -> None: @parametrize async def test_streaming_response_list(self, async_client: AsyncGcore) -> None: async with async_client.cloud.security_groups.with_streaming_response.list( - project_id=0, - region_id=0, + project_id=1, + region_id=1, ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python"