✨ Feat/async typed sdk#225
Conversation
| super().__init__( | ||
| os.path.join(os.path.dirname(__file__), "resources/outscale.yaml"), **kwargs | ||
|
|
||
| class AsyncOpenAPIActionAPI(OpenAPIActionAPI): |
| self.close() | ||
|
|
||
|
|
||
| class AsyncOpenAPIPathAPI(OpenAPIPathAPI): |
| request: GetKubernetesVersionsRequest | None = None, | ||
| ) -> KubernetesVersionsResponse: | ||
| if request is None: | ||
| request = GetKubernetesVersionsRequest() |
| request: GetCPSubregionsRequest | None = None, | ||
| ) -> CPSubregionsResponse: | ||
| if request is None: | ||
| request = GetCPSubregionsRequest() |
| request: GetControlPlanePlansRequest | None = None, | ||
| ) -> ControlPlanesResponse: | ||
| if request is None: | ||
| request = GetControlPlanePlansRequest() |
| request: GetNetPeeringRequestTemplateRequest | None = None, | ||
| ) -> TemplateResponse_NetPeeringRequest: | ||
| if request is None: | ||
| request = GetNetPeeringRequestTemplateRequest() |
| request: GetNetPeeringAcceptanceTemplateRequest | None = None, | ||
| ) -> TemplateResponse_NetPeeringAcceptance: | ||
| if request is None: | ||
| request = GetNetPeeringAcceptanceTemplateRequest() |
| request: GetQuotasRequest | None = None, | ||
| ) -> quotas__quota_schema__QuotasResponse: | ||
| if request is None: | ||
| request = GetQuotasRequest() |
| request: GetClientIPRequest | None = None, | ||
| ) -> IPResponse: | ||
| if request is None: | ||
| request = GetClientIPRequest() |
| import asyncio | ||
| import copy | ||
| import os | ||
| import sys |
jobs62
left a comment
There was a problem hiding this comment.
Good start. Despite all comments i made, it whould be nice that public facing methods raise only "owned" exception. also string enum support whould be nice in the generator (that may need support for overlays as well)
| api_version: | ||
| description: 'Outscale API version' | ||
| required: true | ||
| oks_api_url: |
There was a problem hiding this comment.
Both services can have different release plan, so we should be able to build and release one without the other
There was a problem hiding this comment.
Updated the release workflow to support per-service builds. It can now build osc, oks, or all, and the release script only updates/regenerates the selected service.
|
|
||
|
|
||
| async def main(): | ||
| async with AsyncClient(profile="profile_1") as client: |
There was a problem hiding this comment.
we should have one client per service
| from datetime import datetime, timezone, timedelta | ||
| import asyncio | ||
| import time | ||
|
|
There was a problem hiding this comment.
same as authentication, limiter should be a httpx middleware
| @@ -0,0 +1,131 @@ | |||
| import asyncio | |||
| import json | |||
There was a problem hiding this comment.
should be a httpx middleware as well
| from ..request import RequestSpec | ||
|
|
||
|
|
||
| class AsyncCall(object): |
There was a problem hiding this comment.
you can probably get ride of Call/Requester. i never understood why we had that much boilerplate for parameters of transports (should be in the session or a middleware ?)
Updated README and docs examples to use Client / AsyncClient and async snake_case operation methods. Added unresolved path placeholder validation in RequestSpec with unit tests. Removed unnecessary IAM v2 secret injection from the CI workflow while keeping SDK credential support unchanged.
Description
Implements the foundation for an async-first, OpenAPI-driven Python SDK with generated typed service clients. The architecture now supports multi-service expansion such as OSC/OAPI, OKS and future services through a modular core plus generated service layers.
Main goals:
Fixes: NA
Type of Change
Please check the relevant option(s):
How Has This Been Tested?
Please describe the test strategy:
Commands used (if applicable):
Checklist