mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
client: regenerate from hanzo-inc/cloud@45a5d493c1 (8.5.604)
Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
+3
-1
@@ -262,6 +262,7 @@ pkg/hanzoai/cloud/models/ai_judge_benchmark.py
|
||||
pkg/hanzoai/cloud/models/ai_judge_panel_state.py
|
||||
pkg/hanzoai/cloud/models/ai_limited.py
|
||||
pkg/hanzoai/cloud/models/ai_limits.py
|
||||
pkg/hanzoai/cloud/models/ai_limits_set.py
|
||||
pkg/hanzoai/cloud/models/ai_mcp_app.py
|
||||
pkg/hanzoai/cloud/models/ai_mcp_surface.py
|
||||
pkg/hanzoai/cloud/models/ai_model_access_info.py
|
||||
@@ -270,6 +271,7 @@ pkg/hanzoai/cloud/models/ai_model_list.py
|
||||
pkg/hanzoai/cloud/models/ai_model_pricing_info.py
|
||||
pkg/hanzoai/cloud/models/ai_model_providers.py
|
||||
pkg/hanzoai/cloud/models/ai_panel_judge.py
|
||||
pkg/hanzoai/cloud/models/ai_paused.py
|
||||
pkg/hanzoai/cloud/models/ai_provider_usage.py
|
||||
pkg/hanzoai/cloud/models/ai_provider_usage_model_spend.py
|
||||
pkg/hanzoai/cloud/models/ai_provider_usage_series_point.py
|
||||
@@ -428,7 +430,6 @@ pkg/hanzoai/cloud/models/billing_transaction.py
|
||||
pkg/hanzoai/cloud/models/billing_transactions.py
|
||||
pkg/hanzoai/cloud/models/billing_usage_receipt.py
|
||||
pkg/hanzoai/cloud/models/billing_usage_report.py
|
||||
pkg/hanzoai/cloud/models/billing_window.py
|
||||
pkg/hanzoai/cloud/models/billing_wire_instructions.py
|
||||
pkg/hanzoai/cloud/models/block.py
|
||||
pkg/hanzoai/cloud/models/blueprint_blueprint_health.py
|
||||
@@ -2805,6 +2806,7 @@ pkg/hanzoai/cloud/models/store.py
|
||||
pkg/hanzoai/cloud/models/sweep.py
|
||||
pkg/hanzoai/cloud/models/sync_endpoint_req.py
|
||||
pkg/hanzoai/cloud/models/sync_endpoint_view.py
|
||||
pkg/hanzoai/cloud/models/sync_native_view.py
|
||||
pkg/hanzoai/cloud/models/sync_patch_sync_in.py
|
||||
pkg/hanzoai/cloud/models/sync_sync_list.py
|
||||
pkg/hanzoai/cloud/models/sync_sync_queued.py
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
ref=1e6d2a97dee2274f8d54bb1ae9e81de1d99e69c6
|
||||
sha256=7c5439ced62a04771ba99780dbd249893df8f1e08dd8617fa5670e22227e7804
|
||||
ref=45a5d493c101c0bee311002eb5a39913b92dba91
|
||||
sha256=b3384ac85c338b4db62e3ccc70b11295aabab46253e8bc1ccb8f0869a99f520b
|
||||
repo=hanzo-inc/cloud
|
||||
path=openapi.yaml
|
||||
|
||||
@@ -284,6 +284,7 @@ __all__ = [
|
||||
"AiJudgePanelState",
|
||||
"AiLimited",
|
||||
"AiLimits",
|
||||
"AiLimitsSet",
|
||||
"AiMCPApp",
|
||||
"AiMCPSurface",
|
||||
"AiModelAccessInfo",
|
||||
@@ -292,6 +293,7 @@ __all__ = [
|
||||
"AiModelPricingInfo",
|
||||
"AiModelProviders",
|
||||
"AiPanelJudge",
|
||||
"AiPaused",
|
||||
"AiProviderUsage",
|
||||
"AiProviderUsageModelSpend",
|
||||
"AiProviderUsageSeriesPoint",
|
||||
@@ -450,7 +452,6 @@ __all__ = [
|
||||
"BillingTransactions",
|
||||
"BillingUsageReceipt",
|
||||
"BillingUsageReport",
|
||||
"BillingWindow",
|
||||
"BillingWireInstructions",
|
||||
"Block",
|
||||
"BlueprintBlueprintHealth",
|
||||
@@ -2827,6 +2828,7 @@ __all__ = [
|
||||
"Sweep",
|
||||
"SyncEndpointReq",
|
||||
"SyncEndpointView",
|
||||
"SyncNativeView",
|
||||
"SyncPatchSyncIn",
|
||||
"SyncSyncList",
|
||||
"SyncSyncQueued",
|
||||
@@ -3348,6 +3350,7 @@ from hanzoai.cloud.models.ai_judge_benchmark import AiJudgeBenchmark as AiJudgeB
|
||||
from hanzoai.cloud.models.ai_judge_panel_state import AiJudgePanelState as AiJudgePanelState
|
||||
from hanzoai.cloud.models.ai_limited import AiLimited as AiLimited
|
||||
from hanzoai.cloud.models.ai_limits import AiLimits as AiLimits
|
||||
from hanzoai.cloud.models.ai_limits_set import AiLimitsSet as AiLimitsSet
|
||||
from hanzoai.cloud.models.ai_mcp_app import AiMCPApp as AiMCPApp
|
||||
from hanzoai.cloud.models.ai_mcp_surface import AiMCPSurface as AiMCPSurface
|
||||
from hanzoai.cloud.models.ai_model_access_info import AiModelAccessInfo as AiModelAccessInfo
|
||||
@@ -3356,6 +3359,7 @@ from hanzoai.cloud.models.ai_model_list import AiModelList as AiModelList
|
||||
from hanzoai.cloud.models.ai_model_pricing_info import AiModelPricingInfo as AiModelPricingInfo
|
||||
from hanzoai.cloud.models.ai_model_providers import AiModelProviders as AiModelProviders
|
||||
from hanzoai.cloud.models.ai_panel_judge import AiPanelJudge as AiPanelJudge
|
||||
from hanzoai.cloud.models.ai_paused import AiPaused as AiPaused
|
||||
from hanzoai.cloud.models.ai_provider_usage import AiProviderUsage as AiProviderUsage
|
||||
from hanzoai.cloud.models.ai_provider_usage_model_spend import AiProviderUsageModelSpend as AiProviderUsageModelSpend
|
||||
from hanzoai.cloud.models.ai_provider_usage_series_point import AiProviderUsageSeriesPoint as AiProviderUsageSeriesPoint
|
||||
@@ -3514,7 +3518,6 @@ from hanzoai.cloud.models.billing_transaction import BillingTransaction as Billi
|
||||
from hanzoai.cloud.models.billing_transactions import BillingTransactions as BillingTransactions
|
||||
from hanzoai.cloud.models.billing_usage_receipt import BillingUsageReceipt as BillingUsageReceipt
|
||||
from hanzoai.cloud.models.billing_usage_report import BillingUsageReport as BillingUsageReport
|
||||
from hanzoai.cloud.models.billing_window import BillingWindow as BillingWindow
|
||||
from hanzoai.cloud.models.billing_wire_instructions import BillingWireInstructions as BillingWireInstructions
|
||||
from hanzoai.cloud.models.block import Block as Block
|
||||
from hanzoai.cloud.models.blueprint_blueprint_health import BlueprintBlueprintHealth as BlueprintBlueprintHealth
|
||||
@@ -5891,6 +5894,7 @@ from hanzoai.cloud.models.store import Store as Store
|
||||
from hanzoai.cloud.models.sweep import Sweep as Sweep
|
||||
from hanzoai.cloud.models.sync_endpoint_req import SyncEndpointReq as SyncEndpointReq
|
||||
from hanzoai.cloud.models.sync_endpoint_view import SyncEndpointView as SyncEndpointView
|
||||
from hanzoai.cloud.models.sync_native_view import SyncNativeView as SyncNativeView
|
||||
from hanzoai.cloud.models.sync_patch_sync_in import SyncPatchSyncIn as SyncPatchSyncIn
|
||||
from hanzoai.cloud.models.sync_sync_list import SyncSyncList as SyncSyncList
|
||||
from hanzoai.cloud.models.sync_sync_queued import SyncSyncQueued as SyncSyncQueued
|
||||
|
||||
@@ -24,6 +24,7 @@ from hanzoai.cloud.models.ai_anthropic_response import AiAnthropicResponse
|
||||
from hanzoai.cloud.models.ai_decisions_request import AiDecisionsRequest
|
||||
from hanzoai.cloud.models.ai_decisions_response import AiDecisionsResponse
|
||||
from hanzoai.cloud.models.ai_limits import AiLimits
|
||||
from hanzoai.cloud.models.ai_limits_set import AiLimitsSet
|
||||
from hanzoai.cloud.models.ai_mcp_surface import AiMCPSurface
|
||||
from hanzoai.cloud.models.ai_model_list import AiModelList
|
||||
from hanzoai.cloud.models.ai_ranking import AiRanking
|
||||
@@ -644,6 +645,281 @@ class AiApi:
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def ai_set_limits(
|
||||
self,
|
||||
ai_limits_set: AiLimitsSet,
|
||||
_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,
|
||||
) -> AiLimits:
|
||||
"""Sets the payer's choice to keep using a model on credits once the plan's included usage of it is spent.
|
||||
|
||||
Sets the payer's choice to keep using a model on credits once the plan's included usage of it is spent. A pooled org wallet is its org admin's to set; a person's own wallet is theirs. Every change is on the audit trail, before and after; no trail, no change. Answers the limits as they read after it.
|
||||
|
||||
:param ai_limits_set: (required)
|
||||
:type ai_limits_set: AiLimitsSet
|
||||
: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._ai_set_limits_serialize(
|
||||
ai_limits_set=ai_limits_set,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "AiLimits",
|
||||
}
|
||||
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 ai_set_limits_with_http_info(
|
||||
self,
|
||||
ai_limits_set: AiLimitsSet,
|
||||
_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[AiLimits]:
|
||||
"""Sets the payer's choice to keep using a model on credits once the plan's included usage of it is spent.
|
||||
|
||||
Sets the payer's choice to keep using a model on credits once the plan's included usage of it is spent. A pooled org wallet is its org admin's to set; a person's own wallet is theirs. Every change is on the audit trail, before and after; no trail, no change. Answers the limits as they read after it.
|
||||
|
||||
:param ai_limits_set: (required)
|
||||
:type ai_limits_set: AiLimitsSet
|
||||
: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._ai_set_limits_serialize(
|
||||
ai_limits_set=ai_limits_set,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "AiLimits",
|
||||
}
|
||||
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 ai_set_limits_without_preload_content(
|
||||
self,
|
||||
ai_limits_set: AiLimitsSet,
|
||||
_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:
|
||||
"""Sets the payer's choice to keep using a model on credits once the plan's included usage of it is spent.
|
||||
|
||||
Sets the payer's choice to keep using a model on credits once the plan's included usage of it is spent. A pooled org wallet is its org admin's to set; a person's own wallet is theirs. Every change is on the audit trail, before and after; no trail, no change. Answers the limits as they read after it.
|
||||
|
||||
:param ai_limits_set: (required)
|
||||
:type ai_limits_set: AiLimitsSet
|
||||
: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._ai_set_limits_serialize(
|
||||
ai_limits_set=ai_limits_set,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "AiLimits",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _ai_set_limits_serialize(
|
||||
self,
|
||||
ai_limits_set,
|
||||
_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 ai_limits_set is not None:
|
||||
_body_params = ai_limits_set
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json',
|
||||
'application/problem+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] = [
|
||||
'bearer'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method='PUT',
|
||||
resource_path='/v1/ai/limits',
|
||||
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 delete_ai_articles_by_owner_by_name(
|
||||
self,
|
||||
|
||||
@@ -319,9 +319,9 @@ class SyncApi:
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> SyncSyncList:
|
||||
"""Returns every sync link the caller's org has, each with its two endpoints, its direction and trigger policy, and the time it last reconciled.
|
||||
"""Returns every sync link the caller's org has, each with its two endpoints, its direction and trigger policy, the time it last reconciled, and for a repo link its native copy on the forge — the address to clone it from, its default branch and whether it is in step.
|
||||
|
||||
Returns every sync link the caller's org has, each with its two endpoints, its direction and trigger policy, and the time it last reconciled. Scoped to the caller's own org — another tenant's links are structurally unreachable.
|
||||
Returns every sync link the caller's org has, each with its two endpoints, its direction and trigger policy, the time it last reconciled, and for a repo link its native copy on the forge — the address to clone it from, its default branch and whether it is in step. Scoped to the caller's own org — another tenant's links are structurally unreachable.
|
||||
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
@@ -382,9 +382,9 @@ class SyncApi:
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> ApiResponse[SyncSyncList]:
|
||||
"""Returns every sync link the caller's org has, each with its two endpoints, its direction and trigger policy, and the time it last reconciled.
|
||||
"""Returns every sync link the caller's org has, each with its two endpoints, its direction and trigger policy, the time it last reconciled, and for a repo link its native copy on the forge — the address to clone it from, its default branch and whether it is in step.
|
||||
|
||||
Returns every sync link the caller's org has, each with its two endpoints, its direction and trigger policy, and the time it last reconciled. Scoped to the caller's own org — another tenant's links are structurally unreachable.
|
||||
Returns every sync link the caller's org has, each with its two endpoints, its direction and trigger policy, the time it last reconciled, and for a repo link its native copy on the forge — the address to clone it from, its default branch and whether it is in step. Scoped to the caller's own org — another tenant's links are structurally unreachable.
|
||||
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
@@ -445,9 +445,9 @@ class SyncApi:
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> RESTResponseType:
|
||||
"""Returns every sync link the caller's org has, each with its two endpoints, its direction and trigger policy, and the time it last reconciled.
|
||||
"""Returns every sync link the caller's org has, each with its two endpoints, its direction and trigger policy, the time it last reconciled, and for a repo link its native copy on the forge — the address to clone it from, its default branch and whether it is in step.
|
||||
|
||||
Returns every sync link the caller's org has, each with its two endpoints, its direction and trigger policy, and the time it last reconciled. Scoped to the caller's own org — another tenant's links are structurally unreachable.
|
||||
Returns every sync link the caller's org has, each with its two endpoints, its direction and trigger policy, the time it last reconciled, and for a repo link its native copy on the forge — the address to clone it from, its default branch and whether it is in step. Scoped to the caller's own org — another tenant's links are structurally unreachable.
|
||||
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
@@ -1121,7 +1121,7 @@ class SyncApi:
|
||||
) -> SyncSyncView:
|
||||
"""Declares a sync between two endpoints and returns it.
|
||||
|
||||
Declares a sync between two endpoints and returns it. It is an UPSERT: re-declaring the same source and target updates that link rather than piling up duplicates, so a console that re-submits is safe. The org comes from the validated principal, never from the request, so a sync can only ever bind endpoints inside the caller's own org. A git source must be an https clone URL on the provider's own host with no embedded credentials; a target left empty is derived as a native repository named after the source. With run=true the first reconcile is queued in the background, so a large initial import never blocks this response.
|
||||
Declares a sync between two endpoints and returns it. It is an UPSERT: re-declaring the same source and target updates that link rather than piling up duplicates, so a console that re-submits is safe. The org comes from the validated principal, never from the request, so a sync can only ever bind endpoints inside the caller's own org. A git source must be an https clone URL on the provider's own host with no embedded credentials; a target left empty is derived as a native repository named after the source. A source naming only a GitHub account (https://github.com/<account>) links the whole account: every repository the org's GitHub installation grants on it gets a repo link of its own, with this link's direction and trigger, and so does every repository created there later. With run=true the first reconcile is queued in the background, so a large initial import never blocks this response.
|
||||
|
||||
:param sync_sync_req: (required)
|
||||
:type sync_sync_req: SyncSyncReq
|
||||
@@ -1188,7 +1188,7 @@ class SyncApi:
|
||||
) -> ApiResponse[SyncSyncView]:
|
||||
"""Declares a sync between two endpoints and returns it.
|
||||
|
||||
Declares a sync between two endpoints and returns it. It is an UPSERT: re-declaring the same source and target updates that link rather than piling up duplicates, so a console that re-submits is safe. The org comes from the validated principal, never from the request, so a sync can only ever bind endpoints inside the caller's own org. A git source must be an https clone URL on the provider's own host with no embedded credentials; a target left empty is derived as a native repository named after the source. With run=true the first reconcile is queued in the background, so a large initial import never blocks this response.
|
||||
Declares a sync between two endpoints and returns it. It is an UPSERT: re-declaring the same source and target updates that link rather than piling up duplicates, so a console that re-submits is safe. The org comes from the validated principal, never from the request, so a sync can only ever bind endpoints inside the caller's own org. A git source must be an https clone URL on the provider's own host with no embedded credentials; a target left empty is derived as a native repository named after the source. A source naming only a GitHub account (https://github.com/<account>) links the whole account: every repository the org's GitHub installation grants on it gets a repo link of its own, with this link's direction and trigger, and so does every repository created there later. With run=true the first reconcile is queued in the background, so a large initial import never blocks this response.
|
||||
|
||||
:param sync_sync_req: (required)
|
||||
:type sync_sync_req: SyncSyncReq
|
||||
@@ -1255,7 +1255,7 @@ class SyncApi:
|
||||
) -> RESTResponseType:
|
||||
"""Declares a sync between two endpoints and returns it.
|
||||
|
||||
Declares a sync between two endpoints and returns it. It is an UPSERT: re-declaring the same source and target updates that link rather than piling up duplicates, so a console that re-submits is safe. The org comes from the validated principal, never from the request, so a sync can only ever bind endpoints inside the caller's own org. A git source must be an https clone URL on the provider's own host with no embedded credentials; a target left empty is derived as a native repository named after the source. With run=true the first reconcile is queued in the background, so a large initial import never blocks this response.
|
||||
Declares a sync between two endpoints and returns it. It is an UPSERT: re-declaring the same source and target updates that link rather than piling up duplicates, so a console that re-submits is safe. The org comes from the validated principal, never from the request, so a sync can only ever bind endpoints inside the caller's own org. A git source must be an https clone URL on the provider's own host with no embedded credentials; a target left empty is derived as a native repository named after the source. A source naming only a GitHub account (https://github.com/<account>) links the whole account: every repository the org's GitHub installation grants on it gets a repo link of its own, with this link's direction and trigger, and so does every repository created there later. With run=true the first reconcile is queued in the background, so a large initial import never blocks this response.
|
||||
|
||||
:param sync_sync_req: (required)
|
||||
:type sync_sync_req: SyncSyncReq
|
||||
|
||||
@@ -147,6 +147,7 @@ from hanzoai.cloud.models.ai_judge_benchmark import AiJudgeBenchmark
|
||||
from hanzoai.cloud.models.ai_judge_panel_state import AiJudgePanelState
|
||||
from hanzoai.cloud.models.ai_limited import AiLimited
|
||||
from hanzoai.cloud.models.ai_limits import AiLimits
|
||||
from hanzoai.cloud.models.ai_limits_set import AiLimitsSet
|
||||
from hanzoai.cloud.models.ai_mcp_app import AiMCPApp
|
||||
from hanzoai.cloud.models.ai_mcp_surface import AiMCPSurface
|
||||
from hanzoai.cloud.models.ai_model_access_info import AiModelAccessInfo
|
||||
@@ -155,6 +156,7 @@ from hanzoai.cloud.models.ai_model_list import AiModelList
|
||||
from hanzoai.cloud.models.ai_model_pricing_info import AiModelPricingInfo
|
||||
from hanzoai.cloud.models.ai_model_providers import AiModelProviders
|
||||
from hanzoai.cloud.models.ai_panel_judge import AiPanelJudge
|
||||
from hanzoai.cloud.models.ai_paused import AiPaused
|
||||
from hanzoai.cloud.models.ai_provider_usage import AiProviderUsage
|
||||
from hanzoai.cloud.models.ai_provider_usage_model_spend import AiProviderUsageModelSpend
|
||||
from hanzoai.cloud.models.ai_provider_usage_series_point import AiProviderUsageSeriesPoint
|
||||
@@ -313,7 +315,6 @@ from hanzoai.cloud.models.billing_transaction import BillingTransaction
|
||||
from hanzoai.cloud.models.billing_transactions import BillingTransactions
|
||||
from hanzoai.cloud.models.billing_usage_receipt import BillingUsageReceipt
|
||||
from hanzoai.cloud.models.billing_usage_report import BillingUsageReport
|
||||
from hanzoai.cloud.models.billing_window import BillingWindow
|
||||
from hanzoai.cloud.models.billing_wire_instructions import BillingWireInstructions
|
||||
from hanzoai.cloud.models.block import Block
|
||||
from hanzoai.cloud.models.blueprint_blueprint_health import BlueprintBlueprintHealth
|
||||
@@ -2690,6 +2691,7 @@ from hanzoai.cloud.models.store import Store
|
||||
from hanzoai.cloud.models.sweep import Sweep
|
||||
from hanzoai.cloud.models.sync_endpoint_req import SyncEndpointReq
|
||||
from hanzoai.cloud.models.sync_endpoint_view import SyncEndpointView
|
||||
from hanzoai.cloud.models.sync_native_view import SyncNativeView
|
||||
from hanzoai.cloud.models.sync_patch_sync_in import SyncPatchSyncIn
|
||||
from hanzoai.cloud.models.sync_sync_list import SyncSyncList
|
||||
from hanzoai.cloud.models.sync_sync_queued import SyncSyncQueued
|
||||
|
||||
@@ -17,11 +17,12 @@ import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from hanzoai.cloud.models.ai_action import AiAction
|
||||
from hanzoai.cloud.models.ai_class import AiClass
|
||||
from hanzoai.cloud.models.ai_limited import AiLimited
|
||||
from hanzoai.cloud.models.ai_paused import AiPaused
|
||||
from hanzoai.cloud.models.ai_window import AiWindow
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
@@ -32,15 +33,17 @@ class AiLimits(BaseModel):
|
||||
""" # noqa: E501
|
||||
actions: Optional[List[AiAction]] = Field(default=None, description="Actions are the ways on: upgrade, add prepaid credit.")
|
||||
classes: Optional[Dict[str, AiClass]] = Field(default=None, description="Classes are premium (third-party frontier models) and ours (Hanzo's), each present when the plan includes it.")
|
||||
credits_after_allowance: Optional[StrictBool] = Field(default=None, description="CreditsAfterAllowance is the payer's choice to keep using a model on credits once the plan's included usage of it is spent (PUT /v1/ai/limits sets it).")
|
||||
day: Optional[AiWindow] = None
|
||||
limited: Optional[AiLimited] = Field(default=None, description="Limited is present in limited mode.")
|
||||
paused: Optional[List[AiPaused]] = Field(default=None, description="Paused are the models whose share of the plan is used for now: each is answered by its fallback in chat until its share resets.")
|
||||
period_end: Optional[StrictStr] = None
|
||||
period_start: Optional[StrictStr] = Field(default=None, description="PeriodStart and PeriodEnd bound the billing period (RFC3339).")
|
||||
plan: Optional[StrictStr] = Field(default=None, description="Plan is the plan the caller is served as (\"dev\", \"max-5x\", \"max-20x\", \"team\", \"team-annual\", \"agency\", \"advisory\", \"dedicated\", ...), \"free\" when none counts.")
|
||||
session: Optional[AiWindow] = Field(default=None, description="Session and Day are the request windows over every request the plan covers.")
|
||||
state: Optional[StrictStr] = Field(default=None, description="State is the worst class's: ok, near or limited.")
|
||||
upgrade: Optional[StrictStr] = Field(default=None, description="Upgrade is the plan that raises these limits, absent at the top.")
|
||||
__properties: ClassVar[List[str]] = ["actions", "classes", "day", "limited", "period_end", "period_start", "plan", "session", "state", "upgrade"]
|
||||
__properties: ClassVar[List[str]] = ["actions", "classes", "credits_after_allowance", "day", "limited", "paused", "period_end", "period_start", "plan", "session", "state", "upgrade"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -101,6 +104,13 @@ class AiLimits(BaseModel):
|
||||
# override the default output from pydantic by calling `to_dict()` of limited
|
||||
if self.limited:
|
||||
_dict['limited'] = self.limited.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in paused (list)
|
||||
_items = []
|
||||
if self.paused:
|
||||
for _item_paused in self.paused:
|
||||
if _item_paused:
|
||||
_items.append(_item_paused.to_dict())
|
||||
_dict['paused'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of session
|
||||
if self.session:
|
||||
_dict['session'] = self.session.to_dict()
|
||||
@@ -123,8 +133,10 @@ class AiLimits(BaseModel):
|
||||
)
|
||||
if obj.get("classes") is not None
|
||||
else None,
|
||||
"credits_after_allowance": obj.get("credits_after_allowance"),
|
||||
"day": AiWindow.from_dict(obj["day"]) if obj.get("day") is not None else None,
|
||||
"limited": AiLimited.from_dict(obj["limited"]) if obj.get("limited") is not None else None,
|
||||
"paused": [AiPaused.from_dict(_item) for _item in obj["paused"]] if obj.get("paused") is not None else None,
|
||||
"period_end": obj.get("period_end"),
|
||||
"period_start": obj.get("period_start"),
|
||||
"plan": obj.get("plan"),
|
||||
|
||||
+8
-16
@@ -17,21 +17,17 @@ import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class BillingWindow(BaseModel):
|
||||
class AiLimitsSet(BaseModel):
|
||||
"""
|
||||
BillingWindow
|
||||
AiLimitsSet
|
||||
""" # noqa: E501
|
||||
limit: Optional[StrictInt] = None
|
||||
remaining: Optional[StrictInt] = None
|
||||
resets: Optional[StrictStr] = None
|
||||
span: Optional[StrictStr] = None
|
||||
used: Optional[StrictInt] = None
|
||||
__properties: ClassVar[List[str]] = ["limit", "remaining", "resets", "span", "used"]
|
||||
credits_after_allowance: Optional[StrictBool] = Field(default=None, description="CreditsAfterAllowance keeps a model working once the plan's included usage of it is spent, paid from prepaid credit (and granted credit where the model takes it), when true; when false the conversation moves to a Hanzo model and other calls are refused until the plan resets. Off until the payer turns it on.", alias="creditsAfterAllowance")
|
||||
__properties: ClassVar[List[str]] = ["creditsAfterAllowance"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -51,7 +47,7 @@ class BillingWindow(BaseModel):
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of BillingWindow from a JSON string"""
|
||||
"""Create an instance of AiLimitsSet from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
@@ -76,7 +72,7 @@ class BillingWindow(BaseModel):
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of BillingWindow from a dict"""
|
||||
"""Create an instance of AiLimitsSet from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
@@ -84,11 +80,7 @@ class BillingWindow(BaseModel):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"limit": obj.get("limit"),
|
||||
"remaining": obj.get("remaining"),
|
||||
"resets": obj.get("resets"),
|
||||
"span": obj.get("span"),
|
||||
"used": obj.get("used")
|
||||
"creditsAfterAllowance": obj.get("creditsAfterAllowance")
|
||||
})
|
||||
return _obj
|
||||
|
||||
@@ -17,7 +17,7 @@ import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from hanzoai.cloud.models.ai_model_access_info import AiModelAccessInfo
|
||||
from hanzoai.cloud.models.ai_model_pricing_info import AiModelPricingInfo
|
||||
@@ -30,19 +30,25 @@ class AiModelInfo(BaseModel):
|
||||
""" # noqa: E501
|
||||
access: Optional[AiModelAccessInfo] = None
|
||||
canonical_slug: Optional[StrictStr] = None
|
||||
var_class: Optional[StrictStr] = Field(default=None, alias="class")
|
||||
context_window: Optional[StrictInt] = None
|
||||
created: Optional[StrictInt] = None
|
||||
description: Optional[StrictStr] = None
|
||||
family: Optional[StrictStr] = None
|
||||
id: Optional[StrictStr] = None
|
||||
inputs: Optional[List[StrictStr]] = None
|
||||
max_output_tokens: Optional[StrictInt] = None
|
||||
name: Optional[StrictStr] = None
|
||||
object: Optional[StrictStr] = None
|
||||
outputs: Optional[List[StrictStr]] = None
|
||||
owned_by: Optional[StrictStr] = None
|
||||
premium: Optional[StrictBool] = None
|
||||
pricing: Optional[AiModelPricingInfo] = None
|
||||
provider: Optional[StrictStr] = None
|
||||
supports_reasoning: Optional[StrictBool] = None
|
||||
supports_tools: Optional[StrictBool] = None
|
||||
supports_vision: Optional[StrictBool] = None
|
||||
__properties: ClassVar[List[str]] = ["access", "canonical_slug", "context_window", "created", "id", "max_output_tokens", "object", "outputs", "owned_by", "premium", "pricing", "provider", "supports_tools", "supports_vision"]
|
||||
__properties: ClassVar[List[str]] = ["access", "canonical_slug", "class", "context_window", "created", "description", "family", "id", "inputs", "max_output_tokens", "name", "object", "outputs", "owned_by", "premium", "pricing", "provider", "supports_reasoning", "supports_tools", "supports_vision"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -103,16 +109,22 @@ class AiModelInfo(BaseModel):
|
||||
_obj = cls.model_validate({
|
||||
"access": AiModelAccessInfo.from_dict(obj["access"]) if obj.get("access") is not None else None,
|
||||
"canonical_slug": obj.get("canonical_slug"),
|
||||
"class": obj.get("class"),
|
||||
"context_window": obj.get("context_window"),
|
||||
"created": obj.get("created"),
|
||||
"description": obj.get("description"),
|
||||
"family": obj.get("family"),
|
||||
"id": obj.get("id"),
|
||||
"inputs": obj.get("inputs"),
|
||||
"max_output_tokens": obj.get("max_output_tokens"),
|
||||
"name": obj.get("name"),
|
||||
"object": obj.get("object"),
|
||||
"outputs": obj.get("outputs"),
|
||||
"owned_by": obj.get("owned_by"),
|
||||
"premium": obj.get("premium"),
|
||||
"pricing": AiModelPricingInfo.from_dict(obj["pricing"]) if obj.get("pricing") is not None else None,
|
||||
"provider": obj.get("provider"),
|
||||
"supports_reasoning": obj.get("supports_reasoning"),
|
||||
"supports_tools": obj.get("supports_tools"),
|
||||
"supports_vision": obj.get("supports_vision")
|
||||
})
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Hanzo Cloud API
|
||||
|
||||
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
||||
|
||||
The version of the OpenAPI document: v1
|
||||
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, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class AiPaused(BaseModel):
|
||||
"""
|
||||
AiPaused
|
||||
""" # noqa: E501
|
||||
fallback: Optional[StrictStr] = Field(default=None, description="Fallback is the Hanzo model that answers a conversation in its place.")
|
||||
model: Optional[StrictStr] = Field(default=None, description="Model is the model id, or a pattern ending in `*` naming a family of them.")
|
||||
resets_at: Optional[StrictStr] = Field(default=None, description="ResetsAt is when its share resets (RFC3339).")
|
||||
__properties: ClassVar[List[str]] = ["fallback", "model", "resets_at"]
|
||||
|
||||
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 AiPaused 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 AiPaused from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"fallback": obj.get("fallback"),
|
||||
"model": obj.get("model"),
|
||||
"resets_at": obj.get("resets_at")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ class AllowanceAllowance(BaseModel):
|
||||
pool: Optional[AllowancePool] = Field(default=None, description="Pool is that shared pool's standing, where it could be read. Absent when the subject is not pooled, and when the process that holds it did not answer — never a guess.")
|
||||
pooled: Optional[StrictBool] = Field(default=None, description="Pooled says the calls counted here are served from the pool every free user shares — the platform's vendor accounts for free models — rather than from the subject's own plan. True exactly where a window bounds the subject.")
|
||||
resets: Optional[StrictInt] = Field(default=None, description="unix seconds; when THAT window starts again")
|
||||
spent: Optional[StrictBool] = Field(default=None, description="the subject is at the limit")
|
||||
used: Optional[StrictInt] = Field(default=None, description="Used is how many zero-priced calls this subject has been SERVED in the period ending at Resets — the UTC calendar day. Only a served call counts, so an admission check, a refusal, or a vendor that never answered leaves it where it stood. It stops AT Limit rather than climbing past it, so Limit-Used is what remains and never goes negative.")
|
||||
spent: Optional[StrictBool] = Field(default=None, description="Spent says the ceiling refuses: on a take, that THIS call was refused and nothing was counted; on a read, that the next call would be.")
|
||||
used: Optional[StrictInt] = Field(default=None, description="Used is how many free calls this subject has been admitted in the period ending at Resets — the UTC calendar day. A call counts when it is admitted, whatever its upstream then does; a refused call counts nothing. It stops AT Limit rather than climbing past it, so Limit-Used is what remains and never goes negative.")
|
||||
window: Optional[StrictStr] = Field(default=None, description="Window is which ceiling these numbers describe — \"hour\" or \"day\" — because a caller is held to both and only one of them is the answer. It is the window that REFUSED where one did, and otherwise the one with least left, so Limit-Used is always the number that will actually stop them next. Empty where no window bounds the subject at all.")
|
||||
__properties: ClassVar[List[str]] = ["limit", "plan", "pool", "pooled", "resets", "spent", "used", "window"]
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from hanzoai.cloud.models.billing_rollup_allotment import BillingRollupAllotment
|
||||
from hanzoai.cloud.models.billing_rollup_balance import BillingRollupBalance
|
||||
from hanzoai.cloud.models.billing_window import BillingWindow
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
@@ -37,8 +36,7 @@ class BillingRollup(BaseModel):
|
||||
period: Optional[StrictStr] = None
|
||||
plan: Optional[StrictStr] = None
|
||||
user: Optional[StrictStr] = None
|
||||
windows: Optional[List[BillingWindow]] = None
|
||||
__properties: ClassVar[List[str]] = ["balance", "consumedCents", "currency", "included", "overageCents", "period", "plan", "user", "windows"]
|
||||
__properties: ClassVar[List[str]] = ["balance", "consumedCents", "currency", "included", "overageCents", "period", "plan", "user"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -85,13 +83,6 @@ class BillingRollup(BaseModel):
|
||||
# override the default output from pydantic by calling `to_dict()` of included
|
||||
if self.included:
|
||||
_dict['included'] = self.included.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in windows (list)
|
||||
_items = []
|
||||
if self.windows:
|
||||
for _item_windows in self.windows:
|
||||
if _item_windows:
|
||||
_items.append(_item_windows.to_dict())
|
||||
_dict['windows'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
@@ -111,8 +102,7 @@ class BillingRollup(BaseModel):
|
||||
"overageCents": obj.get("overageCents"),
|
||||
"period": obj.get("period"),
|
||||
"plan": obj.get("plan"),
|
||||
"user": obj.get("user"),
|
||||
"windows": [BillingWindow.from_dict(_item) for _item in obj["windows"]] if obj.get("windows") is not None else None
|
||||
"user": obj.get("user")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from hanzoai.cloud.models.billing_tier_balance import BillingTierBalance
|
||||
from hanzoai.cloud.models.billing_tier_limits import BillingTierLimits
|
||||
from hanzoai.cloud.models.billing_window import BillingWindow
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
@@ -34,8 +33,7 @@ class BillingTier(BaseModel):
|
||||
subscription: Optional[StrictStr] = Field(default=None, description="Subscription is the id of the subscription row whose plan is the served rung, \"\" when the tier is not a subscription's.")
|
||||
tier: Optional[BillingTierLimits] = None
|
||||
user: Optional[StrictStr] = None
|
||||
windows: Optional[List[BillingWindow]] = None
|
||||
__properties: ClassVar[List[str]] = ["balance", "plan", "subscription", "tier", "user", "windows"]
|
||||
__properties: ClassVar[List[str]] = ["balance", "plan", "subscription", "tier", "user"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -82,13 +80,6 @@ class BillingTier(BaseModel):
|
||||
# override the default output from pydantic by calling `to_dict()` of tier
|
||||
if self.tier:
|
||||
_dict['tier'] = self.tier.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in windows (list)
|
||||
_items = []
|
||||
if self.windows:
|
||||
for _item_windows in self.windows:
|
||||
if _item_windows:
|
||||
_items.append(_item_windows.to_dict())
|
||||
_dict['windows'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
@@ -105,8 +96,7 @@ class BillingTier(BaseModel):
|
||||
"plan": obj.get("plan"),
|
||||
"subscription": obj.get("subscription"),
|
||||
"tier": BillingTierLimits.from_dict(obj["tier"]) if obj.get("tier") is not None else None,
|
||||
"user": obj.get("user"),
|
||||
"windows": [BillingWindow.from_dict(_item) for _item in obj["windows"]] if obj.get("windows") is not None else None
|
||||
"user": obj.get("user")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Hanzo Cloud API
|
||||
|
||||
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
||||
|
||||
The version of the OpenAPI document: v1
|
||||
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 SyncNativeView(BaseModel):
|
||||
"""
|
||||
SyncNativeView
|
||||
""" # noqa: E501
|
||||
advanced_at: Optional[StrictStr] = Field(default=None, description="AdvancedAt is when an import or a push last moved one of its refs, RFC3339 in UTC. Absent until one has.", alias="advancedAt")
|
||||
branch: Optional[StrictStr] = Field(default=None, description="Branch is the forge's default branch, which an import sets to the upstream's once that branch has landed.")
|
||||
clone: Optional[StrictStr] = Field(default=None, description="Clone is the https address to clone it from.")
|
||||
size_bytes: Optional[StrictInt] = Field(default=None, description="SizeBytes is the repository's size on the forge, in bytes.", alias="sizeBytes")
|
||||
ssh: Optional[StrictStr] = Field(default=None, description="SSH is the ssh address to clone it from, when the forge serves one.")
|
||||
status: Optional[StrictStr] = Field(default=None, description="Status is one of \"synced\" (the forge holds it and no ref is in conflict), \"conflict\" (an upstream ref diverged and the forge kept its own history), \"pending\" (the forge does not hold it yet) or \"paused\" (the link's direction is off).")
|
||||
url: Optional[StrictStr] = Field(default=None, description="URL is the repository's page on the forge.")
|
||||
__properties: ClassVar[List[str]] = ["advancedAt", "branch", "clone", "sizeBytes", "ssh", "status", "url"]
|
||||
|
||||
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 SyncNativeView 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 SyncNativeView from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"advancedAt": obj.get("advancedAt"),
|
||||
"branch": obj.get("branch"),
|
||||
"clone": obj.get("clone"),
|
||||
"sizeBytes": obj.get("sizeBytes"),
|
||||
"ssh": obj.get("ssh"),
|
||||
"status": obj.get("status"),
|
||||
"url": obj.get("url")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import json
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from hanzoai.cloud.models.sync_endpoint_view import SyncEndpointView
|
||||
from hanzoai.cloud.models.sync_native_view import SyncNativeView
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
@@ -32,11 +33,13 @@ class SyncSyncView(BaseModel):
|
||||
direction: Optional[StrictStr] = Field(default=None, description="Direction is which way work flows: \"both\", \"pull\" (target ← source), \"push\" (source → target), or \"off\" — which keeps the link declared and moves nothing.")
|
||||
id: Optional[StrictStr] = Field(default=None, description="ID is the link's handle, derived from its source and target — which is what makes re-declaring the same pair an update rather than a duplicate.")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is what is being synced. \"git\" today; the field exists so a storage or database link is a value here rather than a second route family.")
|
||||
native: Optional[SyncNativeView] = Field(default=None, description="Native is the repo link's copy on the forge: where it lives and how it stands. Absent for an account link, and absent when the forge could not be read — an unread forge is not reported as a healthy one.")
|
||||
scope: Optional[StrictStr] = Field(default=None, description="Scope is \"repo\" for a link to one repository, or \"account\" for a link to a whole GitHub account, which declares a repo link for every repository the account holds — the ones created later included.")
|
||||
source: Optional[SyncEndpointView] = Field(default=None, description="Source is the side read FROM on a pull.")
|
||||
target: Optional[SyncEndpointView] = Field(default=None, description="Target is the side written TO on a push.")
|
||||
trigger: Optional[StrictStr] = Field(default=None, description="Trigger is what starts a reconcile: \"webhook\" (the provider tells us), \"poll\" (we ask on a schedule), or \"manual\" (only an explicit call).")
|
||||
updated_at: Optional[StrictStr] = Field(default=None, description="UpdatedAt is bumped by every reconcile, so it reads as the LAST-SYNCED time rather than the last edit. Absent until the first one runs.", alias="updatedAt")
|
||||
__properties: ClassVar[List[str]] = ["actor", "createdAt", "direction", "id", "kind", "source", "target", "trigger", "updatedAt"]
|
||||
__properties: ClassVar[List[str]] = ["actor", "createdAt", "direction", "id", "kind", "native", "scope", "source", "target", "trigger", "updatedAt"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -77,6 +80,9 @@ class SyncSyncView(BaseModel):
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of native
|
||||
if self.native:
|
||||
_dict['native'] = self.native.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of source
|
||||
if self.source:
|
||||
_dict['source'] = self.source.to_dict()
|
||||
@@ -100,6 +106,8 @@ class SyncSyncView(BaseModel):
|
||||
"direction": obj.get("direction"),
|
||||
"id": obj.get("id"),
|
||||
"kind": obj.get("kind"),
|
||||
"native": SyncNativeView.from_dict(obj["native"]) if obj.get("native") is not None else None,
|
||||
"scope": obj.get("scope"),
|
||||
"source": SyncEndpointView.from_dict(obj["source"]) if obj.get("source") is not None else None,
|
||||
"target": SyncEndpointView.from_dict(obj["target"]) if obj.get("target") is not None else None,
|
||||
"trigger": obj.get("trigger"),
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "hanzoai"
|
||||
version = "8.5.583"
|
||||
version = "8.5.604"
|
||||
description = "The official Python library for the Hanzo API"
|
||||
dynamic = ["readme"]
|
||||
license = "Apache-2.0"
|
||||
|
||||
Reference in New Issue
Block a user