perceptic-core-client 0.13.0__py3-none-any.whl → 0.15.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of perceptic-core-client might be problematic. Click here for more details.

Files changed (37) hide show
  1. perceptic_core_client/__init__.py +15 -0
  2. perceptic_core_client/api/__init__.py +1 -0
  3. perceptic_core_client/api/indexing_schedule_resource_api.py +2243 -0
  4. perceptic_core_client/models/__init__.py +14 -0
  5. perceptic_core_client/models/create_indexing_schedule_request.py +122 -0
  6. perceptic_core_client/models/create_indexing_schedule_response.py +93 -0
  7. perceptic_core_client/models/cron_trigger.py +106 -0
  8. perceptic_core_client/models/execution_trigger_reason.py +37 -0
  9. perceptic_core_client/models/get_indexing_schedule_response.py +91 -0
  10. perceptic_core_client/models/indexing_schedule_dto.py +118 -0
  11. perceptic_core_client/models/interval_trigger.py +92 -0
  12. perceptic_core_client/models/list_indexing_schedules_response.py +104 -0
  13. perceptic_core_client/models/list_schedule_executions_response.py +104 -0
  14. perceptic_core_client/models/on_upload_trigger.py +87 -0
  15. perceptic_core_client/models/schedule_execution_dto.py +104 -0
  16. perceptic_core_client/models/schedule_trigger.py +189 -0
  17. perceptic_core_client/models/update_indexing_schedule_request.py +127 -0
  18. perceptic_core_client/models/update_indexing_schedule_response.py +91 -0
  19. perceptic_core_client/test/test_create_indexing_schedule_request.py +66 -0
  20. perceptic_core_client/test/test_create_indexing_schedule_response.py +68 -0
  21. perceptic_core_client/test/test_cron_trigger.py +55 -0
  22. perceptic_core_client/test/test_execution_trigger_reason.py +33 -0
  23. perceptic_core_client/test/test_get_indexing_schedule_response.py +67 -0
  24. perceptic_core_client/test/test_indexing_schedule_dto.py +66 -0
  25. perceptic_core_client/test/test_indexing_schedule_resource_api.py +87 -0
  26. perceptic_core_client/test/test_interval_trigger.py +54 -0
  27. perceptic_core_client/test/test_list_indexing_schedules_response.py +71 -0
  28. perceptic_core_client/test/test_list_schedule_executions_response.py +61 -0
  29. perceptic_core_client/test/test_on_upload_trigger.py +51 -0
  30. perceptic_core_client/test/test_schedule_execution_dto.py +56 -0
  31. perceptic_core_client/test/test_schedule_trigger.py +58 -0
  32. perceptic_core_client/test/test_update_indexing_schedule_request.py +58 -0
  33. perceptic_core_client/test/test_update_indexing_schedule_response.py +67 -0
  34. {perceptic_core_client-0.13.0.dist-info → perceptic_core_client-0.15.0.dist-info}/METADATA +1 -1
  35. {perceptic_core_client-0.13.0.dist-info → perceptic_core_client-0.15.0.dist-info}/RECORD +37 -7
  36. {perceptic_core_client-0.13.0.dist-info → perceptic_core_client-0.15.0.dist-info}/WHEEL +0 -0
  37. {perceptic_core_client-0.13.0.dist-info → perceptic_core_client-0.15.0.dist-info}/top_level.txt +0 -0
@@ -24,16 +24,21 @@ from perceptic_core_client.models.create_connection_response import CreateConnec
24
24
  from perceptic_core_client.models.create_file_system_response import CreateFileSystemResponse
25
25
  from perceptic_core_client.models.create_folder_request import CreateFolderRequest
26
26
  from perceptic_core_client.models.create_folder_response import CreateFolderResponse
27
+ from perceptic_core_client.models.create_indexing_schedule_request import CreateIndexingScheduleRequest
28
+ from perceptic_core_client.models.create_indexing_schedule_response import CreateIndexingScheduleResponse
27
29
  from perceptic_core_client.models.create_indexing_task_request import CreateIndexingTaskRequest
28
30
  from perceptic_core_client.models.create_indexing_task_response import CreateIndexingTaskResponse
29
31
  from perceptic_core_client.models.create_managed_file_system_request import CreateManagedFileSystemRequest
30
32
  from perceptic_core_client.models.create_remote_file_system_request import CreateRemoteFileSystemRequest
31
33
  from perceptic_core_client.models.create_tag_request import CreateTagRequest
32
34
  from perceptic_core_client.models.create_tag_response import CreateTagResponse
35
+ from perceptic_core_client.models.cron_trigger import CronTrigger
36
+ from perceptic_core_client.models.execution_trigger_reason import ExecutionTriggerReason
33
37
  from perceptic_core_client.models.file_system_api_dto import FileSystemApiDto
34
38
  from perceptic_core_client.models.file_system_root_metadata_api_dto import FileSystemRootMetadataApiDto
35
39
  from perceptic_core_client.models.get_connection_response import GetConnectionResponse
36
40
  from perceptic_core_client.models.get_indexer_response import GetIndexerResponse
41
+ from perceptic_core_client.models.get_indexing_schedule_response import GetIndexingScheduleResponse
37
42
  from perceptic_core_client.models.get_indexing_task_response import GetIndexingTaskResponse
38
43
  from perceptic_core_client.models.get_metadata_response import GetMetadataResponse
39
44
  from perceptic_core_client.models.get_parent_response import GetParentResponse
@@ -46,18 +51,23 @@ from perceptic_core_client.models.get_workers_response import GetWorkersResponse
46
51
  from perceptic_core_client.models.indexer_dto import IndexerDto
47
52
  from perceptic_core_client.models.indexing_action_dto import IndexingActionDto
48
53
  from perceptic_core_client.models.indexing_action_status import IndexingActionStatus
54
+ from perceptic_core_client.models.indexing_schedule_dto import IndexingScheduleDto
49
55
  from perceptic_core_client.models.indexing_task_dto import IndexingTaskDto
50
56
  from perceptic_core_client.models.indexing_task_status import IndexingTaskStatus
51
57
  from perceptic_core_client.models.info_event import InfoEvent
58
+ from perceptic_core_client.models.interval_trigger import IntervalTrigger
52
59
  from perceptic_core_client.models.json_node import JsonNode
53
60
  from perceptic_core_client.models.json_node_type import JsonNodeType
54
61
  from perceptic_core_client.models.list_all_file_systems_response import ListAllFileSystemsResponse
55
62
  from perceptic_core_client.models.list_file_system_response import ListFileSystemResponse
56
63
  from perceptic_core_client.models.list_indexers_response import ListIndexersResponse
57
64
  from perceptic_core_client.models.list_indexing_actions_response import ListIndexingActionsResponse
65
+ from perceptic_core_client.models.list_indexing_schedules_response import ListIndexingSchedulesResponse
66
+ from perceptic_core_client.models.list_schedule_executions_response import ListScheduleExecutionsResponse
58
67
  from perceptic_core_client.models.managed_file_system_api_dto import ManagedFileSystemApiDto
59
68
  from perceptic_core_client.models.me_response import MeResponse
60
69
  from perceptic_core_client.models.model_schema import ModelSchema
70
+ from perceptic_core_client.models.on_upload_trigger import OnUploadTrigger
61
71
  from perceptic_core_client.models.paged_list_file_system_response import PagedListFileSystemResponse
62
72
  from perceptic_core_client.models.post_worker_run_request import PostWorkerRunRequest
63
73
  from perceptic_core_client.models.post_worker_run_response import PostWorkerRunResponse
@@ -71,8 +81,12 @@ from perceptic_core_client.models.resource_type_dto import ResourceTypeDto
71
81
  from perceptic_core_client.models.run_status_dto import RunStatusDto
72
82
  from perceptic_core_client.models.s3_connection_settings_api_dto import S3ConnectionSettingsApiDto
73
83
  from perceptic_core_client.models.s3_file_system_root_metadata_api_dto import S3FileSystemRootMetadataApiDto
84
+ from perceptic_core_client.models.schedule_execution_dto import ScheduleExecutionDto
85
+ from perceptic_core_client.models.schedule_trigger import ScheduleTrigger
74
86
  from perceptic_core_client.models.schema_location import SchemaLocation
75
87
  from perceptic_core_client.models.start_execution_response import StartExecutionResponse
88
+ from perceptic_core_client.models.update_indexing_schedule_request import UpdateIndexingScheduleRequest
89
+ from perceptic_core_client.models.update_indexing_schedule_response import UpdateIndexingScheduleResponse
76
90
  from perceptic_core_client.models.upload_file_to_managed_file_system_response import UploadFileToManagedFileSystemResponse
77
91
  from perceptic_core_client.models.worker_event import WorkerEvent
78
92
  from perceptic_core_client.models.worker_metadata_dto import WorkerMetadataDto
@@ -0,0 +1,122 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing_extensions import Annotated
23
+ from perceptic_core_client.models.schedule_trigger import ScheduleTrigger
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class CreateIndexingScheduleRequest(BaseModel):
28
+ """
29
+ CreateIndexingScheduleRequest
30
+ """ # noqa: E501
31
+ name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="Display name for the schedule")
32
+ description: Optional[Annotated[str, Field(strict=True, max_length=1000)]] = Field(default=None, description="Optional description of the schedule's purpose")
33
+ indexer_rid: StrictStr = Field(description="RID of the indexer to use", alias="indexerRid")
34
+ target_uri: StrictStr = Field(description="URI of folder or filesystem to index", alias="targetUri")
35
+ namespace: Annotated[str, Field(strict=True)] = Field(description="Namespace for indexing")
36
+ target_minimum_version: Optional[StrictInt] = Field(default=None, description="Minimum indexer version required", alias="targetMinimumVersion")
37
+ indexing_settings: Optional[Dict[str, Any]] = Field(default=None, description="Indexer-specific settings", alias="indexingSettings")
38
+ trigger: ScheduleTrigger
39
+ enabled: Optional[StrictBool] = Field(default=None, description="Whether the schedule is enabled")
40
+ __properties: ClassVar[List[str]] = ["name", "description", "indexerRid", "targetUri", "namespace", "targetMinimumVersion", "indexingSettings", "trigger", "enabled"]
41
+
42
+ @field_validator('name')
43
+ def name_validate_regular_expression(cls, value):
44
+ """Validates the regular expression"""
45
+ if not re.match(r"\S", value):
46
+ raise ValueError(r"must validate the regular expression /\S/")
47
+ return value
48
+
49
+ @field_validator('namespace')
50
+ def namespace_validate_regular_expression(cls, value):
51
+ """Validates the regular expression"""
52
+ if not re.match(r"\S", value):
53
+ raise ValueError(r"must validate the regular expression /\S/")
54
+ return value
55
+
56
+ model_config = ConfigDict(
57
+ populate_by_name=True,
58
+ validate_assignment=True,
59
+ protected_namespaces=(),
60
+ )
61
+
62
+
63
+ def to_str(self) -> str:
64
+ """Returns the string representation of the model using alias"""
65
+ return pprint.pformat(self.model_dump(by_alias=True))
66
+
67
+ def to_json(self) -> str:
68
+ """Returns the JSON representation of the model using alias"""
69
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
70
+ return json.dumps(self.to_dict())
71
+
72
+ @classmethod
73
+ def from_json(cls, json_str: str) -> Optional[Self]:
74
+ """Create an instance of CreateIndexingScheduleRequest from a JSON string"""
75
+ return cls.from_dict(json.loads(json_str))
76
+
77
+ def to_dict(self) -> Dict[str, Any]:
78
+ """Return the dictionary representation of the model using alias.
79
+
80
+ This has the following differences from calling pydantic's
81
+ `self.model_dump(by_alias=True)`:
82
+
83
+ * `None` is only added to the output dict for nullable fields that
84
+ were set at model initialization. Other fields with value `None`
85
+ are ignored.
86
+ """
87
+ excluded_fields: Set[str] = set([
88
+ ])
89
+
90
+ _dict = self.model_dump(
91
+ by_alias=True,
92
+ exclude=excluded_fields,
93
+ exclude_none=True,
94
+ )
95
+ # override the default output from pydantic by calling `to_dict()` of trigger
96
+ if self.trigger:
97
+ _dict['trigger'] = self.trigger.to_dict()
98
+ return _dict
99
+
100
+ @classmethod
101
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
102
+ """Create an instance of CreateIndexingScheduleRequest from a dict"""
103
+ if obj is None:
104
+ return None
105
+
106
+ if not isinstance(obj, dict):
107
+ return cls.model_validate(obj)
108
+
109
+ _obj = cls.model_validate({
110
+ "name": obj.get("name"),
111
+ "description": obj.get("description"),
112
+ "indexerRid": obj.get("indexerRid"),
113
+ "targetUri": obj.get("targetUri"),
114
+ "namespace": obj.get("namespace"),
115
+ "targetMinimumVersion": obj.get("targetMinimumVersion"),
116
+ "indexingSettings": obj.get("indexingSettings"),
117
+ "trigger": ScheduleTrigger.from_dict(obj["trigger"]) if obj.get("trigger") is not None else None,
118
+ "enabled": obj.get("enabled")
119
+ })
120
+ return _obj
121
+
122
+
@@ -0,0 +1,93 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from perceptic_core_client.models.indexing_schedule_dto import IndexingScheduleDto
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class CreateIndexingScheduleResponse(BaseModel):
27
+ """
28
+ CreateIndexingScheduleResponse
29
+ """ # noqa: E501
30
+ schedule_rid: Optional[StrictStr] = Field(default=None, alias="scheduleRid")
31
+ schedule: Optional[IndexingScheduleDto] = None
32
+ __properties: ClassVar[List[str]] = ["scheduleRid", "schedule"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of CreateIndexingScheduleResponse from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ # override the default output from pydantic by calling `to_dict()` of schedule
74
+ if self.schedule:
75
+ _dict['schedule'] = self.schedule.to_dict()
76
+ return _dict
77
+
78
+ @classmethod
79
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
+ """Create an instance of CreateIndexingScheduleResponse from a dict"""
81
+ if obj is None:
82
+ return None
83
+
84
+ if not isinstance(obj, dict):
85
+ return cls.model_validate(obj)
86
+
87
+ _obj = cls.model_validate({
88
+ "scheduleRid": obj.get("scheduleRid"),
89
+ "schedule": IndexingScheduleDto.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None
90
+ })
91
+ return _obj
92
+
93
+
@@ -0,0 +1,106 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing_extensions import Annotated
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class CronTrigger(BaseModel):
27
+ """
28
+ CronTrigger
29
+ """ # noqa: E501
30
+ expression: Annotated[str, Field(strict=True)] = Field(description="Cron expression")
31
+ timezone: Annotated[str, Field(strict=True)] = Field(description="Timezone for cron expression")
32
+ type: Optional[StrictStr] = None
33
+ __properties: ClassVar[List[str]] = ["expression", "timezone", "type"]
34
+
35
+ @field_validator('expression')
36
+ def expression_validate_regular_expression(cls, value):
37
+ """Validates the regular expression"""
38
+ if not re.match(r"\S", value):
39
+ raise ValueError(r"must validate the regular expression /\S/")
40
+ return value
41
+
42
+ @field_validator('timezone')
43
+ def timezone_validate_regular_expression(cls, value):
44
+ """Validates the regular expression"""
45
+ if not re.match(r"^[A-Za-z]+\/[A-Za-z_]+$", value):
46
+ raise ValueError(r"must validate the regular expression /^[A-Za-z]+\/[A-Za-z_]+$/")
47
+ return value
48
+
49
+ model_config = ConfigDict(
50
+ populate_by_name=True,
51
+ validate_assignment=True,
52
+ protected_namespaces=(),
53
+ )
54
+
55
+
56
+ def to_str(self) -> str:
57
+ """Returns the string representation of the model using alias"""
58
+ return pprint.pformat(self.model_dump(by_alias=True))
59
+
60
+ def to_json(self) -> str:
61
+ """Returns the JSON representation of the model using alias"""
62
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
63
+ return json.dumps(self.to_dict())
64
+
65
+ @classmethod
66
+ def from_json(cls, json_str: str) -> Optional[Self]:
67
+ """Create an instance of CronTrigger from a JSON string"""
68
+ return cls.from_dict(json.loads(json_str))
69
+
70
+ def to_dict(self) -> Dict[str, Any]:
71
+ """Return the dictionary representation of the model using alias.
72
+
73
+ This has the following differences from calling pydantic's
74
+ `self.model_dump(by_alias=True)`:
75
+
76
+ * `None` is only added to the output dict for nullable fields that
77
+ were set at model initialization. Other fields with value `None`
78
+ are ignored.
79
+ """
80
+ excluded_fields: Set[str] = set([
81
+ ])
82
+
83
+ _dict = self.model_dump(
84
+ by_alias=True,
85
+ exclude=excluded_fields,
86
+ exclude_none=True,
87
+ )
88
+ return _dict
89
+
90
+ @classmethod
91
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
92
+ """Create an instance of CronTrigger from a dict"""
93
+ if obj is None:
94
+ return None
95
+
96
+ if not isinstance(obj, dict):
97
+ return cls.model_validate(obj)
98
+
99
+ _obj = cls.model_validate({
100
+ "expression": obj.get("expression"),
101
+ "timezone": obj.get("timezone"),
102
+ "type": obj.get("type")
103
+ })
104
+ return _obj
105
+
106
+
@@ -0,0 +1,37 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class ExecutionTriggerReason(str, Enum):
22
+ """
23
+ ExecutionTriggerReason
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ SCHEDULED = 'SCHEDULED'
30
+ FILE_UPLOAD = 'FILE_UPLOAD'
31
+
32
+ @classmethod
33
+ def from_json(cls, json_str: str) -> Self:
34
+ """Create an instance of ExecutionTriggerReason from a JSON string"""
35
+ return cls(json.loads(json_str))
36
+
37
+
@@ -0,0 +1,91 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from perceptic_core_client.models.indexing_schedule_dto import IndexingScheduleDto
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GetIndexingScheduleResponse(BaseModel):
27
+ """
28
+ GetIndexingScheduleResponse
29
+ """ # noqa: E501
30
+ schedule: Optional[IndexingScheduleDto] = None
31
+ __properties: ClassVar[List[str]] = ["schedule"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of GetIndexingScheduleResponse from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of schedule
73
+ if self.schedule:
74
+ _dict['schedule'] = self.schedule.to_dict()
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of GetIndexingScheduleResponse from a dict"""
80
+ if obj is None:
81
+ return None
82
+
83
+ if not isinstance(obj, dict):
84
+ return cls.model_validate(obj)
85
+
86
+ _obj = cls.model_validate({
87
+ "schedule": IndexingScheduleDto.from_dict(obj["schedule"]) if obj.get("schedule") is not None else None
88
+ })
89
+ return _obj
90
+
91
+
@@ -0,0 +1,118 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ perceptic-core-server API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.0.1-SNAPSHOT
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from perceptic_core_client.models.schedule_trigger import ScheduleTrigger
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class IndexingScheduleDto(BaseModel):
28
+ """
29
+ IndexingScheduleDto
30
+ """ # noqa: E501
31
+ schedule_rid: Optional[StrictStr] = Field(default=None, alias="scheduleRid")
32
+ name: Optional[StrictStr] = None
33
+ description: Optional[StrictStr] = None
34
+ indexer_rid: Optional[StrictStr] = Field(default=None, alias="indexerRid")
35
+ target_uri: Optional[StrictStr] = Field(default=None, alias="targetUri")
36
+ namespace: Optional[StrictStr] = None
37
+ target_minimum_version: Optional[StrictInt] = Field(default=None, alias="targetMinimumVersion")
38
+ indexing_settings: Optional[Dict[str, Any]] = Field(default=None, alias="indexingSettings")
39
+ trigger: Optional[ScheduleTrigger] = None
40
+ enabled: Optional[StrictBool] = None
41
+ created_at: Optional[datetime] = Field(default=None, alias="createdAt")
42
+ updated_at: Optional[datetime] = Field(default=None, alias="updatedAt")
43
+ last_executed_at: Optional[datetime] = Field(default=None, alias="lastExecutedAt")
44
+ next_execution_at: Optional[datetime] = Field(default=None, alias="nextExecutionAt")
45
+ __properties: ClassVar[List[str]] = ["scheduleRid", "name", "description", "indexerRid", "targetUri", "namespace", "targetMinimumVersion", "indexingSettings", "trigger", "enabled", "createdAt", "updatedAt", "lastExecutedAt", "nextExecutionAt"]
46
+
47
+ model_config = ConfigDict(
48
+ populate_by_name=True,
49
+ validate_assignment=True,
50
+ protected_namespaces=(),
51
+ )
52
+
53
+
54
+ def to_str(self) -> str:
55
+ """Returns the string representation of the model using alias"""
56
+ return pprint.pformat(self.model_dump(by_alias=True))
57
+
58
+ def to_json(self) -> str:
59
+ """Returns the JSON representation of the model using alias"""
60
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
61
+ return json.dumps(self.to_dict())
62
+
63
+ @classmethod
64
+ def from_json(cls, json_str: str) -> Optional[Self]:
65
+ """Create an instance of IndexingScheduleDto from a JSON string"""
66
+ return cls.from_dict(json.loads(json_str))
67
+
68
+ def to_dict(self) -> Dict[str, Any]:
69
+ """Return the dictionary representation of the model using alias.
70
+
71
+ This has the following differences from calling pydantic's
72
+ `self.model_dump(by_alias=True)`:
73
+
74
+ * `None` is only added to the output dict for nullable fields that
75
+ were set at model initialization. Other fields with value `None`
76
+ are ignored.
77
+ """
78
+ excluded_fields: Set[str] = set([
79
+ ])
80
+
81
+ _dict = self.model_dump(
82
+ by_alias=True,
83
+ exclude=excluded_fields,
84
+ exclude_none=True,
85
+ )
86
+ # override the default output from pydantic by calling `to_dict()` of trigger
87
+ if self.trigger:
88
+ _dict['trigger'] = self.trigger.to_dict()
89
+ return _dict
90
+
91
+ @classmethod
92
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
+ """Create an instance of IndexingScheduleDto from a dict"""
94
+ if obj is None:
95
+ return None
96
+
97
+ if not isinstance(obj, dict):
98
+ return cls.model_validate(obj)
99
+
100
+ _obj = cls.model_validate({
101
+ "scheduleRid": obj.get("scheduleRid"),
102
+ "name": obj.get("name"),
103
+ "description": obj.get("description"),
104
+ "indexerRid": obj.get("indexerRid"),
105
+ "targetUri": obj.get("targetUri"),
106
+ "namespace": obj.get("namespace"),
107
+ "targetMinimumVersion": obj.get("targetMinimumVersion"),
108
+ "indexingSettings": obj.get("indexingSettings"),
109
+ "trigger": ScheduleTrigger.from_dict(obj["trigger"]) if obj.get("trigger") is not None else None,
110
+ "enabled": obj.get("enabled"),
111
+ "createdAt": obj.get("createdAt"),
112
+ "updatedAt": obj.get("updatedAt"),
113
+ "lastExecutedAt": obj.get("lastExecutedAt"),
114
+ "nextExecutionAt": obj.get("nextExecutionAt")
115
+ })
116
+ return _obj
117
+
118
+