-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(specs): add recommend batch rules endpoint (generated)
algolia/api-clients-automation#3782 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Raed <[email protected]> Co-authored-by: Pierre Millot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
- Loading branch information
1 parent
16ac3ca
commit 7d03f02
Showing
4 changed files
with
322 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
algoliasearch/recommend/models/recommend_updated_at_response.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# coding: utf-8 | ||
|
||
""" | ||
Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from json import loads | ||
from sys import version_info | ||
from typing import Any, Dict, Optional | ||
|
||
from pydantic import BaseModel, ConfigDict, Field | ||
|
||
if version_info >= (3, 11): | ||
from typing import Self | ||
else: | ||
from typing_extensions import Self | ||
|
||
|
||
class RecommendUpdatedAtResponse(BaseModel): | ||
""" | ||
Response, taskID, and update timestamp. | ||
""" | ||
|
||
task_id: int = Field(alias="taskID") | ||
""" Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task's progress with the [`task` operation](#tag/Indices/operation/getTask) and this `taskID`. """ | ||
updated_at: str = Field(alias="updatedAt") | ||
""" Date and time when the object was updated, in RFC 3339 format. """ | ||
|
||
model_config = ConfigDict( | ||
use_enum_values=True, | ||
populate_by_name=True, | ||
validate_assignment=True, | ||
protected_namespaces=(), | ||
) | ||
|
||
def to_json(self) -> str: | ||
return self.model_dump_json(by_alias=True, exclude_unset=True) | ||
|
||
@classmethod | ||
def from_json(cls, json_str: str) -> Optional[Self]: | ||
"""Create an instance of RecommendUpdatedAtResponse from a JSON string""" | ||
return cls.from_dict(loads(json_str)) | ||
|
||
def to_dict(self) -> Dict[str, Any]: | ||
"""Return the dictionary representation of the model using alias.""" | ||
return self.model_dump( | ||
by_alias=True, | ||
exclude_none=True, | ||
exclude_unset=True, | ||
) | ||
|
||
@classmethod | ||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: | ||
"""Create an instance of RecommendUpdatedAtResponse from a dict""" | ||
if obj is None: | ||
return None | ||
|
||
if not isinstance(obj, dict): | ||
return cls.model_validate(obj) | ||
|
||
return cls.model_validate(obj) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# coding: utf-8 | ||
|
||
""" | ||
Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from json import loads | ||
from sys import version_info | ||
from typing import Any, Dict, Optional | ||
|
||
from pydantic import BaseModel, ConfigDict, Field | ||
|
||
if version_info >= (3, 11): | ||
from typing import Self | ||
else: | ||
from typing_extensions import Self | ||
|
||
|
||
class TimeRange(BaseModel): | ||
""" | ||
TimeRange | ||
""" | ||
|
||
var_from: int = Field(alias="from") | ||
""" When the rule should start to be active, in Unix epoch time. """ | ||
until: int = Field(alias="until") | ||
""" When the rule should stop to be active, in Unix epoch time. """ | ||
|
||
model_config = ConfigDict( | ||
use_enum_values=True, | ||
populate_by_name=True, | ||
validate_assignment=True, | ||
protected_namespaces=(), | ||
) | ||
|
||
def to_json(self) -> str: | ||
return self.model_dump_json(by_alias=True, exclude_unset=True) | ||
|
||
@classmethod | ||
def from_json(cls, json_str: str) -> Optional[Self]: | ||
"""Create an instance of TimeRange from a JSON string""" | ||
return cls.from_dict(loads(json_str)) | ||
|
||
def to_dict(self) -> Dict[str, Any]: | ||
"""Return the dictionary representation of the model using alias.""" | ||
return self.model_dump( | ||
by_alias=True, | ||
exclude_none=True, | ||
exclude_unset=True, | ||
) | ||
|
||
@classmethod | ||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: | ||
"""Create an instance of TimeRange from a dict""" | ||
if obj is None: | ||
return None | ||
|
||
if not isinstance(obj, dict): | ||
return cls.model_validate(obj) | ||
|
||
return cls.model_validate(obj) |