Skip to content

Commit f99858a

Browse files
fix(cloud): fix type in create_and_poll signature of load balancer listeners (#146)
* fix(examples): suppress pyright deprecated warnings for v1 update methods The load_balancers.update() and routers.update() methods are deprecated in favor of v2 endpoints, but v2 replacement methods are not yet available in the SDK. Suppress pyright reportDeprecated warnings until v2 methods are added. * fix(listeners): align create_and_poll secret_id type with create method The custom create_and_poll() method used `str | Omit` for secret_id but the generated create() method expects `Literal[""] | Omit`. This caused pyright reportArgumentType errors at lines 460 and 1014.
1 parent b373e1a commit f99858a

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

examples/cloud/load_balancers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def get_load_balancer(*, client: Gcore, load_balancer_id: str) -> None:
5959

6060
def update_load_balancer(*, client: Gcore, load_balancer_id: str) -> None:
6161
print("\n=== UPDATE LOAD BALANCER ===")
62-
lb = client.cloud.load_balancers.update(load_balancer_id=load_balancer_id, name="gcore-go-example-updated")
62+
lb = client.cloud.load_balancers.update(load_balancer_id=load_balancer_id, name="gcore-go-example-updated") # pyright: ignore[reportDeprecated]
6363
print(f"Updated load balancer: ID={lb.id}, name={lb.name}")
6464
print("========================")
6565

examples/cloud/load_balancers_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ async def get_load_balancer(*, client: AsyncGcore, load_balancer_id: str) -> Non
6565

6666
async def update_load_balancer(*, client: AsyncGcore, load_balancer_id: str) -> None:
6767
print("\n=== UPDATE LOAD BALANCER ===")
68-
lb = await client.cloud.load_balancers.update(load_balancer_id=load_balancer_id, name="gcore-go-example-updated")
68+
lb = await client.cloud.load_balancers.update(load_balancer_id=load_balancer_id, name="gcore-go-example-updated") # pyright: ignore[reportDeprecated]
6969
print(f"Updated load balancer: ID={lb.id}, name={lb.name}")
7070
print("========================")
7171

examples/cloud/networks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def get_router(*, client: Gcore, router_id: str) -> None:
136136

137137
def update_router(*, client: Gcore, router_id: str) -> None:
138138
print("\n=== UPDATE ROUTER ===")
139-
router = client.cloud.networks.routers.update(router_id=router_id, name="gcore-go-example-updated")
139+
router = client.cloud.networks.routers.update(router_id=router_id, name="gcore-go-example-updated") # pyright: ignore[reportDeprecated]
140140
print(f"Updated router: ID={router.id}, name={router.name}")
141141
print("========================")
142142

examples/cloud/networks_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ async def get_router(*, client: AsyncGcore, router_id: str) -> None:
144144

145145
async def update_router(*, client: AsyncGcore, router_id: str) -> None:
146146
print("\n=== UPDATE ROUTER ===")
147-
router = await client.cloud.networks.routers.update(router_id=router_id, name="gcore-go-example-updated")
147+
router = await client.cloud.networks.routers.update(router_id=router_id, name="gcore-go-example-updated") # pyright: ignore[reportDeprecated]
148148
print(f"Updated router: ID={router.id}, name={router.name}")
149149
print("========================")
150150

src/gcore/resources/cloud/load_balancers/listeners.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def create_and_poll(
432432
allowed_cidrs: Optional[SequenceNotStr[str]] | Omit = omit,
433433
connection_limit: int | Omit = omit,
434434
insert_x_forwarded: bool | Omit = omit,
435-
secret_id: str | Omit = omit,
435+
secret_id: Literal[""] | Omit = omit,
436436
sni_secret_id: SequenceNotStr[str] | Omit = omit,
437437
timeout_client_data: Optional[int] | Omit = omit,
438438
timeout_member_connect: Optional[int] | Omit = omit,
@@ -986,7 +986,7 @@ async def create_and_poll(
986986
allowed_cidrs: Optional[SequenceNotStr[str]] | Omit = omit,
987987
connection_limit: int | Omit = omit,
988988
insert_x_forwarded: bool | Omit = omit,
989-
secret_id: str | Omit = omit,
989+
secret_id: Literal[""] | Omit = omit,
990990
sni_secret_id: SequenceNotStr[str] | Omit = omit,
991991
timeout_client_data: Optional[int] | Omit = omit,
992992
timeout_member_connect: Optional[int] | Omit = omit,

0 commit comments

Comments
 (0)