client: regenerate from hanzo-inc/cloud@963ad356aa (8.5.640)

Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
2026-10-05 06:13:52 +00:00
co-authored by Hanzo Dev
parent 54e7f4fa2b
commit 18df31c7e1
41 changed files with 3372 additions and 450 deletions
+28 -4
View File
@@ -258,14 +258,16 @@ __all__ = [
"AiAnthropicTool",
"AiAnthropicUsage",
"AiCacheWrites",
"AiChat",
"AiChatIn",
"AiClass",
"AiCostStats",
"AiDecideIn",
"AiDecision",
"AiDecisionSides",
"AiDecisionSidesFalse",
"AiDecisionsAction",
"AiDecisionsAnswer",
"AiDecisionsChoice",
"AiDecisionsChoiceCriteriaValue",
"AiDecisionsNoul",
"AiDecisionsQuestion",
"AiDecisionsReason",
@@ -287,13 +289,16 @@ __all__ = [
"AiLimitsSet",
"AiMCPApp",
"AiMCPSurface",
"AiModel",
"AiModelAccessInfo",
"AiModelInfo",
"AiModelList",
"AiModelPricingInfo",
"AiModelProviders",
"AiModels",
"AiPanelJudge",
"AiPaused",
"AiPrice",
"AiProviderUsage",
"AiProviderUsageModelSpend",
"AiProviderUsageSeriesPoint",
@@ -303,6 +308,7 @@ __all__ = [
"AiRankedDoc",
"AiRankedText",
"AiRanking",
"AiReceipt",
"AiResponse",
"AiResponsesInputDetails",
"AiResponsesOutputDetails",
@@ -315,6 +321,7 @@ __all__ = [
"AiRoutingEdit",
"AiRoutingProbe",
"AiRoutingProposal",
"AiRoutingRewardRequest",
"AiRoutingRewardResult",
"AiRoutingView",
"AiStatsWindow",
@@ -370,7 +377,9 @@ __all__ = [
"AutoLastRun",
"AutoPatchFlowIn",
"AutoPopulatedFlow",
"AutoPostResult",
"AutoPropSpec",
"AutoReviewIn",
"AutoRunHandle",
"AutoRunIn",
"AutoRunPage",
@@ -1073,6 +1082,7 @@ __all__ = [
"GitWorkflowRun",
"GitWorkflowRuns",
"GitWorkflowView",
"GitWorkspaceView",
"Grants",
"Graph",
"GraphGraphAnswerIn",
@@ -2837,6 +2847,8 @@ __all__ = [
"TagConfig",
"Task",
"TaskBoardView",
"TaskComment",
"TaskCommentList",
"TaskIssueEdit",
"TaskIssueHit",
"TaskIssueHits",
@@ -3324,14 +3336,16 @@ from hanzoai.cloud.models.ai_anthropic_response import AiAnthropicResponse as Ai
from hanzoai.cloud.models.ai_anthropic_tool import AiAnthropicTool as AiAnthropicTool
from hanzoai.cloud.models.ai_anthropic_usage import AiAnthropicUsage as AiAnthropicUsage
from hanzoai.cloud.models.ai_cache_writes import AiCacheWrites as AiCacheWrites
from hanzoai.cloud.models.ai_chat import AiChat as AiChat
from hanzoai.cloud.models.ai_chat_in import AiChatIn as AiChatIn
from hanzoai.cloud.models.ai_class import AiClass as AiClass
from hanzoai.cloud.models.ai_cost_stats import AiCostStats as AiCostStats
from hanzoai.cloud.models.ai_decide_in import AiDecideIn as AiDecideIn
from hanzoai.cloud.models.ai_decision import AiDecision as AiDecision
from hanzoai.cloud.models.ai_decision_sides import AiDecisionSides as AiDecisionSides
from hanzoai.cloud.models.ai_decision_sides_false import AiDecisionSidesFalse as AiDecisionSidesFalse
from hanzoai.cloud.models.ai_decisions_action import AiDecisionsAction as AiDecisionsAction
from hanzoai.cloud.models.ai_decisions_answer import AiDecisionsAnswer as AiDecisionsAnswer
from hanzoai.cloud.models.ai_decisions_choice import AiDecisionsChoice as AiDecisionsChoice
from hanzoai.cloud.models.ai_decisions_choice_criteria_value import AiDecisionsChoiceCriteriaValue as AiDecisionsChoiceCriteriaValue
from hanzoai.cloud.models.ai_decisions_noul import AiDecisionsNoul as AiDecisionsNoul
from hanzoai.cloud.models.ai_decisions_question import AiDecisionsQuestion as AiDecisionsQuestion
from hanzoai.cloud.models.ai_decisions_reason import AiDecisionsReason as AiDecisionsReason
@@ -3353,13 +3367,16 @@ 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 import AiModel as AiModel
from hanzoai.cloud.models.ai_model_access_info import AiModelAccessInfo as AiModelAccessInfo
from hanzoai.cloud.models.ai_model_info import AiModelInfo as AiModelInfo
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_models import AiModels as AiModels
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_price import AiPrice as AiPrice
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
@@ -3369,6 +3386,7 @@ from hanzoai.cloud.models.ai_rank_usage import AiRankUsage as AiRankUsage
from hanzoai.cloud.models.ai_ranked_doc import AiRankedDoc as AiRankedDoc
from hanzoai.cloud.models.ai_ranked_text import AiRankedText as AiRankedText
from hanzoai.cloud.models.ai_ranking import AiRanking as AiRanking
from hanzoai.cloud.models.ai_receipt import AiReceipt as AiReceipt
from hanzoai.cloud.models.ai_response import AiResponse as AiResponse
from hanzoai.cloud.models.ai_responses_input_details import AiResponsesInputDetails as AiResponsesInputDetails
from hanzoai.cloud.models.ai_responses_output_details import AiResponsesOutputDetails as AiResponsesOutputDetails
@@ -3381,6 +3399,7 @@ from hanzoai.cloud.models.ai_router_stats import AiRouterStats as AiRouterStats
from hanzoai.cloud.models.ai_routing_edit import AiRoutingEdit as AiRoutingEdit
from hanzoai.cloud.models.ai_routing_probe import AiRoutingProbe as AiRoutingProbe
from hanzoai.cloud.models.ai_routing_proposal import AiRoutingProposal as AiRoutingProposal
from hanzoai.cloud.models.ai_routing_reward_request import AiRoutingRewardRequest as AiRoutingRewardRequest
from hanzoai.cloud.models.ai_routing_reward_result import AiRoutingRewardResult as AiRoutingRewardResult
from hanzoai.cloud.models.ai_routing_view import AiRoutingView as AiRoutingView
from hanzoai.cloud.models.ai_stats_window import AiStatsWindow as AiStatsWindow
@@ -3436,7 +3455,9 @@ from hanzoai.cloud.models.auto_flow_version import AutoFlowVersion as AutoFlowVe
from hanzoai.cloud.models.auto_last_run import AutoLastRun as AutoLastRun
from hanzoai.cloud.models.auto_patch_flow_in import AutoPatchFlowIn as AutoPatchFlowIn
from hanzoai.cloud.models.auto_populated_flow import AutoPopulatedFlow as AutoPopulatedFlow
from hanzoai.cloud.models.auto_post_result import AutoPostResult as AutoPostResult
from hanzoai.cloud.models.auto_prop_spec import AutoPropSpec as AutoPropSpec
from hanzoai.cloud.models.auto_review_in import AutoReviewIn as AutoReviewIn
from hanzoai.cloud.models.auto_run_handle import AutoRunHandle as AutoRunHandle
from hanzoai.cloud.models.auto_run_in import AutoRunIn as AutoRunIn
from hanzoai.cloud.models.auto_run_page import AutoRunPage as AutoRunPage
@@ -4139,6 +4160,7 @@ from hanzoai.cloud.models.git_workflow_list import GitWorkflowList as GitWorkflo
from hanzoai.cloud.models.git_workflow_run import GitWorkflowRun as GitWorkflowRun
from hanzoai.cloud.models.git_workflow_runs import GitWorkflowRuns as GitWorkflowRuns
from hanzoai.cloud.models.git_workflow_view import GitWorkflowView as GitWorkflowView
from hanzoai.cloud.models.git_workspace_view import GitWorkspaceView as GitWorkspaceView
from hanzoai.cloud.models.grants import Grants as Grants
from hanzoai.cloud.models.graph import Graph as Graph
from hanzoai.cloud.models.graph_graph_answer_in import GraphGraphAnswerIn as GraphGraphAnswerIn
@@ -5903,6 +5925,8 @@ from hanzoai.cloud.models.sync_sync_view import SyncSyncView as SyncSyncView
from hanzoai.cloud.models.tag_config import TagConfig as TagConfig
from hanzoai.cloud.models.task import Task as Task
from hanzoai.cloud.models.task_board_view import TaskBoardView as TaskBoardView
from hanzoai.cloud.models.task_comment import TaskComment as TaskComment
from hanzoai.cloud.models.task_comment_list import TaskCommentList as TaskCommentList
from hanzoai.cloud.models.task_issue_edit import TaskIssueEdit as TaskIssueEdit
from hanzoai.cloud.models.task_issue_hit import TaskIssueHit as TaskIssueHit
from hanzoai.cloud.models.task_issue_hits import TaskIssueHits as TaskIssueHits
File diff suppressed because it is too large Load Diff
+307
View File
@@ -23,6 +23,7 @@ from hanzoai.cloud.models.auto_automation import AutoAutomation
from hanzoai.cloud.models.auto_automation_in import AutoAutomationIn
from hanzoai.cloud.models.auto_automation_page import AutoAutomationPage
from hanzoai.cloud.models.auto_automation_patch import AutoAutomationPatch
from hanzoai.cloud.models.auto_automation_run import AutoAutomationRun
from hanzoai.cloud.models.auto_automation_run_page import AutoAutomationRunPage
from hanzoai.cloud.models.auto_catalog import AutoCatalog
from hanzoai.cloud.models.auto_create_flow_req import AutoCreateFlowReq
@@ -33,6 +34,7 @@ from hanzoai.cloud.models.auto_flow_run import AutoFlowRun
from hanzoai.cloud.models.auto_flow_version import AutoFlowVersion
from hanzoai.cloud.models.auto_patch_flow_in import AutoPatchFlowIn
from hanzoai.cloud.models.auto_populated_flow import AutoPopulatedFlow
from hanzoai.cloud.models.auto_review_in import AutoReviewIn
from hanzoai.cloud.models.auto_run_in import AutoRunIn
from hanzoai.cloud.models.auto_run_page import AutoRunPage
from hanzoai.cloud.models.auto_run_resp import AutoRunResp
@@ -4361,6 +4363,311 @@ class AutoApi:
@validate_call
def post_auto_automations_by_id_runs_by_run_review(
self,
id: Annotated[StrictStr, Field(description="ID is the automation, and Run its run in review, from the path.")],
run: StrictStr,
auto_review_in: AutoReviewIn,
_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,
) -> AutoAutomationRun:
"""Answers a run that holds a post for review, for the person the automation runs as or an admin of the org: `post` true posts it to the automation's accounts and answers the run while it posts; false discards it.
Answers a run that holds a post for review, for the person the automation runs as or an admin of the org: `post` true posts it to the automation's accounts and answers the run while it posts; false discards it. A run not in review answers 409; one held longer than a day is not posted.
:param id: ID is the automation, and Run its run in review, from the path. (required)
:type id: str
:param run: (required)
:type run: str
:param auto_review_in: (required)
:type auto_review_in: AutoReviewIn
: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._post_auto_automations_by_id_runs_by_run_review_serialize(
id=id,
run=run,
auto_review_in=auto_review_in,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "AutoAutomationRun",
}
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 post_auto_automations_by_id_runs_by_run_review_with_http_info(
self,
id: Annotated[StrictStr, Field(description="ID is the automation, and Run its run in review, from the path.")],
run: StrictStr,
auto_review_in: AutoReviewIn,
_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[AutoAutomationRun]:
"""Answers a run that holds a post for review, for the person the automation runs as or an admin of the org: `post` true posts it to the automation's accounts and answers the run while it posts; false discards it.
Answers a run that holds a post for review, for the person the automation runs as or an admin of the org: `post` true posts it to the automation's accounts and answers the run while it posts; false discards it. A run not in review answers 409; one held longer than a day is not posted.
:param id: ID is the automation, and Run its run in review, from the path. (required)
:type id: str
:param run: (required)
:type run: str
:param auto_review_in: (required)
:type auto_review_in: AutoReviewIn
: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._post_auto_automations_by_id_runs_by_run_review_serialize(
id=id,
run=run,
auto_review_in=auto_review_in,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "AutoAutomationRun",
}
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 post_auto_automations_by_id_runs_by_run_review_without_preload_content(
self,
id: Annotated[StrictStr, Field(description="ID is the automation, and Run its run in review, from the path.")],
run: StrictStr,
auto_review_in: AutoReviewIn,
_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:
"""Answers a run that holds a post for review, for the person the automation runs as or an admin of the org: `post` true posts it to the automation's accounts and answers the run while it posts; false discards it.
Answers a run that holds a post for review, for the person the automation runs as or an admin of the org: `post` true posts it to the automation's accounts and answers the run while it posts; false discards it. A run not in review answers 409; one held longer than a day is not posted.
:param id: ID is the automation, and Run its run in review, from the path. (required)
:type id: str
:param run: (required)
:type run: str
:param auto_review_in: (required)
:type auto_review_in: AutoReviewIn
: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._post_auto_automations_by_id_runs_by_run_review_serialize(
id=id,
run=run,
auto_review_in=auto_review_in,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "AutoAutomationRun",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _post_auto_automations_by_id_runs_by_run_review_serialize(
self,
id,
run,
auto_review_in,
_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
if id is not None:
_path_params['id'] = id
if run is not None:
_path_params['run'] = run
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
if auto_review_in is not None:
_body_params = auto_review_in
# 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='POST',
resource_path='/v1/auto/automations/{id}/runs/{run}/review',
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 post_auto_flows(
self,
+3 -3
View File
@@ -2501,7 +2501,7 @@ class BillingApi:
) -> None:
"""Prepaid credit the caller's org can still spend
Answers the spendable prepaid balance of the wallet this caller bills from — the same wallet the AI prepaid gate reads before admitting a paid request, the edge meter debits, and a top-up credits. The wallet is an ADDRESS, not an org: `account` echoes the key resolved within the ledger — the org's shared pool for a tenant org, a personal account for a member of the shared signup org. The echo is the point. A browser could only GUESS its own payer by decoding its own token, and a guess that disagrees with the server is how money lands in an account the gate never reads. `balance`, `holds` and `available` are whole USD cents, ROUNDED from the ledger's exact 18-decimal value. On the co-resident ledger `holds` is 0 and `available` equals `balance`: the gate's reservations live in its own pod and are never posted, so the settled balance IS the spendable one. `cash` and `credit` say where `available` came from, and add up to it. `cash` is money the customer paid — a settled card payment or a recorded wire. `credit` is money Hanzo minted: signup and promotional credit, admin grants. Both pay for any call, and every debit draws cash first. The ledger is the caller's own org, taken from the VALIDATED IAM owner claim and never from a client header. No validated principal is 401. A balance that cannot be READ is 502, never 0: unknown is not broke.
Answers the spendable prepaid balance of the wallet this caller bills from — the same wallet the AI prepaid gate reads before admitting a paid request, the edge meter debits, and a top-up credits. The wallet is an ADDRESS, not an org: `account` echoes the key resolved within the ledger — the org's shared pool for a tenant org, a personal account for a member of the shared signup org. The echo is the point. A browser could only GUESS its own payer by decoding its own token, and a guess that disagrees with the server is how money lands in an account the gate never reads. `balance`, `holds` and `available` are whole USD cents, ROUNDED from the ledger's exact 18-decimal value. On the co-resident ledger `holds` is 0 and `available` equals `balance`: the gate's reservations live in its own pod and are never posted, so the settled balance IS the spendable one. `cash`, `line` and `credit` say where `available` came from, and add up to it. `cash` is money the customer paid — a settled card payment or a recorded wire. `credit` is money Hanzo minted: signup and promotional credit, admin grants. `line` is what is left of the org's postpaid credit line (`creditLimit`), and `due` what the account owes on it: usage the line paid for, invoiced, and paid down first by the next payment. A debit draws cash, then the line, then credit; granted credit never pays what is due. The three line fields are absent when the ledger did not report them. The ledger is the caller's own org, taken from the VALIDATED IAM owner claim and never from a client header. No validated principal is 401. A balance that cannot be READ is 502, never 0: unknown is not broke.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
@@ -2563,7 +2563,7 @@ class BillingApi:
) -> ApiResponse[None]:
"""Prepaid credit the caller's org can still spend
Answers the spendable prepaid balance of the wallet this caller bills from — the same wallet the AI prepaid gate reads before admitting a paid request, the edge meter debits, and a top-up credits. The wallet is an ADDRESS, not an org: `account` echoes the key resolved within the ledger — the org's shared pool for a tenant org, a personal account for a member of the shared signup org. The echo is the point. A browser could only GUESS its own payer by decoding its own token, and a guess that disagrees with the server is how money lands in an account the gate never reads. `balance`, `holds` and `available` are whole USD cents, ROUNDED from the ledger's exact 18-decimal value. On the co-resident ledger `holds` is 0 and `available` equals `balance`: the gate's reservations live in its own pod and are never posted, so the settled balance IS the spendable one. `cash` and `credit` say where `available` came from, and add up to it. `cash` is money the customer paid — a settled card payment or a recorded wire. `credit` is money Hanzo minted: signup and promotional credit, admin grants. Both pay for any call, and every debit draws cash first. The ledger is the caller's own org, taken from the VALIDATED IAM owner claim and never from a client header. No validated principal is 401. A balance that cannot be READ is 502, never 0: unknown is not broke.
Answers the spendable prepaid balance of the wallet this caller bills from — the same wallet the AI prepaid gate reads before admitting a paid request, the edge meter debits, and a top-up credits. The wallet is an ADDRESS, not an org: `account` echoes the key resolved within the ledger — the org's shared pool for a tenant org, a personal account for a member of the shared signup org. The echo is the point. A browser could only GUESS its own payer by decoding its own token, and a guess that disagrees with the server is how money lands in an account the gate never reads. `balance`, `holds` and `available` are whole USD cents, ROUNDED from the ledger's exact 18-decimal value. On the co-resident ledger `holds` is 0 and `available` equals `balance`: the gate's reservations live in its own pod and are never posted, so the settled balance IS the spendable one. `cash`, `line` and `credit` say where `available` came from, and add up to it. `cash` is money the customer paid — a settled card payment or a recorded wire. `credit` is money Hanzo minted: signup and promotional credit, admin grants. `line` is what is left of the org's postpaid credit line (`creditLimit`), and `due` what the account owes on it: usage the line paid for, invoiced, and paid down first by the next payment. A debit draws cash, then the line, then credit; granted credit never pays what is due. The three line fields are absent when the ledger did not report them. The ledger is the caller's own org, taken from the VALIDATED IAM owner claim and never from a client header. No validated principal is 401. A balance that cannot be READ is 502, never 0: unknown is not broke.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
@@ -2625,7 +2625,7 @@ class BillingApi:
) -> RESTResponseType:
"""Prepaid credit the caller's org can still spend
Answers the spendable prepaid balance of the wallet this caller bills from — the same wallet the AI prepaid gate reads before admitting a paid request, the edge meter debits, and a top-up credits. The wallet is an ADDRESS, not an org: `account` echoes the key resolved within the ledger — the org's shared pool for a tenant org, a personal account for a member of the shared signup org. The echo is the point. A browser could only GUESS its own payer by decoding its own token, and a guess that disagrees with the server is how money lands in an account the gate never reads. `balance`, `holds` and `available` are whole USD cents, ROUNDED from the ledger's exact 18-decimal value. On the co-resident ledger `holds` is 0 and `available` equals `balance`: the gate's reservations live in its own pod and are never posted, so the settled balance IS the spendable one. `cash` and `credit` say where `available` came from, and add up to it. `cash` is money the customer paid — a settled card payment or a recorded wire. `credit` is money Hanzo minted: signup and promotional credit, admin grants. Both pay for any call, and every debit draws cash first. The ledger is the caller's own org, taken from the VALIDATED IAM owner claim and never from a client header. No validated principal is 401. A balance that cannot be READ is 502, never 0: unknown is not broke.
Answers the spendable prepaid balance of the wallet this caller bills from — the same wallet the AI prepaid gate reads before admitting a paid request, the edge meter debits, and a top-up credits. The wallet is an ADDRESS, not an org: `account` echoes the key resolved within the ledger — the org's shared pool for a tenant org, a personal account for a member of the shared signup org. The echo is the point. A browser could only GUESS its own payer by decoding its own token, and a guess that disagrees with the server is how money lands in an account the gate never reads. `balance`, `holds` and `available` are whole USD cents, ROUNDED from the ledger's exact 18-decimal value. On the co-resident ledger `holds` is 0 and `available` equals `balance`: the gate's reservations live in its own pod and are never posted, so the settled balance IS the spendable one. `cash`, `line` and `credit` say where `available` came from, and add up to it. `cash` is money the customer paid — a settled card payment or a recorded wire. `credit` is money Hanzo minted: signup and promotional credit, admin grants. `line` is what is left of the org's postpaid credit line (`creditLimit`), and `due` what the account owes on it: usage the line paid for, invoiced, and paid down first by the next payment. A debit draws cash, then the line, then credit; granted credit never pays what is due. The three line fields are absent when the ledger did not report them. The ledger is the caller's own org, taken from the VALIDATED IAM owner claim and never from a client header. No validated principal is 401. A balance that cannot be READ is 502, never 0: unknown is not broke.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
+248
View File
@@ -54,6 +54,7 @@ from hanzoai.cloud.models.git_usage_view import GitUsageView
from hanzoai.cloud.models.git_workflow_list import GitWorkflowList
from hanzoai.cloud.models.git_workflow_run import GitWorkflowRun
from hanzoai.cloud.models.git_workflow_runs import GitWorkflowRuns
from hanzoai.cloud.models.git_workspace_view import GitWorkspaceView
from hanzoai.cloud.models.runner_declare_in import RunnerDeclareIn
from hanzoai.cloud.models.runner_declare_out import RunnerDeclareOut
from hanzoai.cloud.models.runner_log_in import RunnerLogIn
@@ -12704,6 +12705,253 @@ class GitApi:
@validate_call
def post_git_workspace(
self,
_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,
) -> GitWorkspaceView:
"""Sets the org's code workspace up for the caller and answers it: the namespace, made when the org has none, and the caller's forge account and seat there.
Sets the org's code workspace up for the caller and answers it: the namespace, made when the org has none, and the caller's forge account and seat there. Idempotent. The estate's namespace is answered from the closed table and nobody is enrolled in it. A seat is a person's: an API key or an application is refused, and a SuperAdmin acting in another org reads the workspace as it is and makes nothing.
: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._post_git_workspace_serialize(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GitWorkspaceView",
}
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 post_git_workspace_with_http_info(
self,
_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[GitWorkspaceView]:
"""Sets the org's code workspace up for the caller and answers it: the namespace, made when the org has none, and the caller's forge account and seat there.
Sets the org's code workspace up for the caller and answers it: the namespace, made when the org has none, and the caller's forge account and seat there. Idempotent. The estate's namespace is answered from the closed table and nobody is enrolled in it. A seat is a person's: an API key or an application is refused, and a SuperAdmin acting in another org reads the workspace as it is and makes nothing.
: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._post_git_workspace_serialize(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GitWorkspaceView",
}
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 post_git_workspace_without_preload_content(
self,
_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 org's code workspace up for the caller and answers it: the namespace, made when the org has none, and the caller's forge account and seat there.
Sets the org's code workspace up for the caller and answers it: the namespace, made when the org has none, and the caller's forge account and seat there. Idempotent. The estate's namespace is answered from the closed table and nobody is enrolled in it. A seat is a person's: an API key or an application is refused, and a SuperAdmin acting in another org reads the workspace as it is and makes nothing.
: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._post_git_workspace_serialize(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GitWorkspaceView",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _post_git_workspace_serialize(
self,
_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
# 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'
]
)
# authentication setting
_auth_settings: List[str] = [
'bearer'
]
return self.api_client.param_serialize(
method='POST',
resource_path='/v1/git/workspace',
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 post_runner_declare(
self,
+278
View File
@@ -20,6 +20,7 @@ from pydantic import Field, StrictBool, StrictInt, StrictStr
from typing import List, Optional
from typing_extensions import Annotated
from hanzoai.cloud.models.task_board_view import TaskBoardView
from hanzoai.cloud.models.task_comment_list import TaskCommentList
from hanzoai.cloud.models.task_issue_edit import TaskIssueEdit
from hanzoai.cloud.models.task_issue_hit import TaskIssueHit
from hanzoai.cloud.models.task_issue_hits import TaskIssueHits
@@ -2212,6 +2213,283 @@ class TaskApi:
@validate_call
def get_task_projects_by_key_issues_by_num_comments(
self,
key: Annotated[StrictStr, Field(description="Key is the board — the repository name, or an index board's key.")],
num: Annotated[StrictInt, Field(description="Num is the issue's number on that board.")],
_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,
) -> TaskCommentList:
"""Is one issue's conversation, oldest first, read as the caller.
Is one issue's conversation, oldest first, read as the caller. An issue that lives on GitHub names its home and is read there.
:param key: Key is the board — the repository name, or an index board's key. (required)
:type key: str
:param num: Num is the issue's number on that board. (required)
:type num: int
: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._get_task_projects_by_key_issues_by_num_comments_serialize(
key=key,
num=num,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "TaskCommentList",
}
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 get_task_projects_by_key_issues_by_num_comments_with_http_info(
self,
key: Annotated[StrictStr, Field(description="Key is the board — the repository name, or an index board's key.")],
num: Annotated[StrictInt, Field(description="Num is the issue's number on that board.")],
_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[TaskCommentList]:
"""Is one issue's conversation, oldest first, read as the caller.
Is one issue's conversation, oldest first, read as the caller. An issue that lives on GitHub names its home and is read there.
:param key: Key is the board — the repository name, or an index board's key. (required)
:type key: str
:param num: Num is the issue's number on that board. (required)
:type num: int
: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._get_task_projects_by_key_issues_by_num_comments_serialize(
key=key,
num=num,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "TaskCommentList",
}
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 get_task_projects_by_key_issues_by_num_comments_without_preload_content(
self,
key: Annotated[StrictStr, Field(description="Key is the board — the repository name, or an index board's key.")],
num: Annotated[StrictInt, Field(description="Num is the issue's number on that board.")],
_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:
"""Is one issue's conversation, oldest first, read as the caller.
Is one issue's conversation, oldest first, read as the caller. An issue that lives on GitHub names its home and is read there.
:param key: Key is the board — the repository name, or an index board's key. (required)
:type key: str
:param num: Num is the issue's number on that board. (required)
:type num: int
: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._get_task_projects_by_key_issues_by_num_comments_serialize(
key=key,
num=num,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "TaskCommentList",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _get_task_projects_by_key_issues_by_num_comments_serialize(
self,
key,
num,
_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
if key is not None:
_path_params['key'] = key
if num is not None:
_path_params['num'] = num
# process the query parameters
# 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',
'application/problem+json'
]
)
# authentication setting
_auth_settings: List[str] = [
'bearer'
]
return self.api_client.param_serialize(
method='GET',
resource_path='/v1/task/projects/{key}/issues/{num}/comments',
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 get_task_rooms_by_room(
self,
+14 -2
View File
@@ -121,14 +121,16 @@ from hanzoai.cloud.models.ai_anthropic_response import AiAnthropicResponse
from hanzoai.cloud.models.ai_anthropic_tool import AiAnthropicTool
from hanzoai.cloud.models.ai_anthropic_usage import AiAnthropicUsage
from hanzoai.cloud.models.ai_cache_writes import AiCacheWrites
from hanzoai.cloud.models.ai_chat import AiChat
from hanzoai.cloud.models.ai_chat_in import AiChatIn
from hanzoai.cloud.models.ai_class import AiClass
from hanzoai.cloud.models.ai_cost_stats import AiCostStats
from hanzoai.cloud.models.ai_decide_in import AiDecideIn
from hanzoai.cloud.models.ai_decision import AiDecision
from hanzoai.cloud.models.ai_decision_sides import AiDecisionSides
from hanzoai.cloud.models.ai_decision_sides_false import AiDecisionSidesFalse
from hanzoai.cloud.models.ai_decisions_action import AiDecisionsAction
from hanzoai.cloud.models.ai_decisions_answer import AiDecisionsAnswer
from hanzoai.cloud.models.ai_decisions_choice import AiDecisionsChoice
from hanzoai.cloud.models.ai_decisions_choice_criteria_value import AiDecisionsChoiceCriteriaValue
from hanzoai.cloud.models.ai_decisions_noul import AiDecisionsNoul
from hanzoai.cloud.models.ai_decisions_question import AiDecisionsQuestion
from hanzoai.cloud.models.ai_decisions_reason import AiDecisionsReason
@@ -150,13 +152,16 @@ 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 import AiModel
from hanzoai.cloud.models.ai_model_access_info import AiModelAccessInfo
from hanzoai.cloud.models.ai_model_info import AiModelInfo
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_models import AiModels
from hanzoai.cloud.models.ai_panel_judge import AiPanelJudge
from hanzoai.cloud.models.ai_paused import AiPaused
from hanzoai.cloud.models.ai_price import AiPrice
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
@@ -166,6 +171,7 @@ from hanzoai.cloud.models.ai_rank_usage import AiRankUsage
from hanzoai.cloud.models.ai_ranked_doc import AiRankedDoc
from hanzoai.cloud.models.ai_ranked_text import AiRankedText
from hanzoai.cloud.models.ai_ranking import AiRanking
from hanzoai.cloud.models.ai_receipt import AiReceipt
from hanzoai.cloud.models.ai_response import AiResponse
from hanzoai.cloud.models.ai_responses_input_details import AiResponsesInputDetails
from hanzoai.cloud.models.ai_responses_output_details import AiResponsesOutputDetails
@@ -178,6 +184,7 @@ from hanzoai.cloud.models.ai_router_stats import AiRouterStats
from hanzoai.cloud.models.ai_routing_edit import AiRoutingEdit
from hanzoai.cloud.models.ai_routing_probe import AiRoutingProbe
from hanzoai.cloud.models.ai_routing_proposal import AiRoutingProposal
from hanzoai.cloud.models.ai_routing_reward_request import AiRoutingRewardRequest
from hanzoai.cloud.models.ai_routing_reward_result import AiRoutingRewardResult
from hanzoai.cloud.models.ai_routing_view import AiRoutingView
from hanzoai.cloud.models.ai_stats_window import AiStatsWindow
@@ -233,7 +240,9 @@ from hanzoai.cloud.models.auto_flow_version import AutoFlowVersion
from hanzoai.cloud.models.auto_last_run import AutoLastRun
from hanzoai.cloud.models.auto_patch_flow_in import AutoPatchFlowIn
from hanzoai.cloud.models.auto_populated_flow import AutoPopulatedFlow
from hanzoai.cloud.models.auto_post_result import AutoPostResult
from hanzoai.cloud.models.auto_prop_spec import AutoPropSpec
from hanzoai.cloud.models.auto_review_in import AutoReviewIn
from hanzoai.cloud.models.auto_run_handle import AutoRunHandle
from hanzoai.cloud.models.auto_run_in import AutoRunIn
from hanzoai.cloud.models.auto_run_page import AutoRunPage
@@ -936,6 +945,7 @@ from hanzoai.cloud.models.git_workflow_list import GitWorkflowList
from hanzoai.cloud.models.git_workflow_run import GitWorkflowRun
from hanzoai.cloud.models.git_workflow_runs import GitWorkflowRuns
from hanzoai.cloud.models.git_workflow_view import GitWorkflowView
from hanzoai.cloud.models.git_workspace_view import GitWorkspaceView
from hanzoai.cloud.models.grants import Grants
from hanzoai.cloud.models.graph import Graph
from hanzoai.cloud.models.graph_graph_answer_in import GraphGraphAnswerIn
@@ -2700,6 +2710,8 @@ from hanzoai.cloud.models.sync_sync_view import SyncSyncView
from hanzoai.cloud.models.tag_config import TagConfig
from hanzoai.cloud.models.task import Task
from hanzoai.cloud.models.task_board_view import TaskBoardView
from hanzoai.cloud.models.task_comment import TaskComment
from hanzoai.cloud.models.task_comment_list import TaskCommentList
from hanzoai.cloud.models.task_issue_edit import TaskIssueEdit
from hanzoai.cloud.models.task_issue_hit import TaskIssueHit
from hanzoai.cloud.models.task_issue_hits import TaskIssueHits
@@ -17,7 +17,7 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.agent_metrics import AgentMetrics
from hanzoai.cloud.models.agent_spec import AgentSpec
@@ -37,11 +37,12 @@ class AgentTargetView(BaseModel):
metrics: Optional[AgentMetrics] = Field(default=None, description="Metrics is what the machine was DOING at its last heartbeat — loadavg, memory, accelerator utilization. Absent when it has never beaten. It is a SNAPSHOT: the series over time lives in the fleet samples, not here.")
metrics_at: Optional[StrictStr] = Field(default=None, description="MetricsAt is when that heartbeat was recorded, RFC 3339 in UTC, and the SERVER stamps it — a client cannot backdate or forge the staleness clock. Absent means never beaten, which is exactly the case where Status is taken at its word.", alias="metricsAt")
running: Optional[StrictInt] = Field(default=None, description="Running is how many of those are in `running` right now — the number a dispatcher weighs against Capacity. paused sessions are in Sessions and not here.")
serving: Optional[StrictBool] = Field(default=None, description="Serving says whether a run the caller sends here now would be taken: the machine is the caller's (or the caller is an org admin), and it is online with a runner that polled for work within the last 90 seconds — the online and runner half is what dispatch checks (TargetDispatchable). A heartbeat alone keeps a machine online, not serving, and a colleague's machine never serves the caller.")
sessions: Optional[StrictInt] = Field(default=None, description="Sessions is how many of the org's sessions are mapped to this machine, by target id OR by matching Host. All of them, whatever their status.")
spec: Optional[AgentSpec] = Field(default=None, description="Spec is what the machine IS — os, arch, cores, RAM, accelerators — the static half, changed only when something reports it again. Absent when nothing has ever been reported, and a scheduler reads absence as \"cannot satisfy a floor\" rather than as \"no limits\".")
status: Optional[StrictStr] = Field(default=None, description="Status is the EFFECTIVE liveness — online | offline | draining — not the stored one. offline and draining are operator INTENT and are reported as they stand; `online` is checked against the heartbeat, and a machine that has beaten before but not in the last 90 seconds reports offline whatever its row says. A target that has NEVER beaten keeps its stored status, because a hand-registered destination has no fact to check.")
updated_at: Optional[StrictStr] = Field(default=None, description="UpdatedAt is the last write to the row, same format — which for a beating machine is its last heartbeat, since a heartbeat IS a write.", alias="updatedAt")
__properties: ClassVar[List[str]] = ["capacity", "createdAt", "host", "id", "kind", "label", "metrics", "metricsAt", "running", "sessions", "spec", "status", "updatedAt"]
__properties: ClassVar[List[str]] = ["capacity", "createdAt", "host", "id", "kind", "label", "metrics", "metricsAt", "running", "serving", "sessions", "spec", "status", "updatedAt"]
model_config = ConfigDict(
populate_by_name=True,
@@ -109,6 +110,7 @@ class AgentTargetView(BaseModel):
"metrics": AgentMetrics.from_dict(obj["metrics"]) if obj.get("metrics") is not None else None,
"metricsAt": obj.get("metricsAt"),
"running": obj.get("running"),
"serving": obj.get("serving"),
"sessions": obj.get("sessions"),
"spec": AgentSpec.from_dict(obj["spec"]) if obj.get("spec") is not None else None,
"status": obj.get("status"),
+95
View File
@@ -0,0 +1,95 @@
# 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 hanzoai.cloud.models.ai_receipt import AiReceipt
from typing import Optional, Set
from typing_extensions import Self
class AiChat(BaseModel):
"""
AiChat
""" # noqa: E501
answer: Optional[StrictStr] = Field(default=None, description="Answer is the model's reply.")
model: Optional[StrictStr] = Field(default=None, description="Model is the model asked: the caller's, or the default when it named none.")
receipt: Optional[AiReceipt] = Field(default=None, description="Receipt says which model served the reply and who paid for it.")
__properties: ClassVar[List[str]] = ["answer", "model", "receipt"]
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 AiChat 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,
)
# override the default output from pydantic by calling `to_dict()` of receipt
if self.receipt:
_dict['receipt'] = self.receipt.to_dict()
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AiChat from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"answer": obj.get("answer"),
"model": obj.get("model"),
"receipt": AiReceipt.from_dict(obj["receipt"]) if obj.get("receipt") is not None else None
})
return _obj
+93
View File
@@ -0,0 +1,93 @@
# 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 AiChatIn(BaseModel):
"""
AiChatIn
""" # noqa: E501
max_tokens: Optional[StrictInt] = Field(default=None, description="MaxTokens bounds the answer in tokens; 0 leaves it to the model.")
model: Optional[StrictStr] = Field(default=None, description="Model is the model to answer, by id (zen5, enso, kai, anthropic/claude-sonnet-4.5 — aiModels lists them). Empty asks the deployment's default Hanzo model.")
prompt: Optional[StrictStr] = Field(default=None, description="Prompt is what to ask.")
system: Optional[StrictStr] = Field(default=None, description="System is the system message ahead of the prompt, when set.")
__properties: ClassVar[List[str]] = ["max_tokens", "model", "prompt", "system"]
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 AiChatIn 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 AiChatIn from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"max_tokens": obj.get("max_tokens"),
"model": obj.get("model"),
"prompt": obj.get("prompt"),
"system": obj.get("system")
})
return _obj
+100
View File
@@ -0,0 +1,100 @@
# 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 AiDecideIn(BaseModel):
"""
AiDecideIn
""" # noqa: E501
handle: Optional[StrictStr] = Field(default=None, description="Handle decides over a state this org observed earlier, in place of State and Questions.")
model: Optional[StrictStr] = Field(default=None, description="Model is kai, Kai's versioned id kai-<12 hex>, or Jev by its vendor id (typesafe/jev-1.13, ~typesafe/jev-latest).")
observe: Optional[StrictStr] = Field(default=None, description="Observe holds the state under this id (1 to 128 of A-Z a-z 0-9 . _ -), so a later decision can name it as its Handle.")
questions: Optional[Dict[str, Any]] = Field(default=None, description="Questions are 1 to 100 named questions, each {\"type\": \"choice\"|\"noul\"|\"score\", \"instructions\"?, \"criteria\"?}; a choice names at least 2 labels and a score at least 1 level. Not sent with a Handle.")
state: Optional[Any] = None
__properties: ClassVar[List[str]] = ["handle", "model", "observe", "questions", "state"]
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 AiDecideIn 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,
)
# set to None if state (nullable) is None
# and model_fields_set contains the field
if self.state is None and "state" in self.model_fields_set:
_dict['state'] = None
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AiDecideIn from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"handle": obj.get("handle"),
"model": obj.get("model"),
"observe": obj.get("observe"),
"questions": obj.get("questions"),
"state": obj.get("state")
})
return _obj
+98
View File
@@ -0,0 +1,98 @@
# 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
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.ai_receipt import AiReceipt
from typing import Optional, Set
from typing_extensions import Self
class AiDecision(BaseModel):
"""
AiDecision
""" # noqa: E501
decision: Optional[Any] = None
receipt: Optional[AiReceipt] = Field(default=None, description="Receipt says which model served the decision and who paid for it.")
__properties: ClassVar[List[str]] = ["decision", "receipt"]
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 AiDecision 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,
)
# override the default output from pydantic by calling `to_dict()` of receipt
if self.receipt:
_dict['receipt'] = self.receipt.to_dict()
# set to None if decision (nullable) is None
# and model_fields_set contains the field
if self.decision is None and "decision" in self.model_fields_set:
_dict['decision'] = None
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AiDecision from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"decision": obj.get("decision"),
"receipt": AiReceipt.from_dict(obj["receipt"]) if obj.get("receipt") is not None else None
})
return _obj
+14 -11
View File
@@ -19,7 +19,6 @@ import json
from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.ai_decision_sides_false import AiDecisionSidesFalse
from typing import Optional, Set
from typing_extensions import Self
@@ -27,8 +26,8 @@ class AiDecisionSides(BaseModel):
"""
AiDecisionSides
""" # noqa: E501
var_false: Optional[AiDecisionSidesFalse] = Field(default=None, alias="false")
var_true: Optional[AiDecisionSidesFalse] = Field(default=None, alias="true")
var_false: Optional[Any] = Field(default=None, alias="false")
var_true: Optional[Any] = Field(default=None, alias="true")
__properties: ClassVar[List[str]] = ["false", "true"]
model_config = ConfigDict(
@@ -70,12 +69,16 @@ class AiDecisionSides(BaseModel):
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of var_false
if self.var_false:
_dict['false'] = self.var_false.to_dict()
# override the default output from pydantic by calling `to_dict()` of var_true
if self.var_true:
_dict['true'] = self.var_true.to_dict()
# set to None if var_false (nullable) is None
# and model_fields_set contains the field
if self.var_false is None and "var_false" in self.model_fields_set:
_dict['false'] = None
# set to None if var_true (nullable) is None
# and model_fields_set contains the field
if self.var_true is None and "var_true" in self.model_fields_set:
_dict['true'] = None
return _dict
@classmethod
@@ -88,8 +91,8 @@ class AiDecisionSides(BaseModel):
return cls.model_validate(obj)
_obj = cls.model_validate({
"false": AiDecisionSidesFalse.from_dict(obj["false"]) if obj.get("false") is not None else None,
"true": AiDecisionSidesFalse.from_dict(obj["true"]) if obj.get("true") is not None else None
"false": obj.get("false"),
"true": obj.get("true")
})
return _obj
@@ -1,171 +0,0 @@
# 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
from inspect import getfullargspec
import json
import pprint
import re # noqa: F401
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
from typing import Any, Dict, List, Optional
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
from typing_extensions import Literal, Self
from pydantic import BaseModel, Field, model_validator
AIDECISIONSIDESFALSE_ANY_OF_SCHEMAS = ["List[object]", "object", "str"]
class AiDecisionSidesFalse(BaseModel):
"""
AiDecisionSidesFalse
"""
# data type: str
anyof_schema_1_validator: Optional[StrictStr] = None
# data type: object
anyof_schema_2_validator: Optional[Dict[str, Any]] = None
# data type: List[object]
anyof_schema_3_validator: Optional[List[Any]] = None
if TYPE_CHECKING:
actual_instance: Optional[Union[List[object], object, str]] = None
else:
actual_instance: Any = None
any_of_schemas: Set[str] = { "List[object]", "object", "str" }
model_config = {
"validate_assignment": True,
"protected_namespaces": (),
}
def __init__(self, *args, **kwargs) -> None:
if args:
if len(args) > 1:
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
if kwargs:
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
super().__init__(actual_instance=args[0])
else:
super().__init__(**kwargs)
@model_validator(mode="before")
@classmethod
def from_wire(cls, data: Any) -> Any:
"""A raw value is read the way from_json reads it.
model_validate, and every model holding this one as a field, hands the
value over raw, and pydantic would otherwise take a dict for this
wrapper's own fields and leave actual_instance None. A variant instance
is taken as it is; __init__'s own call passes through.
"""
if isinstance(data, cls) or (isinstance(data, dict) and "actual_instance" in data):
return data
if data is None or isinstance(data, BaseModel):
return {"actual_instance": data}
return {"actual_instance": cls.from_json(json.dumps(data)).actual_instance}
@field_validator('actual_instance')
def actual_instance_must_validate_anyof(cls, v):
instance = AiDecisionSidesFalse.model_construct()
error_messages = []
# validate data type: str
try:
instance.anyof_schema_1_validator = v
return v
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# validate data type: object
try:
instance.anyof_schema_2_validator = v
return v
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# validate data type: List[object]
try:
instance.anyof_schema_3_validator = v
return v
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
if error_messages:
# no match
raise ValueError("No match found when setting the actual_instance in AiDecisionSidesFalse with anyOf schemas: List[object], object, str. Details: " + ", ".join(error_messages))
else:
return v
@classmethod
def from_dict(cls, obj: Dict[str, Any]) -> Self:
return cls.from_json(json.dumps(obj))
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Returns the object represented by the json string"""
instance = cls.model_construct()
error_messages = []
# deserialize data into str
try:
# validation
instance.anyof_schema_1_validator = json.loads(json_str)
# assign value to actual_instance
instance.actual_instance = instance.anyof_schema_1_validator
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into object
try:
# validation
instance.anyof_schema_2_validator = json.loads(json_str)
# assign value to actual_instance
instance.actual_instance = instance.anyof_schema_2_validator
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into List[object]
try:
# validation
instance.anyof_schema_3_validator = json.loads(json_str)
# assign value to actual_instance
instance.actual_instance = instance.anyof_schema_3_validator
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
if error_messages:
# no match
raise ValueError("No match found when deserializing the JSON string into AiDecisionSidesFalse with anyOf schemas: List[object], object, str. Details: " + ", ".join(error_messages))
else:
return instance
def to_json(self) -> str:
"""Returns the JSON representation of the actual instance"""
if self.actual_instance is None:
return "null"
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
return self.actual_instance.to_json()
else:
return json.dumps(self.actual_instance)
def to_dict(self) -> Optional[Union[Dict[str, Any], List[object], object, str]]:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
return self.actual_instance.to_dict()
else:
return self.actual_instance
def to_str(self) -> str:
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.model_dump())
@@ -19,7 +19,6 @@ import json
from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional, Union
from hanzoai.cloud.models.ai_decision_sides_false import AiDecisionSidesFalse
from hanzoai.cloud.models.ai_decisions_action import AiDecisionsAction
from typing import Optional, Set
from typing_extensions import Self
@@ -32,7 +31,7 @@ class AiDecisionsAnswer(BaseModel):
answer_confidence: Optional[Union[StrictFloat, StrictInt]] = None
choice: Optional[StrictStr] = None
confidence: Optional[Union[StrictFloat, StrictInt]] = None
legend: Optional[Dict[str, AiDecisionSidesFalse]] = None
legend: Optional[Dict[str, Any]] = None
noul: Optional[Union[StrictFloat, StrictInt]] = None
probabilities: Optional[Dict[str, Union[StrictFloat, StrictInt]]] = None
score: Optional[Union[StrictFloat, StrictInt]] = None
@@ -88,13 +87,6 @@ class AiDecisionsAnswer(BaseModel):
# override the default output from pydantic by calling `to_dict()` of action
if self.action:
_dict['action'] = self.action.to_dict()
# override the default output from pydantic by calling `to_dict()` of each value in legend (dict)
_field_dict = {}
if self.legend:
for _key_legend in self.legend:
if self.legend[_key_legend]:
_field_dict[_key_legend] = self.legend[_key_legend].to_dict()
_dict['legend'] = _field_dict
return _dict
@classmethod
@@ -111,12 +103,7 @@ class AiDecisionsAnswer(BaseModel):
"answer_confidence": obj.get("answer_confidence"),
"choice": obj.get("choice"),
"confidence": obj.get("confidence"),
"legend": dict(
(_k, AiDecisionSidesFalse.from_dict(_v))
for _k, _v in obj["legend"].items()
)
if obj.get("legend") is not None
else None,
"legend": obj.get("legend"),
"noul": obj.get("noul"),
"probabilities": obj.get("probabilities"),
"score": obj.get("score"),
+14 -21
View File
@@ -19,8 +19,6 @@ import json
from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.ai_decision_sides_false import AiDecisionSidesFalse
from hanzoai.cloud.models.ai_decisions_choice_criteria_value import AiDecisionsChoiceCriteriaValue
from typing import Optional, Set
from typing_extensions import Self
@@ -28,8 +26,8 @@ class AiDecisionsChoice(BaseModel):
"""
AiDecisionsChoice
""" # noqa: E501
criteria: Dict[str, Optional[AiDecisionsChoiceCriteriaValue]]
instructions: Optional[AiDecisionSidesFalse] = None
criteria: Optional[Any]
instructions: Optional[Any] = None
type: StrictStr
__properties: ClassVar[List[str]] = ["criteria", "instructions", "type"]
@@ -79,16 +77,16 @@ class AiDecisionsChoice(BaseModel):
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each value in criteria (dict)
_field_dict = {}
if self.criteria:
for _key_criteria in self.criteria:
if self.criteria[_key_criteria]:
_field_dict[_key_criteria] = self.criteria[_key_criteria].to_dict()
_dict['criteria'] = _field_dict
# override the default output from pydantic by calling `to_dict()` of instructions
if self.instructions:
_dict['instructions'] = self.instructions.to_dict()
# set to None if criteria (nullable) is None
# and model_fields_set contains the field
if self.criteria is None and "criteria" in self.model_fields_set:
_dict['criteria'] = None
# set to None if instructions (nullable) is None
# and model_fields_set contains the field
if self.instructions is None and "instructions" in self.model_fields_set:
_dict['instructions'] = None
return _dict
@classmethod
@@ -101,13 +99,8 @@ class AiDecisionsChoice(BaseModel):
return cls.model_validate(obj)
_obj = cls.model_validate({
"criteria": dict(
(_k, AiDecisionsChoiceCriteriaValue.from_dict(_v))
for _k, _v in obj["criteria"].items()
)
if obj.get("criteria") is not None
else None,
"instructions": AiDecisionSidesFalse.from_dict(obj["instructions"]) if obj.get("instructions") is not None else None,
"criteria": obj.get("criteria"),
"instructions": obj.get("instructions"),
"type": obj.get("type")
})
return _obj
@@ -1,177 +0,0 @@
# 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
from inspect import getfullargspec
import json
import pprint
import re # noqa: F401
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
from typing import Any, Dict, List, Optional
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
from typing_extensions import Literal, Self
from pydantic import BaseModel, Field, model_validator
AIDECISIONSCHOICECRITERIAVALUE_ANY_OF_SCHEMAS = ["List[object]", "object", "str"]
class AiDecisionsChoiceCriteriaValue(BaseModel):
"""
AiDecisionsChoiceCriteriaValue
"""
# data type: str
anyof_schema_1_validator: Optional[StrictStr] = None
# data type: object
anyof_schema_2_validator: Optional[Dict[str, Any]] = None
# data type: List[object]
anyof_schema_3_validator: Optional[List[Any]] = None
if TYPE_CHECKING:
actual_instance: Optional[Union[List[object], object, str]] = None
else:
actual_instance: Any = None
any_of_schemas: Set[str] = { "List[object]", "object", "str" }
model_config = {
"validate_assignment": True,
"protected_namespaces": (),
}
def __init__(self, *args, **kwargs) -> None:
if args:
if len(args) > 1:
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
if kwargs:
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
super().__init__(actual_instance=args[0])
else:
super().__init__(**kwargs)
@model_validator(mode="before")
@classmethod
def from_wire(cls, data: Any) -> Any:
"""A raw value is read the way from_json reads it.
model_validate, and every model holding this one as a field, hands the
value over raw, and pydantic would otherwise take a dict for this
wrapper's own fields and leave actual_instance None. A variant instance
is taken as it is; __init__'s own call passes through.
"""
if isinstance(data, cls) or (isinstance(data, dict) and "actual_instance" in data):
return data
if data is None or isinstance(data, BaseModel):
return {"actual_instance": data}
return {"actual_instance": cls.from_json(json.dumps(data)).actual_instance}
@field_validator('actual_instance')
def actual_instance_must_validate_anyof(cls, v):
if v is None:
return v
instance = AiDecisionsChoiceCriteriaValue.model_construct()
error_messages = []
# validate data type: str
try:
instance.anyof_schema_1_validator = v
return v
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# validate data type: object
try:
instance.anyof_schema_2_validator = v
return v
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# validate data type: List[object]
try:
instance.anyof_schema_3_validator = v
return v
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
if error_messages:
# no match
raise ValueError("No match found when setting the actual_instance in AiDecisionsChoiceCriteriaValue with anyOf schemas: List[object], object, str. Details: " + ", ".join(error_messages))
else:
return v
@classmethod
def from_dict(cls, obj: Dict[str, Any]) -> Self:
return cls.from_json(json.dumps(obj))
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Returns the object represented by the json string"""
instance = cls.model_construct()
if json_str is None:
return instance
error_messages = []
# deserialize data into str
try:
# validation
instance.anyof_schema_1_validator = json.loads(json_str)
# assign value to actual_instance
instance.actual_instance = instance.anyof_schema_1_validator
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into object
try:
# validation
instance.anyof_schema_2_validator = json.loads(json_str)
# assign value to actual_instance
instance.actual_instance = instance.anyof_schema_2_validator
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into List[object]
try:
# validation
instance.anyof_schema_3_validator = json.loads(json_str)
# assign value to actual_instance
instance.actual_instance = instance.anyof_schema_3_validator
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
if error_messages:
# no match
raise ValueError("No match found when deserializing the JSON string into AiDecisionsChoiceCriteriaValue with anyOf schemas: List[object], object, str. Details: " + ", ".join(error_messages))
else:
return instance
def to_json(self) -> str:
"""Returns the JSON representation of the actual instance"""
if self.actual_instance is None:
return "null"
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
return self.actual_instance.to_json()
else:
return json.dumps(self.actual_instance)
def to_dict(self) -> Optional[Union[Dict[str, Any], List[object], object, str]]:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
return self.actual_instance.to_dict()
else:
return self.actual_instance
def to_str(self) -> str:
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.model_dump())
@@ -20,7 +20,6 @@ import json
from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.ai_decision_sides import AiDecisionSides
from hanzoai.cloud.models.ai_decision_sides_false import AiDecisionSidesFalse
from typing import Optional, Set
from typing_extensions import Self
@@ -29,7 +28,7 @@ class AiDecisionsNoul(BaseModel):
AiDecisionsNoul
""" # noqa: E501
criteria: Optional[AiDecisionSides] = None
instructions: Optional[AiDecisionSidesFalse] = None
instructions: Optional[Any] = None
labels: Optional[Dict[str, StrictStr]] = None
type: StrictStr
__properties: ClassVar[List[str]] = ["criteria", "instructions", "labels", "type"]
@@ -83,9 +82,11 @@ class AiDecisionsNoul(BaseModel):
# override the default output from pydantic by calling `to_dict()` of criteria
if self.criteria:
_dict['criteria'] = self.criteria.to_dict()
# override the default output from pydantic by calling `to_dict()` of instructions
if self.instructions:
_dict['instructions'] = self.instructions.to_dict()
# set to None if instructions (nullable) is None
# and model_fields_set contains the field
if self.instructions is None and "instructions" in self.model_fields_set:
_dict['instructions'] = None
return _dict
@classmethod
@@ -99,7 +100,7 @@ class AiDecisionsNoul(BaseModel):
_obj = cls.model_validate({
"criteria": AiDecisionSides.from_dict(obj["criteria"]) if obj.get("criteria") is not None else None,
"instructions": AiDecisionSidesFalse.from_dict(obj["instructions"]) if obj.get("instructions") is not None else None,
"instructions": obj.get("instructions"),
"labels": obj.get("labels"),
"type": obj.get("type")
})
@@ -19,7 +19,6 @@ import json
from pydantic import BaseModel, ConfigDict, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.ai_decision_sides_false import AiDecisionSidesFalse
from hanzoai.cloud.models.ai_decisions_question import AiDecisionsQuestion
from typing import Optional, Set
from typing_extensions import Self
@@ -34,7 +33,7 @@ class AiDecisionsRequest(BaseModel):
provider: Optional[Any] = None
questions: Optional[Dict[str, AiDecisionsQuestion]] = None
session_id: Optional[StrictStr] = None
state: Optional[AiDecisionSidesFalse] = None
state: Optional[Any] = None
trace: Optional[Any] = None
user: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["handle", "model", "observe", "provider", "questions", "session_id", "state", "trace", "user"]
@@ -85,14 +84,16 @@ class AiDecisionsRequest(BaseModel):
if self.questions[_key_questions]:
_field_dict[_key_questions] = self.questions[_key_questions].to_dict()
_dict['questions'] = _field_dict
# override the default output from pydantic by calling `to_dict()` of state
if self.state:
_dict['state'] = self.state.to_dict()
# set to None if provider (nullable) is None
# and model_fields_set contains the field
if self.provider is None and "provider" in self.model_fields_set:
_dict['provider'] = None
# set to None if state (nullable) is None
# and model_fields_set contains the field
if self.state is None and "state" in self.model_fields_set:
_dict['state'] = None
# set to None if trace (nullable) is None
# and model_fields_set contains the field
if self.trace is None and "trace" in self.model_fields_set:
@@ -121,7 +122,7 @@ class AiDecisionsRequest(BaseModel):
if obj.get("questions") is not None
else None,
"session_id": obj.get("session_id"),
"state": AiDecisionSidesFalse.from_dict(obj["state"]) if obj.get("state") is not None else None,
"state": obj.get("state"),
"trace": obj.get("trace"),
"user": obj.get("user")
})
+9 -15
View File
@@ -20,7 +20,6 @@ import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from hanzoai.cloud.models.ai_decision_sides_false import AiDecisionSidesFalse
from typing import Optional, Set
from typing_extensions import Self
@@ -28,8 +27,8 @@ class AiDecisionsScore(BaseModel):
"""
AiDecisionsScore
""" # noqa: E501
criteria: Annotated[List[AiDecisionSidesFalse], Field(min_length=1)]
instructions: Optional[AiDecisionSidesFalse] = None
criteria: Annotated[List[Any], Field(min_length=1)]
instructions: Optional[Any] = None
type: StrictStr
__properties: ClassVar[List[str]] = ["criteria", "instructions", "type"]
@@ -79,16 +78,11 @@ class AiDecisionsScore(BaseModel):
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in criteria (list)
_items = []
if self.criteria:
for _item_criteria in self.criteria:
if _item_criteria:
_items.append(_item_criteria.to_dict())
_dict['criteria'] = _items
# override the default output from pydantic by calling `to_dict()` of instructions
if self.instructions:
_dict['instructions'] = self.instructions.to_dict()
# set to None if instructions (nullable) is None
# and model_fields_set contains the field
if self.instructions is None and "instructions" in self.model_fields_set:
_dict['instructions'] = None
return _dict
@classmethod
@@ -101,8 +95,8 @@ class AiDecisionsScore(BaseModel):
return cls.model_validate(obj)
_obj = cls.model_validate({
"criteria": [AiDecisionSidesFalse.from_dict(_item) for _item in obj["criteria"]] if obj.get("criteria") is not None else None,
"instructions": AiDecisionSidesFalse.from_dict(obj["instructions"]) if obj.get("instructions") is not None else None,
"criteria": obj.get("criteria"),
"instructions": obj.get("instructions"),
"type": obj.get("type")
})
return _obj
+107
View File
@@ -0,0 +1,107 @@
# 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 hanzoai.cloud.models.ai_price import AiPrice
from typing import Optional, Set
from typing_extensions import Self
class AiModel(BaseModel):
"""
AiModel
""" # noqa: E501
capabilities: Optional[List[StrictStr]] = Field(default=None, description="Capabilities are tools, vision and reasoning, those the model supports.")
var_class: Optional[StrictStr] = Field(default=None, description="Class is premium, ours or free.", alias="class")
context_window: Optional[StrictInt] = Field(default=None, description="ContextWindow is the most tokens the model reads at once, absent when the catalog does not say.")
family: Optional[StrictStr] = Field(default=None, description="Family is the Hanzo family (enso, zen, kai, zoo), absent for a third-party model.")
id: Optional[StrictStr] = Field(default=None, description="ID is the model's id, the one a completion or a decision names.")
inputs: Optional[List[StrictStr]] = Field(default=None, description="Inputs are the modalities the model reads.")
name: Optional[StrictStr] = Field(default=None, description="Name is the model's display name.")
outputs: Optional[List[StrictStr]] = Field(default=None, description="Outputs are the modalities the model writes.")
pricing: Optional[AiPrice] = Field(default=None, description="Pricing is the model's list price.")
__properties: ClassVar[List[str]] = ["capabilities", "class", "context_window", "family", "id", "inputs", "name", "outputs", "pricing"]
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 AiModel 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,
)
# override the default output from pydantic by calling `to_dict()` of pricing
if self.pricing:
_dict['pricing'] = self.pricing.to_dict()
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AiModel from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"capabilities": obj.get("capabilities"),
"class": obj.get("class"),
"context_window": obj.get("context_window"),
"family": obj.get("family"),
"id": obj.get("id"),
"inputs": obj.get("inputs"),
"name": obj.get("name"),
"outputs": obj.get("outputs"),
"pricing": AiPrice.from_dict(obj["pricing"]) if obj.get("pricing") is not None else None
})
return _obj
+97
View File
@@ -0,0 +1,97 @@
# 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
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.ai_model import AiModel
from typing import Optional, Set
from typing_extensions import Self
class AiModels(BaseModel):
"""
AiModels
""" # noqa: E501
models: Optional[List[AiModel]] = Field(default=None, description="Models are the matches, in the catalog's order.")
total: Optional[StrictInt] = Field(default=None, description="Total is how many models matched, before Limit.")
__properties: ClassVar[List[str]] = ["models", "total"]
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 AiModels 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,
)
# override the default output from pydantic by calling `to_dict()` of each item in models (list)
_items = []
if self.models:
for _item_models in self.models:
if _item_models:
_items.append(_item_models.to_dict())
_dict['models'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of AiModels from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"models": [AiModel.from_dict(_item) for _item in obj["models"]] if obj.get("models") is not None else None,
"total": obj.get("total")
})
return _obj
+95
View File
@@ -0,0 +1,95 @@
# 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, StrictBool, StrictFloat, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing import Optional, Set
from typing_extensions import Self
class AiPrice(BaseModel):
"""
AiPrice
""" # noqa: E501
completion: Optional[StrictStr] = Field(default=None, description="Completion is the price of one output token, a decimal string.")
input_per_million: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="InputPerMillion is the price of a million input tokens.")
output_per_million: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="OutputPerMillion is the price of a million output tokens.")
prompt: Optional[StrictStr] = Field(default=None, description="Prompt is the price of one input token, a decimal string.")
variable: Optional[StrictBool] = Field(default=None, description="Variable is true for a router that bills each answer at the price of the model that gave it; the figures above are then that router's ceiling.")
__properties: ClassVar[List[str]] = ["completion", "input_per_million", "output_per_million", "prompt", "variable"]
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 AiPrice 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 AiPrice from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"completion": obj.get("completion"),
"input_per_million": obj.get("input_per_million"),
"output_per_million": obj.get("output_per_million"),
"prompt": obj.get("prompt"),
"variable": obj.get("variable")
})
return _obj
+99
View File
@@ -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, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class AiReceipt(BaseModel):
"""
AiReceipt
""" # noqa: E501
var_class: Optional[StrictStr] = Field(default=None, description="Class is the model's class as billed: premium, ours or free (X-Hanzo-Usage-Class).", alias="class")
fallback: Optional[StrictStr] = Field(default=None, description="Fallback is the model that answered in place of the one asked, in limited mode (X-Hanzo-Fallback).")
paid_by: Optional[StrictStr] = Field(default=None, description="PaidBy is plan, credits or free (X-Hanzo-Paid-By); absent when the answer named no payer, as a free model's does.")
reason: Optional[StrictStr] = Field(default=None, description="Reason is the refusal code that sent the request to the fallback (X-Hanzo-Usage-Reason).")
routed: Optional[StrictStr] = Field(default=None, description="Routed is the model `auto` resolved to (X-Routed-Model).")
served: Optional[StrictStr] = Field(default=None, description="Served is the model that answered (X-Hanzo-Served).")
usage: Optional[StrictStr] = Field(default=None, description="Usage is where that class stands for the payer: ok, near or limited (X-Hanzo-Usage).")
__properties: ClassVar[List[str]] = ["class", "fallback", "paid_by", "reason", "routed", "served", "usage"]
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 AiReceipt 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 AiReceipt from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"class": obj.get("class"),
"fallback": obj.get("fallback"),
"paid_by": obj.get("paid_by"),
"reason": obj.get("reason"),
"routed": obj.get("routed"),
"served": obj.get("served"),
"usage": obj.get("usage")
})
return _obj
@@ -0,0 +1,103 @@
# 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, StrictFloat, StrictInt, StrictStr, field_validator
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing import Optional, Set
from typing_extensions import Self
class AiRoutingRewardRequest(BaseModel):
"""
AiRoutingRewardRequest
""" # noqa: E501
rating: Optional[Union[StrictFloat, StrictInt]] = None
request_id: StrictStr
reward: Optional[Union[StrictFloat, StrictInt]] = None
signal: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["rating", "request_id", "reward", "signal"]
@field_validator('signal')
def signal_validate_enum(cls, value):
"""Validates the enum"""
if value is None:
return value
if value not in set(['up', 'accept', 'regenerate', 'down', 'switch', 'abandon', 'revert', 'rating', 'dismiss']):
raise ValueError("must be one of enum values ('up', 'accept', 'regenerate', 'down', 'switch', 'abandon', 'revert', 'rating', 'dismiss')")
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 AiRoutingRewardRequest 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 AiRoutingRewardRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"rating": obj.get("rating"),
"request_id": obj.get("request_id"),
"reward": obj.get("reward"),
"signal": obj.get("signal")
})
return _obj
+3 -1
View File
@@ -39,10 +39,11 @@ class AutoAutomation(BaseModel):
next: Optional[StrictStr] = Field(default=None, description="Next is when it runs next, RFC 3339 UTC; null when manual or disabled.")
notify: Optional[StrictBool] = Field(default=None, description="Notify sends a one-line summary to the automation's person when a run ends.")
permissions: Optional[StrictStr] = Field(default=None, description="Permissions is auto (works and uses connectors without stopping) or ask (changes nothing and ends with the actions it proposes; agent.go agentTask).")
post_to: Optional[List[StrictStr]] = Field(default=None, description="PostTo are the connected accounts each run's answer is posted to — x, linkedin, facebook — after review when Permissions is ask (post.go). Never null.", alias="postTo")
project: Optional[StrictStr] = Field(default=None, description="Project is the Dev project the run works in, by its slug; null for none.")
schedule: Optional[AutoSchedule] = Field(default=None, description="Schedule is when it runs.")
updated: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["created", "draft", "enabled", "id", "instructions", "last", "model", "name", "next", "notify", "permissions", "project", "schedule", "updated"]
__properties: ClassVar[List[str]] = ["created", "draft", "enabled", "id", "instructions", "last", "model", "name", "next", "notify", "permissions", "postTo", "project", "schedule", "updated"]
model_config = ConfigDict(
populate_by_name=True,
@@ -112,6 +113,7 @@ class AutoAutomation(BaseModel):
"next": obj.get("next"),
"notify": obj.get("notify"),
"permissions": obj.get("permissions"),
"postTo": obj.get("postTo"),
"project": obj.get("project"),
"schedule": AutoSchedule.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None,
"updated": obj.get("updated")
@@ -33,9 +33,10 @@ class AutoAutomationIn(BaseModel):
name: Optional[StrictStr] = Field(default=None, description="Name is what it is called. Required.")
notify: Optional[StrictBool] = Field(default=None, description="Notify sends a one-line summary when a run ends.")
permissions: Optional[StrictStr] = Field(default=None, description="Permissions is auto (works without stopping) or ask (proposes, changes nothing). Absent is ask.")
post_to: Optional[List[StrictStr]] = Field(default=None, description="PostTo are the connected accounts each run's answer is posted to: x, linkedin, facebook. Absent posts nothing.", alias="postTo")
project: Optional[StrictStr] = Field(default=None, description="Project is a Dev project's slug to work in. Optional.")
schedule: Optional[AutoSchedule] = Field(default=None, description="Schedule is when it runs. Absent runs it only on demand.")
__properties: ClassVar[List[str]] = ["enabled", "instructions", "model", "name", "notify", "permissions", "project", "schedule"]
__properties: ClassVar[List[str]] = ["enabled", "instructions", "model", "name", "notify", "permissions", "postTo", "project", "schedule"]
model_config = ConfigDict(
populate_by_name=True,
@@ -97,6 +98,7 @@ class AutoAutomationIn(BaseModel):
"name": obj.get("name"),
"notify": obj.get("notify"),
"permissions": obj.get("permissions"),
"postTo": obj.get("postTo"),
"project": obj.get("project"),
"schedule": AutoSchedule.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None
})
@@ -34,9 +34,10 @@ class AutoAutomationPatch(BaseModel):
name: Optional[StrictStr] = None
notify: Optional[StrictBool] = None
permissions: Optional[StrictStr] = None
post_to: Optional[List[StrictStr]] = Field(default=None, alias="postTo")
project: Optional[StrictStr] = None
schedule: Optional[AutoSchedule] = None
__properties: ClassVar[List[str]] = ["enabled", "id", "instructions", "model", "name", "notify", "permissions", "project", "schedule"]
__properties: ClassVar[List[str]] = ["enabled", "id", "instructions", "model", "name", "notify", "permissions", "postTo", "project", "schedule"]
model_config = ConfigDict(
populate_by_name=True,
@@ -99,6 +100,7 @@ class AutoAutomationPatch(BaseModel):
"name": obj.get("name"),
"notify": obj.get("notify"),
"permissions": obj.get("permissions"),
"postTo": obj.get("postTo"),
"project": obj.get("project"),
"schedule": AutoSchedule.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None
})
@@ -19,6 +19,7 @@ import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.auto_post_result import AutoPostResult
from typing import Optional, Set
from typing_extensions import Self
@@ -27,12 +28,14 @@ class AutoAutomationRun(BaseModel):
AutoAutomationRun
""" # noqa: E501
at: Optional[StrictStr] = Field(default=None, description="At is when it started and Finished when it ended (null while it runs), RFC 3339 UTC.")
draft: Optional[StrictStr] = Field(default=None, description="Draft is the post the agent wrote, for an automation that posts; empty otherwise.")
finished: Optional[StrictStr] = None
id: Optional[StrictStr] = None
status: Optional[StrictStr] = Field(default=None, description="Status is succeeded, failed, running, queued, skipped for a start that found the previous run still going, or refused for a run whose person is no longer a member of the org.")
posts: Optional[List[AutoPostResult]] = Field(default=None, description="Posts are where it went: one per account, its link or the platform's reason it did not go. Never null.")
status: Optional[StrictStr] = Field(default=None, description="Status is succeeded, failed, running, queued, review for a post waiting for its person to post or discard it, skipped for a start that found the previous run still going, or refused for a run whose person is no longer a member of the org.")
summary: Optional[StrictStr] = Field(default=None, description="Summary is one line on how it went.")
transcript: Optional[StrictStr] = Field(default=None, description="Transcript opens the run's Dev run; null when it started none.")
__properties: ClassVar[List[str]] = ["at", "finished", "id", "status", "summary", "transcript"]
__properties: ClassVar[List[str]] = ["at", "draft", "finished", "id", "posts", "status", "summary", "transcript"]
model_config = ConfigDict(
populate_by_name=True,
@@ -73,6 +76,13 @@ class AutoAutomationRun(BaseModel):
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in posts (list)
_items = []
if self.posts:
for _item_posts in self.posts:
if _item_posts:
_items.append(_item_posts.to_dict())
_dict['posts'] = _items
return _dict
@classmethod
@@ -86,8 +96,10 @@ class AutoAutomationRun(BaseModel):
_obj = cls.model_validate({
"at": obj.get("at"),
"draft": obj.get("draft"),
"finished": obj.get("finished"),
"id": obj.get("id"),
"posts": [AutoPostResult.from_dict(_item) for _item in obj["posts"]] if obj.get("posts") is not None else None,
"status": obj.get("status"),
"summary": obj.get("summary"),
"transcript": obj.get("transcript")
@@ -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 AutoPostResult(BaseModel):
"""
AutoPostResult
""" # noqa: E501
error: Optional[StrictStr] = Field(default=None, description="Error is the platform's reason it did not go; absent when it did.")
to: Optional[StrictStr] = Field(default=None, description="To is the account's platform: x, linkedin or facebook.")
url: Optional[StrictStr] = Field(default=None, description="URL opens the post; absent when it did not go.")
__properties: ClassVar[List[str]] = ["error", "to", "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 AutoPostResult 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 AutoPostResult from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"error": obj.get("error"),
"to": obj.get("to"),
"url": obj.get("url")
})
return _obj
@@ -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, StrictBool, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class AutoReviewIn(BaseModel):
"""
AutoReviewIn
""" # noqa: E501
id: Optional[StrictStr] = Field(default=None, description="ID is the automation, and Run its run in review, from the path.")
post: Optional[StrictBool] = Field(default=None, description="Post posts it when true and discards it when false.")
run: Optional[StrictStr] = None
__properties: ClassVar[List[str]] = ["id", "post", "run"]
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 AutoReviewIn 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 AutoReviewIn from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"id": obj.get("id"),
"post": obj.get("post"),
"run": obj.get("run")
})
return _obj
@@ -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, StrictBool, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class GitWorkspaceView(BaseModel):
"""
GitWorkspaceView
""" # noqa: E501
login: Optional[StrictStr] = Field(default=None, description="Login is the caller's forge account in a made workspace.")
made: Optional[StrictBool] = Field(default=None, description="Made says the platform made it for the org; false is the estate's.")
owner: Optional[StrictStr] = Field(default=None, description="Owner is the forge namespace.")
__properties: ClassVar[List[str]] = ["login", "made", "owner"]
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 GitWorkspaceView 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 GitWorkspaceView from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"login": obj.get("login"),
"made": obj.get("made"),
"owner": obj.get("owner")
})
return _obj
+1 -1
View File
@@ -157,7 +157,7 @@ class IamUser(BaseModel):
microsoftonline: Optional[StrictStr] = None
multi_factor_auths: Optional[List[IamMfaProps]] = Field(default=None, alias="multiFactorAuths")
name: Optional[StrictStr] = None
name_key: Optional[StrictStr] = Field(default=None, alias="nameKey")
name_key: Optional[StrictStr] = Field(default=None, description="NameKey is Fold(Name), derived on every save (BeforeCreate, BeforeUpdate) and on every open for a row saved without it (store.Prepare): the indexed key a case-insensitive username lookup reads (store.GetUserByName). It is always written, empty or not, so a row that has been keyed is never mistaken for one that has not.", alias="nameKey")
naver: Optional[StrictStr] = None
need_update_password: Optional[StrictBool] = Field(default=None, alias="needUpdatePassword")
nextcloud: Optional[StrictStr] = None
@@ -26,9 +26,10 @@ class ProviderGithubImportOut(BaseModel):
"""
ProviderGithubImportOut
""" # noqa: E501
codebases: Optional[List[StrictStr]] = Field(default=None, description="Codebases are the names they take in the org's code workspace, in the same order: poll GET /v1/git/repos for each to appear.")
queued: Optional[StrictInt] = Field(default=None, description="Queued is how many repositories were handed to the background importer.")
repos: Optional[List[StrictStr]] = Field(default=None, description="Repos names those repositories, in the installation's listing order.")
__properties: ClassVar[List[str]] = ["queued", "repos"]
__properties: ClassVar[List[str]] = ["codebases", "queued", "repos"]
model_config = ConfigDict(
populate_by_name=True,
@@ -81,6 +82,7 @@ class ProviderGithubImportOut(BaseModel):
return cls.model_validate(obj)
_obj = cls.model_validate({
"codebases": obj.get("codebases"),
"queued": obj.get("queued"),
"repos": obj.get("repos")
})
@@ -26,6 +26,7 @@ class ProviderGithubRepoItem(BaseModel):
"""
ProviderGithubRepoItem
""" # noqa: E501
codebase: Optional[StrictStr] = Field(default=None, description="Codebase is the name it has in the org's code workspace once brought in (POST /v1/provider/github/repos/import): listed by GET /v1/git/repos when it is there.")
default_branch: Optional[StrictStr] = Field(default=None, description="DefaultBranch is the branch GitHub opens it on.")
full_name: Optional[StrictStr] = Field(default=None, description="FullName is owner/name, the address a coding run, a branch listing and a deploy take.")
installation_id: Optional[StrictInt] = Field(default=None, description="InstallationID is the installation of the Hanzo Platform App that reaches it — the grant a run on it is minted from.")
@@ -33,7 +34,7 @@ class ProviderGithubRepoItem(BaseModel):
owner: Optional[StrictStr] = Field(default=None, description="Owner is the GitHub account that holds it.")
private: Optional[StrictBool] = Field(default=None, description="Private is GitHub's visibility bit.")
pushed_at: Optional[StrictStr] = Field(default=None, description="PushedAt is when anything was last pushed to it, RFC 3339 UTC. Absent for a repository nothing was ever pushed to.")
__properties: ClassVar[List[str]] = ["default_branch", "full_name", "installation_id", "name", "owner", "private", "pushed_at"]
__properties: ClassVar[List[str]] = ["codebase", "default_branch", "full_name", "installation_id", "name", "owner", "private", "pushed_at"]
model_config = ConfigDict(
populate_by_name=True,
@@ -86,6 +87,7 @@ class ProviderGithubRepoItem(BaseModel):
return cls.model_validate(obj)
_obj = cls.model_validate({
"codebase": obj.get("codebase"),
"default_branch": obj.get("default_branch"),
"full_name": obj.get("full_name"),
"installation_id": obj.get("installation_id"),
+93
View File
@@ -0,0 +1,93 @@
# 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 TaskComment(BaseModel):
"""
TaskComment
""" # noqa: E501
author: Optional[StrictStr] = Field(default=None, description="Author is who wrote it: their name, else their forge login.")
body: Optional[StrictStr] = Field(default=None, description="Body is what was written, as markdown.")
created_at: Optional[StrictStr] = Field(default=None, description="CreatedAt is when it was written, RFC 3339.", alias="createdAt")
id: Optional[StrictInt] = Field(default=None, description="ID is the forge's id for the comment.")
__properties: ClassVar[List[str]] = ["author", "body", "createdAt", "id"]
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 TaskComment 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 TaskComment from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"author": obj.get("author"),
"body": obj.get("body"),
"createdAt": obj.get("createdAt"),
"id": obj.get("id")
})
return _obj
@@ -0,0 +1,97 @@
# 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 hanzoai.cloud.models.task_comment import TaskComment
from typing import Optional, Set
from typing_extensions import Self
class TaskCommentList(BaseModel):
"""
TaskCommentList
""" # noqa: E501
data: Optional[List[TaskComment]] = Field(default=None, description="Data is the conversation. Empty is an empty array, never null.")
home: Optional[StrictStr] = Field(default=None, description="Home is the GitHub repository (owner/name) the issue lives on when its board mirrors one; its conversation is read there, and Data is then empty.")
__properties: ClassVar[List[str]] = ["data", "home"]
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 TaskCommentList 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,
)
# override the default output from pydantic by calling `to_dict()` of each item in data (list)
_items = []
if self.data:
for _item_data in self.data:
if _item_data:
_items.append(_item_data.to_dict())
_dict['data'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of TaskCommentList from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"data": [TaskComment.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None,
"home": obj.get("home")
})
return _obj