mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
regenerate from cloud 16e3b9cef1
This commit is contained in:
@@ -1895,7 +1895,6 @@ pkg/hanzoai/cloud/models/pool_scale.py
|
||||
pkg/hanzoai/cloud/models/populated_flow.py
|
||||
pkg/hanzoai/cloud/models/position.py
|
||||
pkg/hanzoai/cloud/models/post_event_request.py
|
||||
pkg/hanzoai/cloud/models/post_index_indexes_by_uid_documents_delete_batch_request.py
|
||||
pkg/hanzoai/cloud/models/post_list.py
|
||||
pkg/hanzoai/cloud/models/prefs_view.py
|
||||
pkg/hanzoai/cloud/models/preset.py
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
ref=03cd1b9b10dc0ab2676fa6bd46a86dc48b2fc687
|
||||
sha256=18dbece85fa5da0fd05a03c3e5a6942d911541ca4f6a5f10975814d0cc7a1e1b
|
||||
ref=16e3b9cef1064a7506020e45c4a588a27ae85491
|
||||
sha256=0fbaebd5c4ee343c87839c29b4c4e1430c6e5742a6a21989a6a62d917eee95d7
|
||||
repo=hanzo-inc/cloud
|
||||
path=openapi.yaml
|
||||
|
||||
@@ -1917,7 +1917,6 @@ __all__ = [
|
||||
"PopulatedFlow",
|
||||
"Position",
|
||||
"PostEventRequest",
|
||||
"PostIndexIndexesByUidDocumentsDeleteBatchRequest",
|
||||
"PostList",
|
||||
"PrefsView",
|
||||
"Preset",
|
||||
@@ -4381,7 +4380,6 @@ from hanzoai.cloud.models.pool_scale import PoolScale as PoolScale
|
||||
from hanzoai.cloud.models.populated_flow import PopulatedFlow as PopulatedFlow
|
||||
from hanzoai.cloud.models.position import Position as Position
|
||||
from hanzoai.cloud.models.post_event_request import PostEventRequest as PostEventRequest
|
||||
from hanzoai.cloud.models.post_index_indexes_by_uid_documents_delete_batch_request import PostIndexIndexesByUidDocumentsDeleteBatchRequest as PostIndexIndexesByUidDocumentsDeleteBatchRequest
|
||||
from hanzoai.cloud.models.post_list import PostList as PostList
|
||||
from hanzoai.cloud.models.prefs_view import PrefsView as PrefsView
|
||||
from hanzoai.cloud.models.preset import Preset as Preset
|
||||
|
||||
@@ -31,7 +31,6 @@ from hanzoai.cloud.models.index_stats import IndexStats
|
||||
from hanzoai.cloud.models.index_task import IndexTask
|
||||
from hanzoai.cloud.models.index_version import IndexVersion
|
||||
from hanzoai.cloud.models.index_view import IndexView
|
||||
from hanzoai.cloud.models.post_index_indexes_by_uid_documents_delete_batch_request import PostIndexIndexesByUidDocumentsDeleteBatchRequest
|
||||
|
||||
from hanzoai.cloud.api_client import ApiClient, RequestSerialized
|
||||
from hanzoai.cloud.api_response import ApiResponse
|
||||
@@ -3786,7 +3785,7 @@ class IndexApi:
|
||||
def post_index_indexes_by_uid_documents_delete_batch(
|
||||
self,
|
||||
uid: StrictStr,
|
||||
post_index_indexes_by_uid_documents_delete_batch_request: Optional[PostIndexIndexesByUidDocumentsDeleteBatchRequest] = None,
|
||||
request_body: Optional[List[Any]] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
@@ -3806,8 +3805,8 @@ class IndexApi:
|
||||
|
||||
:param uid: (required)
|
||||
:type uid: str
|
||||
:param post_index_indexes_by_uid_documents_delete_batch_request:
|
||||
:type post_index_indexes_by_uid_documents_delete_batch_request: PostIndexIndexesByUidDocumentsDeleteBatchRequest
|
||||
:param request_body:
|
||||
:type request_body: List[object]
|
||||
: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
|
||||
@@ -3832,7 +3831,7 @@ class IndexApi:
|
||||
|
||||
_param = self._post_index_indexes_by_uid_documents_delete_batch_serialize(
|
||||
uid=uid,
|
||||
post_index_indexes_by_uid_documents_delete_batch_request=post_index_indexes_by_uid_documents_delete_batch_request,
|
||||
request_body=request_body,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
@@ -3857,7 +3856,7 @@ class IndexApi:
|
||||
def post_index_indexes_by_uid_documents_delete_batch_with_http_info(
|
||||
self,
|
||||
uid: StrictStr,
|
||||
post_index_indexes_by_uid_documents_delete_batch_request: Optional[PostIndexIndexesByUidDocumentsDeleteBatchRequest] = None,
|
||||
request_body: Optional[List[Any]] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
@@ -3877,8 +3876,8 @@ class IndexApi:
|
||||
|
||||
:param uid: (required)
|
||||
:type uid: str
|
||||
:param post_index_indexes_by_uid_documents_delete_batch_request:
|
||||
:type post_index_indexes_by_uid_documents_delete_batch_request: PostIndexIndexesByUidDocumentsDeleteBatchRequest
|
||||
:param request_body:
|
||||
:type request_body: List[object]
|
||||
: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
|
||||
@@ -3903,7 +3902,7 @@ class IndexApi:
|
||||
|
||||
_param = self._post_index_indexes_by_uid_documents_delete_batch_serialize(
|
||||
uid=uid,
|
||||
post_index_indexes_by_uid_documents_delete_batch_request=post_index_indexes_by_uid_documents_delete_batch_request,
|
||||
request_body=request_body,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
@@ -3928,7 +3927,7 @@ class IndexApi:
|
||||
def post_index_indexes_by_uid_documents_delete_batch_without_preload_content(
|
||||
self,
|
||||
uid: StrictStr,
|
||||
post_index_indexes_by_uid_documents_delete_batch_request: Optional[PostIndexIndexesByUidDocumentsDeleteBatchRequest] = None,
|
||||
request_body: Optional[List[Any]] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
@@ -3948,8 +3947,8 @@ class IndexApi:
|
||||
|
||||
:param uid: (required)
|
||||
:type uid: str
|
||||
:param post_index_indexes_by_uid_documents_delete_batch_request:
|
||||
:type post_index_indexes_by_uid_documents_delete_batch_request: PostIndexIndexesByUidDocumentsDeleteBatchRequest
|
||||
:param request_body:
|
||||
:type request_body: List[object]
|
||||
: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
|
||||
@@ -3974,7 +3973,7 @@ class IndexApi:
|
||||
|
||||
_param = self._post_index_indexes_by_uid_documents_delete_batch_serialize(
|
||||
uid=uid,
|
||||
post_index_indexes_by_uid_documents_delete_batch_request=post_index_indexes_by_uid_documents_delete_batch_request,
|
||||
request_body=request_body,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
@@ -3994,7 +3993,7 @@ class IndexApi:
|
||||
def _post_index_indexes_by_uid_documents_delete_batch_serialize(
|
||||
self,
|
||||
uid,
|
||||
post_index_indexes_by_uid_documents_delete_batch_request,
|
||||
request_body,
|
||||
_request_auth,
|
||||
_content_type,
|
||||
_headers,
|
||||
@@ -4004,6 +4003,7 @@ class IndexApi:
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {
|
||||
'request_body': '',
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
@@ -4022,8 +4022,8 @@ class IndexApi:
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
# process the body parameter
|
||||
if post_index_indexes_by_uid_documents_delete_batch_request is not None:
|
||||
_body_params = post_index_indexes_by_uid_documents_delete_batch_request
|
||||
if request_body is not None:
|
||||
_body_params = request_body
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
|
||||
@@ -1786,7 +1786,6 @@ from hanzoai.cloud.models.pool_scale import PoolScale
|
||||
from hanzoai.cloud.models.populated_flow import PopulatedFlow
|
||||
from hanzoai.cloud.models.position import Position
|
||||
from hanzoai.cloud.models.post_event_request import PostEventRequest
|
||||
from hanzoai.cloud.models.post_index_indexes_by_uid_documents_delete_batch_request import PostIndexIndexesByUidDocumentsDeleteBatchRequest
|
||||
from hanzoai.cloud.models.post_list import PostList
|
||||
from hanzoai.cloud.models.prefs_view import PrefsView
|
||||
from hanzoai.cloud.models.preset import Preset
|
||||
|
||||
@@ -1,143 +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
|
||||
import json
|
||||
import pprint
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator
|
||||
from typing import Any, List, Optional, Union
|
||||
from pydantic import StrictStr, Field
|
||||
from typing import Union, List, Set, Optional, Dict
|
||||
from typing_extensions import Literal, Self
|
||||
|
||||
POSTINDEXINDEXESBYUIDDOCUMENTSDELETEBATCHREQUEST_ONE_OF_SCHEMAS = ["List[float]", "List[str]"]
|
||||
|
||||
class PostIndexIndexesByUidDocumentsDeleteBatchRequest(BaseModel):
|
||||
"""
|
||||
PostIndexIndexesByUidDocumentsDeleteBatchRequest
|
||||
"""
|
||||
# data type: List[str]
|
||||
oneof_schema_1_validator: Optional[List[StrictStr]] = None
|
||||
# data type: List[float]
|
||||
oneof_schema_2_validator: Optional[List[Union[StrictFloat, StrictInt]]] = None
|
||||
actual_instance: Optional[Union[List[float], List[str]]] = None
|
||||
one_of_schemas: Set[str] = { "List[float]", "List[str]" }
|
||||
|
||||
model_config = ConfigDict(
|
||||
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)
|
||||
|
||||
@field_validator('actual_instance')
|
||||
def actual_instance_must_validate_oneof(cls, v):
|
||||
instance = PostIndexIndexesByUidDocumentsDeleteBatchRequest.model_construct()
|
||||
error_messages = []
|
||||
match = 0
|
||||
# validate data type: List[str]
|
||||
try:
|
||||
instance.oneof_schema_1_validator = v
|
||||
match += 1
|
||||
except (ValidationError, ValueError) as e:
|
||||
error_messages.append(str(e))
|
||||
# validate data type: List[float]
|
||||
try:
|
||||
instance.oneof_schema_2_validator = v
|
||||
match += 1
|
||||
except (ValidationError, ValueError) as e:
|
||||
error_messages.append(str(e))
|
||||
if match > 1:
|
||||
# more than 1 match
|
||||
raise ValueError("Multiple matches found when setting `actual_instance` in PostIndexIndexesByUidDocumentsDeleteBatchRequest with oneOf schemas: List[float], List[str]. Details: " + ", ".join(error_messages))
|
||||
elif match == 0:
|
||||
# no match
|
||||
raise ValueError("No match found when setting `actual_instance` in PostIndexIndexesByUidDocumentsDeleteBatchRequest with oneOf schemas: List[float], List[str]. Details: " + ", ".join(error_messages))
|
||||
else:
|
||||
return v
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Union[str, 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 = []
|
||||
match = 0
|
||||
|
||||
# deserialize data into List[str]
|
||||
try:
|
||||
# validation
|
||||
instance.oneof_schema_1_validator = json.loads(json_str)
|
||||
# assign value to actual_instance
|
||||
instance.actual_instance = instance.oneof_schema_1_validator
|
||||
match += 1
|
||||
except (ValidationError, ValueError) as e:
|
||||
error_messages.append(str(e))
|
||||
# deserialize data into List[float]
|
||||
try:
|
||||
# validation
|
||||
instance.oneof_schema_2_validator = json.loads(json_str)
|
||||
# assign value to actual_instance
|
||||
instance.actual_instance = instance.oneof_schema_2_validator
|
||||
match += 1
|
||||
except (ValidationError, ValueError) as e:
|
||||
error_messages.append(str(e))
|
||||
|
||||
if match > 1:
|
||||
# more than 1 match
|
||||
raise ValueError("Multiple matches found when deserializing the JSON string into PostIndexIndexesByUidDocumentsDeleteBatchRequest with oneOf schemas: List[float], List[str]. Details: " + ", ".join(error_messages))
|
||||
elif match == 0:
|
||||
# no match
|
||||
raise ValueError("No match found when deserializing the JSON string into PostIndexIndexesByUidDocumentsDeleteBatchRequest with oneOf schemas: List[float], List[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[float], List[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:
|
||||
# primitive type
|
||||
return self.actual_instance
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the actual instance"""
|
||||
return pprint.pformat(self.model_dump())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user