mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
prune the retired GPU billing addresses so a regen cannot re-mint them
`POST /v1/billing/gpu-charge` and `GET /v1/billing/gpu-eligibility` answer 404
at api.hanzo.ai — the address and its `-zzq9` nonsense sibling alike, which is
the only way absence is ever shown — and hanzoai/cloud has deleted the
handlers. The client still offered both, so the one outcome either method had
was a 404.
They survived in `pkg/hanzoai/api` + `pkg/hanzoai/models`, the tree the retired
driver wrote. `generate.py` does not own it: sdks.yaml declares exactly one take
path, `hanzoai/cloud -> pkg/hanzoai/cloud`. Nothing regenerates these files, so
nothing would ever have removed them and no future regen can put them back.
Six operations, three models, three exports. `pkg/hanzoai/cloud` is deliberately
untouched — it carries `/v1/billing/gpu/{charge,eligibility}`, which the
deployment still answers for (401, against a 404 control), and publishing an API
smaller than the one served is the same class of lie in the other direction.
generate.py python --check [python] clean
import hanzoai 2208 exports, 0 dangling
cloud-client / duplicate-fields pass, 2362 modules
Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -758,9 +758,6 @@ __all__ = [
|
||||
"BaseRecord",
|
||||
"BaseRecordList",
|
||||
"BillingBalance",
|
||||
"BillingBillingGpuCharge402Response",
|
||||
"BillingGpuChargeRequest",
|
||||
"BillingGpuEligibility",
|
||||
"BillingPaymentMethod",
|
||||
"BillingPaymentMethods",
|
||||
"BillingUsageLedger",
|
||||
@@ -2976,9 +2973,6 @@ from hanzoai.models.base_error import BaseError as BaseError
|
||||
from hanzoai.models.base_record import BaseRecord as BaseRecord
|
||||
from hanzoai.models.base_record_list import BaseRecordList as BaseRecordList
|
||||
from hanzoai.models.billing_balance import BillingBalance as BillingBalance
|
||||
from hanzoai.models.billing_billing_gpu_charge402_response import BillingBillingGpuCharge402Response as BillingBillingGpuCharge402Response
|
||||
from hanzoai.models.billing_gpu_charge_request import BillingGpuChargeRequest as BillingGpuChargeRequest
|
||||
from hanzoai.models.billing_gpu_eligibility import BillingGpuEligibility as BillingGpuEligibility
|
||||
from hanzoai.models.billing_payment_method import BillingPaymentMethod as BillingPaymentMethod
|
||||
from hanzoai.models.billing_payment_methods import BillingPaymentMethods as BillingPaymentMethods
|
||||
from hanzoai.models.billing_usage_ledger import BillingUsageLedger as BillingUsageLedger
|
||||
|
||||
@@ -21,8 +21,6 @@ from pydantic import Field, StrictInt, StrictStr
|
||||
from typing import Any, Dict, Optional
|
||||
from typing_extensions import Annotated
|
||||
from hanzoai.models.billing_balance import BillingBalance
|
||||
from hanzoai.models.billing_gpu_charge_request import BillingGpuChargeRequest
|
||||
from hanzoai.models.billing_gpu_eligibility import BillingGpuEligibility
|
||||
from hanzoai.models.billing_payment_methods import BillingPaymentMethods
|
||||
from hanzoai.models.billing_usage_ledger import BillingUsageLedger
|
||||
|
||||
@@ -310,586 +308,6 @@ class BillingBillingApi:
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def billing_billing_gpu_charge(
|
||||
self,
|
||||
billing_gpu_charge_request: BillingGpuChargeRequest,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> Dict[str, object]:
|
||||
"""Prepay-only GPU charge
|
||||
|
||||
The prepay-only, card-required GPU debit against the caller's own org wallet. Commerce enforces both gates server-side; the subject is pinned server-side, so only the charge params ride the body. Commerce's status is forwarded verbatim.
|
||||
|
||||
:param billing_gpu_charge_request: (required)
|
||||
:type billing_gpu_charge_request: BillingGpuChargeRequest
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._billing_billing_gpu_charge_serialize(
|
||||
billing_gpu_charge_request=billing_gpu_charge_request,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'201': "Dict[str, object]",
|
||||
'401': "InlineObject",
|
||||
'402': "BillingBillingGpuCharge402Response",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def billing_billing_gpu_charge_with_http_info(
|
||||
self,
|
||||
billing_gpu_charge_request: BillingGpuChargeRequest,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> ApiResponse[Dict[str, object]]:
|
||||
"""Prepay-only GPU charge
|
||||
|
||||
The prepay-only, card-required GPU debit against the caller's own org wallet. Commerce enforces both gates server-side; the subject is pinned server-side, so only the charge params ride the body. Commerce's status is forwarded verbatim.
|
||||
|
||||
:param billing_gpu_charge_request: (required)
|
||||
:type billing_gpu_charge_request: BillingGpuChargeRequest
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._billing_billing_gpu_charge_serialize(
|
||||
billing_gpu_charge_request=billing_gpu_charge_request,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'201': "Dict[str, object]",
|
||||
'401': "InlineObject",
|
||||
'402': "BillingBillingGpuCharge402Response",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def billing_billing_gpu_charge_without_preload_content(
|
||||
self,
|
||||
billing_gpu_charge_request: BillingGpuChargeRequest,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> RESTResponseType:
|
||||
"""Prepay-only GPU charge
|
||||
|
||||
The prepay-only, card-required GPU debit against the caller's own org wallet. Commerce enforces both gates server-side; the subject is pinned server-side, so only the charge params ride the body. Commerce's status is forwarded verbatim.
|
||||
|
||||
:param billing_gpu_charge_request: (required)
|
||||
:type billing_gpu_charge_request: BillingGpuChargeRequest
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._billing_billing_gpu_charge_serialize(
|
||||
billing_gpu_charge_request=billing_gpu_charge_request,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'201': "Dict[str, object]",
|
||||
'401': "InlineObject",
|
||||
'402': "BillingBillingGpuCharge402Response",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _billing_billing_gpu_charge_serialize(
|
||||
self,
|
||||
billing_gpu_charge_request,
|
||||
_request_auth,
|
||||
_content_type,
|
||||
_headers,
|
||||
_host_index,
|
||||
) -> RequestSerialized:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
# process the query parameters
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
# process the body parameter
|
||||
if billing_gpu_charge_request is not None:
|
||||
_body_params = billing_gpu_charge_request
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
# set the HTTP header `Content-Type`
|
||||
if _content_type:
|
||||
_header_params['Content-Type'] = _content_type
|
||||
else:
|
||||
_default_content_type = (
|
||||
self.api_client.select_header_content_type(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
)
|
||||
if _default_content_type is not None:
|
||||
_header_params['Content-Type'] = _default_content_type
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = [
|
||||
'bearerAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method='POST',
|
||||
resource_path='/v1/billing/gpu-charge',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
body=_body_params,
|
||||
post_params=_form_params,
|
||||
files=_files,
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def billing_billing_gpu_eligibility(
|
||||
self,
|
||||
amount_cents: Annotated[Optional[StrictInt], Field(description="Immediate charge to test against")] = None,
|
||||
min_prepaid_cents: Annotated[Optional[StrictInt], Field(description="24h-minimum prepaid floor")] = None,
|
||||
currency: Optional[StrictStr] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> BillingGpuEligibility:
|
||||
"""GPU launch eligibility gate
|
||||
|
||||
Read-only launch gate — reports prepaid availability and card-on-file so the launch UI can show the exact remedy.
|
||||
|
||||
:param amount_cents: Immediate charge to test against
|
||||
:type amount_cents: int
|
||||
:param min_prepaid_cents: 24h-minimum prepaid floor
|
||||
:type min_prepaid_cents: int
|
||||
:param currency:
|
||||
:type currency: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._billing_billing_gpu_eligibility_serialize(
|
||||
amount_cents=amount_cents,
|
||||
min_prepaid_cents=min_prepaid_cents,
|
||||
currency=currency,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "BillingGpuEligibility",
|
||||
'401': "InlineObject",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def billing_billing_gpu_eligibility_with_http_info(
|
||||
self,
|
||||
amount_cents: Annotated[Optional[StrictInt], Field(description="Immediate charge to test against")] = None,
|
||||
min_prepaid_cents: Annotated[Optional[StrictInt], Field(description="24h-minimum prepaid floor")] = None,
|
||||
currency: Optional[StrictStr] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> ApiResponse[BillingGpuEligibility]:
|
||||
"""GPU launch eligibility gate
|
||||
|
||||
Read-only launch gate — reports prepaid availability and card-on-file so the launch UI can show the exact remedy.
|
||||
|
||||
:param amount_cents: Immediate charge to test against
|
||||
:type amount_cents: int
|
||||
:param min_prepaid_cents: 24h-minimum prepaid floor
|
||||
:type min_prepaid_cents: int
|
||||
:param currency:
|
||||
:type currency: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._billing_billing_gpu_eligibility_serialize(
|
||||
amount_cents=amount_cents,
|
||||
min_prepaid_cents=min_prepaid_cents,
|
||||
currency=currency,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "BillingGpuEligibility",
|
||||
'401': "InlineObject",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def billing_billing_gpu_eligibility_without_preload_content(
|
||||
self,
|
||||
amount_cents: Annotated[Optional[StrictInt], Field(description="Immediate charge to test against")] = None,
|
||||
min_prepaid_cents: Annotated[Optional[StrictInt], Field(description="24h-minimum prepaid floor")] = None,
|
||||
currency: Optional[StrictStr] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> RESTResponseType:
|
||||
"""GPU launch eligibility gate
|
||||
|
||||
Read-only launch gate — reports prepaid availability and card-on-file so the launch UI can show the exact remedy.
|
||||
|
||||
:param amount_cents: Immediate charge to test against
|
||||
:type amount_cents: int
|
||||
:param min_prepaid_cents: 24h-minimum prepaid floor
|
||||
:type min_prepaid_cents: int
|
||||
:param currency:
|
||||
:type currency: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._billing_billing_gpu_eligibility_serialize(
|
||||
amount_cents=amount_cents,
|
||||
min_prepaid_cents=min_prepaid_cents,
|
||||
currency=currency,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "BillingGpuEligibility",
|
||||
'401': "InlineObject",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _billing_billing_gpu_eligibility_serialize(
|
||||
self,
|
||||
amount_cents,
|
||||
min_prepaid_cents,
|
||||
currency,
|
||||
_request_auth,
|
||||
_content_type,
|
||||
_headers,
|
||||
_host_index,
|
||||
) -> RequestSerialized:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
# process the query parameters
|
||||
if amount_cents is not None:
|
||||
|
||||
_query_params.append(('amountCents', amount_cents))
|
||||
|
||||
if min_prepaid_cents is not None:
|
||||
|
||||
_query_params.append(('minPrepaidCents', min_prepaid_cents))
|
||||
|
||||
if currency is not None:
|
||||
|
||||
_query_params.append(('currency', currency))
|
||||
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
# process the body parameter
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json'
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = [
|
||||
'bearerAuth'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method='GET',
|
||||
resource_path='/v1/billing/gpu-eligibility',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
body=_body_params,
|
||||
post_params=_form_params,
|
||||
files=_files,
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def billing_billing_payment_methods(
|
||||
self,
|
||||
|
||||
@@ -227,9 +227,6 @@ from hanzoai.models.base_error import BaseError
|
||||
from hanzoai.models.base_record import BaseRecord
|
||||
from hanzoai.models.base_record_list import BaseRecordList
|
||||
from hanzoai.models.billing_balance import BillingBalance
|
||||
from hanzoai.models.billing_billing_gpu_charge402_response import BillingBillingGpuCharge402Response
|
||||
from hanzoai.models.billing_gpu_charge_request import BillingGpuChargeRequest
|
||||
from hanzoai.models.billing_gpu_eligibility import BillingGpuEligibility
|
||||
from hanzoai.models.billing_payment_method import BillingPaymentMethod
|
||||
from hanzoai.models.billing_payment_methods import BillingPaymentMethods
|
||||
from hanzoai.models.billing_usage_ledger import BillingUsageLedger
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Hanzo Cloud — Unified API
|
||||
|
||||
The single unified OpenAPI surface for ALL Hanzo services, aggregated from the per-service specs. Every route is https://api.hanzo.ai/v1/<service>/*. Regenerated by merge.py — edit the per-service <svc>/openapi.yaml, not this file.
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Contact: [email protected]
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class BillingBillingGpuCharge402Response(BaseModel):
|
||||
"""
|
||||
BillingBillingGpuCharge402Response
|
||||
""" # noqa: E501
|
||||
reason: Optional[StrictStr] = None
|
||||
additional_properties: Dict[str, Any] = {}
|
||||
__properties: ClassVar[List[str]] = ["reason"]
|
||||
|
||||
@field_validator('reason')
|
||||
def reason_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['card_required', 'insufficient_prepaid']):
|
||||
raise ValueError("must be one of enum values ('card_required', 'insufficient_prepaid')")
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of BillingBillingGpuCharge402Response from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
* Fields in `self.additional_properties` are added to the output dict.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
"additional_properties",
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# puts key-value pairs in additional_properties in the top level
|
||||
if self.additional_properties is not None:
|
||||
for _key, _value in self.additional_properties.items():
|
||||
_dict[_key] = _value
|
||||
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of BillingBillingGpuCharge402Response from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"reason": obj.get("reason")
|
||||
})
|
||||
# store additional fields in additional_properties
|
||||
for _key in obj.keys():
|
||||
if _key not in cls.__properties:
|
||||
_obj.additional_properties[_key] = obj.get(_key)
|
||||
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Hanzo Cloud — Unified API
|
||||
|
||||
The single unified OpenAPI surface for ALL Hanzo services, aggregated from the per-service specs. Every route is https://api.hanzo.ai/v1/<service>/*. Regenerated by merge.py — edit the per-service <svc>/openapi.yaml, not this file.
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Contact: [email protected]
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class BillingGpuChargeRequest(BaseModel):
|
||||
"""
|
||||
BillingGpuChargeRequest
|
||||
""" # noqa: E501
|
||||
amount_cents: Optional[StrictInt] = Field(default=None, alias="amountCents")
|
||||
currency: Optional[StrictStr] = None
|
||||
request_id: Optional[StrictStr] = Field(default=None, alias="requestId")
|
||||
tag: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["amountCents", "currency", "requestId", "tag"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of BillingGpuChargeRequest from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of BillingGpuChargeRequest from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"amountCents": obj.get("amountCents"),
|
||||
"currency": obj.get("currency"),
|
||||
"requestId": obj.get("requestId"),
|
||||
"tag": obj.get("tag")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -1,109 +0,0 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Hanzo Cloud — Unified API
|
||||
|
||||
The single unified OpenAPI surface for ALL Hanzo services, aggregated from the per-service specs. Every route is https://api.hanzo.ai/v1/<service>/*. Regenerated by merge.py — edit the per-service <svc>/openapi.yaml, not this file.
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Contact: [email protected]
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class BillingGpuEligibility(BaseModel):
|
||||
"""
|
||||
BillingGpuEligibility
|
||||
""" # noqa: E501
|
||||
eligible: Optional[StrictBool] = None
|
||||
reason: Optional[StrictStr] = None
|
||||
prepaid_available: Optional[StrictInt] = Field(default=None, alias="prepaidAvailable")
|
||||
card_on_file: Optional[StrictBool] = Field(default=None, alias="cardOnFile")
|
||||
required_cents: Optional[StrictInt] = Field(default=None, alias="requiredCents")
|
||||
additional_properties: Dict[str, Any] = {}
|
||||
__properties: ClassVar[List[str]] = ["eligible", "reason", "prepaidAvailable", "cardOnFile", "requiredCents"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of BillingGpuEligibility from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
* Fields in `self.additional_properties` are added to the output dict.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
"additional_properties",
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# puts key-value pairs in additional_properties in the top level
|
||||
if self.additional_properties is not None:
|
||||
for _key, _value in self.additional_properties.items():
|
||||
_dict[_key] = _value
|
||||
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of BillingGpuEligibility from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"eligible": obj.get("eligible"),
|
||||
"reason": obj.get("reason"),
|
||||
"prepaidAvailable": obj.get("prepaidAvailable"),
|
||||
"cardOnFile": obj.get("cardOnFile"),
|
||||
"requiredCents": obj.get("requiredCents")
|
||||
})
|
||||
# store additional fields in additional_properties
|
||||
for _key in obj.keys():
|
||||
if _key not in cls.__properties:
|
||||
_obj.additional_properties[_key] = obj.get(_key)
|
||||
|
||||
return _obj
|
||||
|
||||
|
||||
Reference in New Issue
Block a user