mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-08-18 12:10:34 +08:00
fixes
This commit is contained in:
+25
-25
@@ -1,7 +1,7 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from .basesdk import BaseSDK
|
||||
from openrouter import errors, models, utils
|
||||
from openrouter import components, errors, operations, utils
|
||||
from openrouter._hooks import HookContext
|
||||
from openrouter.types import OptionalNullable, UNSET
|
||||
from openrouter.utils import get_security_from_env
|
||||
@@ -19,7 +19,7 @@ class Credits(BaseSDK):
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> models.GetCreditsResponse:
|
||||
) -> operations.GetCreditsResponse:
|
||||
r"""Get remaining credits
|
||||
|
||||
Get total credits purchased and used for the authenticated user
|
||||
@@ -69,7 +69,7 @@ class Credits(BaseSDK):
|
||||
operation_id="getCredits",
|
||||
oauth2_scopes=None,
|
||||
security_source=get_security_from_env(
|
||||
self.sdk_configuration.security, models.Security
|
||||
self.sdk_configuration.security, components.Security
|
||||
),
|
||||
),
|
||||
request=req,
|
||||
@@ -79,7 +79,7 @@ class Credits(BaseSDK):
|
||||
|
||||
response_data: Any = None
|
||||
if utils.match_response(http_res, "200", "application/json"):
|
||||
return unmarshal_json_response(models.GetCreditsResponse, http_res)
|
||||
return unmarshal_json_response(operations.GetCreditsResponse, http_res)
|
||||
if utils.match_response(http_res, "401", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
errors.UnauthorizedResponseErrorData, http_res
|
||||
@@ -115,7 +115,7 @@ class Credits(BaseSDK):
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> models.GetCreditsResponse:
|
||||
) -> operations.GetCreditsResponse:
|
||||
r"""Get remaining credits
|
||||
|
||||
Get total credits purchased and used for the authenticated user
|
||||
@@ -165,7 +165,7 @@ class Credits(BaseSDK):
|
||||
operation_id="getCredits",
|
||||
oauth2_scopes=None,
|
||||
security_source=get_security_from_env(
|
||||
self.sdk_configuration.security, models.Security
|
||||
self.sdk_configuration.security, components.Security
|
||||
),
|
||||
),
|
||||
request=req,
|
||||
@@ -175,7 +175,7 @@ class Credits(BaseSDK):
|
||||
|
||||
response_data: Any = None
|
||||
if utils.match_response(http_res, "200", "application/json"):
|
||||
return unmarshal_json_response(models.GetCreditsResponse, http_res)
|
||||
return unmarshal_json_response(operations.GetCreditsResponse, http_res)
|
||||
if utils.match_response(http_res, "401", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
errors.UnauthorizedResponseErrorData, http_res
|
||||
@@ -208,17 +208,17 @@ class Credits(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
security: Union[
|
||||
models.CreateCoinbaseChargeSecurity,
|
||||
models.CreateCoinbaseChargeSecurityTypedDict,
|
||||
operations.CreateCoinbaseChargeSecurity,
|
||||
operations.CreateCoinbaseChargeSecurityTypedDict,
|
||||
],
|
||||
amount: float,
|
||||
sender: str,
|
||||
chain_id: models.ChainID,
|
||||
chain_id: components.ChainID,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> models.CreateCoinbaseChargeData:
|
||||
) -> operations.CreateCoinbaseChargeData:
|
||||
r"""Create a Coinbase charge for crypto payment
|
||||
|
||||
Create a Coinbase charge for crypto payment
|
||||
@@ -242,7 +242,7 @@ class Credits(BaseSDK):
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = models.CreateChargeRequest(
|
||||
request = components.CreateChargeRequest(
|
||||
amount=amount,
|
||||
sender=sender,
|
||||
chain_id=chain_id,
|
||||
@@ -261,10 +261,10 @@ class Credits(BaseSDK):
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
security=utils.get_pydantic_model(
|
||||
security, models.CreateCoinbaseChargeSecurity
|
||||
security, operations.CreateCoinbaseChargeSecurity
|
||||
),
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", models.CreateChargeRequest
|
||||
request, False, False, "json", components.CreateChargeRequest
|
||||
),
|
||||
timeout_ms=timeout_ms,
|
||||
)
|
||||
@@ -283,7 +283,7 @@ class Credits(BaseSDK):
|
||||
base_url=base_url or "",
|
||||
operation_id="createCoinbaseCharge",
|
||||
oauth2_scopes=None,
|
||||
security_source=get_security_from_env(security, models.Security),
|
||||
security_source=get_security_from_env(security, components.Security),
|
||||
),
|
||||
request=req,
|
||||
error_status_codes=["400", "401", "429", "4XX", "500", "5XX"],
|
||||
@@ -293,7 +293,7 @@ class Credits(BaseSDK):
|
||||
response_data: Any = None
|
||||
if utils.match_response(http_res, "200", "application/json"):
|
||||
return unmarshal_json_response(
|
||||
models.CreateCoinbaseChargeResponse, http_res
|
||||
operations.CreateCoinbaseChargeResponse, http_res
|
||||
)
|
||||
if utils.match_response(http_res, "400", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
@@ -332,17 +332,17 @@ class Credits(BaseSDK):
|
||||
self,
|
||||
*,
|
||||
security: Union[
|
||||
models.CreateCoinbaseChargeSecurity,
|
||||
models.CreateCoinbaseChargeSecurityTypedDict,
|
||||
operations.CreateCoinbaseChargeSecurity,
|
||||
operations.CreateCoinbaseChargeSecurityTypedDict,
|
||||
],
|
||||
amount: float,
|
||||
sender: str,
|
||||
chain_id: models.ChainID,
|
||||
chain_id: components.ChainID,
|
||||
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
||||
server_url: Optional[str] = None,
|
||||
timeout_ms: Optional[int] = None,
|
||||
http_headers: Optional[Mapping[str, str]] = None,
|
||||
) -> models.CreateCoinbaseChargeData:
|
||||
) -> operations.CreateCoinbaseChargeData:
|
||||
r"""Create a Coinbase charge for crypto payment
|
||||
|
||||
Create a Coinbase charge for crypto payment
|
||||
@@ -366,7 +366,7 @@ class Credits(BaseSDK):
|
||||
else:
|
||||
base_url = self._get_url(base_url, url_variables)
|
||||
|
||||
request = models.CreateChargeRequest(
|
||||
request = components.CreateChargeRequest(
|
||||
amount=amount,
|
||||
sender=sender,
|
||||
chain_id=chain_id,
|
||||
@@ -385,10 +385,10 @@ class Credits(BaseSDK):
|
||||
accept_header_value="application/json",
|
||||
http_headers=http_headers,
|
||||
security=utils.get_pydantic_model(
|
||||
security, models.CreateCoinbaseChargeSecurity
|
||||
security, operations.CreateCoinbaseChargeSecurity
|
||||
),
|
||||
get_serialized_body=lambda: utils.serialize_request_body(
|
||||
request, False, False, "json", models.CreateChargeRequest
|
||||
request, False, False, "json", components.CreateChargeRequest
|
||||
),
|
||||
timeout_ms=timeout_ms,
|
||||
)
|
||||
@@ -407,7 +407,7 @@ class Credits(BaseSDK):
|
||||
base_url=base_url or "",
|
||||
operation_id="createCoinbaseCharge",
|
||||
oauth2_scopes=None,
|
||||
security_source=get_security_from_env(security, models.Security),
|
||||
security_source=get_security_from_env(security, components.Security),
|
||||
),
|
||||
request=req,
|
||||
error_status_codes=["400", "401", "429", "4XX", "500", "5XX"],
|
||||
@@ -417,7 +417,7 @@ class Credits(BaseSDK):
|
||||
response_data: Any = None
|
||||
if utils.match_response(http_res, "200", "application/json"):
|
||||
return unmarshal_json_response(
|
||||
models.CreateCoinbaseChargeResponse, http_res
|
||||
operations.CreateCoinbaseChargeResponse, http_res
|
||||
)
|
||||
if utils.match_response(http_res, "400", "application/json"):
|
||||
response_data = unmarshal_json_response(
|
||||
|
||||
Reference in New Issue
Block a user