mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
fix(client): regenerate 8.5.623 with the current python driver
This commit is contained in:
@@ -184,9 +184,14 @@ class ApiClient:
|
||||
header_params['Cookie'] = self.cookie
|
||||
if header_params:
|
||||
header_params = self.sanitize_for_serialization(header_params)
|
||||
header_params = dict(
|
||||
self.parameters_to_tuples(header_params,collection_formats)
|
||||
)
|
||||
# A header carries text. The document types X-Max-Cost as a number and
|
||||
# urllib3 refuses a float header value outright, so every value is
|
||||
# written the way the wire spells it: str() for a number, lower case
|
||||
# for a boolean.
|
||||
header_params = {
|
||||
k: v if isinstance(v, str) else str(v).lower() if isinstance(v, bool) else str(v)
|
||||
for k, v in self.parameters_to_tuples(header_params, collection_formats)
|
||||
}
|
||||
|
||||
# path parameters
|
||||
if path_params:
|
||||
|
||||
@@ -21,7 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, f
|
||||
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 Field
|
||||
from pydantic import BaseModel, Field, model_validator
|
||||
|
||||
AIDECISIONSIDESFALSE_ANY_OF_SCHEMAS = ["List[object]", "object", "str"]
|
||||
|
||||
@@ -57,6 +57,22 @@ class AiDecisionSidesFalse(BaseModel):
|
||||
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()
|
||||
|
||||
@@ -21,7 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, f
|
||||
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 Field
|
||||
from pydantic import BaseModel, Field, model_validator
|
||||
|
||||
AIDECISIONSCHOICECRITERIAVALUE_ANY_OF_SCHEMAS = ["List[object]", "object", "str"]
|
||||
|
||||
@@ -57,6 +57,22 @@ class AiDecisionsChoiceCriteriaValue(BaseModel):
|
||||
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:
|
||||
|
||||
@@ -20,8 +20,8 @@ from typing import Any, List, Optional
|
||||
from hanzoai.cloud.models.ai_decisions_choice import AiDecisionsChoice
|
||||
from hanzoai.cloud.models.ai_decisions_noul import AiDecisionsNoul
|
||||
from hanzoai.cloud.models.ai_decisions_score import AiDecisionsScore
|
||||
from pydantic import StrictStr, Field
|
||||
from typing import Union, List, Set, Optional, Dict
|
||||
from pydantic import BaseModel, StrictStr, Field, model_validator
|
||||
from typing import Any, Union, List, Set, Optional, Dict
|
||||
from typing_extensions import Literal, Self
|
||||
|
||||
AIDECISIONSQUESTION_ONE_OF_SCHEMAS = ["AiDecisionsChoice", "AiDecisionsNoul", "AiDecisionsScore"]
|
||||
@@ -58,6 +58,22 @@ class AiDecisionsQuestion(BaseModel):
|
||||
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_oneof(cls, v):
|
||||
instance = AiDecisionsQuestion.model_construct()
|
||||
|
||||
@@ -21,7 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, Validat
|
||||
from typing import Optional
|
||||
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
||||
from typing_extensions import Literal, Self
|
||||
from pydantic import Field
|
||||
from pydantic import BaseModel, Field, model_validator
|
||||
|
||||
AIDECISIONSREASONCODE_ANY_OF_SCHEMAS = ["int", "str"]
|
||||
|
||||
@@ -55,6 +55,22 @@ class AiDecisionsReasonCode(BaseModel):
|
||||
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 = AiDecisionsReasonCode.model_construct()
|
||||
|
||||
@@ -20,8 +20,8 @@ from typing import Any, List, Optional
|
||||
from hanzoai.cloud.models.capture_batch import CaptureBatch
|
||||
from hanzoai.cloud.models.capture_event import CaptureEvent
|
||||
from hanzoai.cloud.models.insights_body import InsightsBody
|
||||
from pydantic import StrictStr, Field
|
||||
from typing import Union, List, Set, Optional, Dict
|
||||
from pydantic import BaseModel, StrictStr, Field, model_validator
|
||||
from typing import Any, Union, List, Set, Optional, Dict
|
||||
from typing_extensions import Literal, Self
|
||||
|
||||
POSTEVENTREQUEST_ONE_OF_SCHEMAS = ["CaptureBatch", "CaptureEvent", "InsightsBody", "List[CaptureEvent]"]
|
||||
@@ -57,6 +57,22 @@ class PostEventRequest(BaseModel):
|
||||
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_oneof(cls, v):
|
||||
instance = PostEventRequest.model_construct()
|
||||
|
||||
@@ -28,7 +28,7 @@ class ProjectProjectsComplete(BaseModel):
|
||||
""" # noqa: E501
|
||||
bytes: Optional[StrictInt] = Field(default=None, description="Bytes is their total size in bytes.")
|
||||
commit: Optional[StrictStr] = Field(default=None, description="Commit is the revision that was built, recorded on the deployment.")
|
||||
copy: Optional[List[StrictStr]] = Field(default=None, description="Copy lists the keys to take from CopyFrom's prefix, relative to it. They are also named in Keys, which stays the whole release.")
|
||||
copy_: Optional[List[StrictStr]] = Field(default=None, description="Copy lists the keys to take from CopyFrom's prefix, relative to it. They are also named in Keys, which stays the whole release.", alias="copy")
|
||||
copy_from: Optional[StrictStr] = Field(default=None, description="CopyFrom names another site of the same org whose prefix already holds the bytes of Copy. A host that shares a build with another differs from it by a page or two, so CI uploads those and asks for the rest to be copied inside the object store instead of sent again over the runner's link.", alias="copyFrom")
|
||||
files: Optional[StrictInt] = Field(default=None, description="Files is how many objects CI published.")
|
||||
id: Optional[StrictStr] = Field(default=None, description="ID is the queued deployment to complete, from the path.")
|
||||
|
||||
@@ -26,7 +26,7 @@ class ProjectProjectsUploadGrant(BaseModel):
|
||||
"""
|
||||
ProjectProjectsUploadGrant
|
||||
""" # noqa: E501
|
||||
copy: Optional[StrictBool] = Field(default=None, description="Copy is true when the completion of this deployment accepts copyFrom and copy. A client that does not see it uploads every object itself, since a server that ignores those fields would leave the copied keys missing.")
|
||||
copy_: Optional[StrictBool] = Field(default=None, description="Copy is true when the completion of this deployment accepts copyFrom and copy. A client that does not see it uploads every object itself, since a server that ignores those fields would leave the copied keys missing.", alias="copy")
|
||||
expires_at: Optional[StrictInt] = Field(default=None, description="ExpiresAt is when the grant stops being accepted, as Unix seconds. It is short-lived by design and is handed out ONCE, on the response that queues the deployment — a later read of that deployment does not carry it, so a grant cannot be fetched again after the build it was minted for.", alias="expiresAt")
|
||||
fields: Optional[Dict[str, StrictStr]] = Field(default=None, description="Fields are form values every POST must carry VERBATIM, alongside `key` and `file`. The signature covers them, so altering any one of them — including widening the key to reach outside the prefix — invalidates the grant rather than extending it.")
|
||||
max_bytes: Optional[StrictInt] = Field(default=None, description="MaxBytes bounds ONE object, not the upload as a whole.", alias="maxBytes")
|
||||
|
||||
@@ -26,7 +26,7 @@ class ProjectsUploadGrant(BaseModel):
|
||||
"""
|
||||
ProjectsUploadGrant
|
||||
""" # noqa: E501
|
||||
copy: Optional[StrictBool] = None
|
||||
copy_: Optional[StrictBool] = Field(default=None, alias="copy")
|
||||
expires_at: Optional[StrictInt] = Field(default=None, alias="expiresAt")
|
||||
fields: Optional[Dict[str, StrictStr]] = None
|
||||
max_bytes: Optional[StrictInt] = Field(default=None, alias="maxBytes")
|
||||
|
||||
Reference in New Issue
Block a user