stackit-automation 0.1.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.
- stackit/automation/__init__.py +187 -0
- stackit/automation/api/__init__.py +4 -0
- stackit/automation/api/default_api.py +2971 -0
- stackit/automation/api_client.py +650 -0
- stackit/automation/api_response.py +22 -0
- stackit/automation/configuration.py +163 -0
- stackit/automation/exceptions.py +218 -0
- stackit/automation/models/__init__.py +73 -0
- stackit/automation/models/automation_schedule_trigger.py +85 -0
- stackit/automation/models/automation_triggers.py +101 -0
- stackit/automation/models/create_snapshots_result.py +85 -0
- stackit/automation/models/create_volume_automation_payload.py +125 -0
- stackit/automation/models/error_info_detail.py +93 -0
- stackit/automation/models/error_response.py +90 -0
- stackit/automation/models/error_response_content.py +108 -0
- stackit/automation/models/error_response_content_details.py +99 -0
- stackit/automation/models/event_create_response.py +83 -0
- stackit/automation/models/get_volume_ids_result.py +85 -0
- stackit/automation/models/get_volume_template_response.py +125 -0
- stackit/automation/models/help_error_detail.py +87 -0
- stackit/automation/models/list_automations_item.py +146 -0
- stackit/automation/models/list_automations_response.py +106 -0
- stackit/automation/models/list_executions_item.py +129 -0
- stackit/automation/models/list_executions_response.py +106 -0
- stackit/automation/models/list_templates_response.py +104 -0
- stackit/automation/models/localized_message_error_detail.py +87 -0
- stackit/automation/models/partial_update_volume_automation_payload.py +122 -0
- stackit/automation/models/schedule.py +84 -0
- stackit/automation/models/schedule_details.py +87 -0
- stackit/automation/models/schedule_patch_request.py +87 -0
- stackit/automation/models/schedule_request.py +87 -0
- stackit/automation/models/snapshot_retention_policy.py +99 -0
- stackit/automation/models/template.py +108 -0
- stackit/automation/models/volume_automation.py +165 -0
- stackit/automation/models/volume_automation_input.py +99 -0
- stackit/automation/models/volume_execution_automation.py +162 -0
- stackit/automation/models/volume_execution_details.py +100 -0
- stackit/automation/models/volume_execution_output.py +102 -0
- stackit/automation/models/volume_execution_output_step.py +105 -0
- stackit/automation/models/volume_execution_response.py +138 -0
- stackit/automation/models/volume_output.py +100 -0
- stackit/automation/models/volume_output_step.py +94 -0
- stackit/automation/models/volume_output_step_result.py +99 -0
- stackit/automation/models/volume_recovery_point_management_input.py +118 -0
- stackit/automation/models/volume_template_automation_input.py +90 -0
- stackit/automation/py.typed +0 -0
- stackit/automation/rest.py +164 -0
- stackit_automation-0.1.0.dist-info/METADATA +46 -0
- stackit_automation-0.1.0.dist-info/RECORD +52 -0
- stackit_automation-0.1.0.dist-info/WHEEL +4 -0
- stackit_automation-0.1.0.dist-info/licenses/LICENSE.md +201 -0
- stackit_automation-0.1.0.dist-info/licenses/NOTICE.txt +2 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Automation Service API
|
|
5
|
+
|
|
6
|
+
API endpoints for automation management .
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0
|
|
9
|
+
Contact: support@stackit.de
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from pydantic_core import to_jsonable_python
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class ScheduleRequest(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ScheduleRequest
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
|
|
31
|
+
name: StrictStr
|
|
32
|
+
rrule: StrictStr
|
|
33
|
+
workflow_config: Optional[Dict[str, Any]] = Field(default=None, alias="workflowConfig")
|
|
34
|
+
__properties: ClassVar[List[str]] = ["name", "rrule", "workflowConfig"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
validate_by_name=True,
|
|
38
|
+
validate_by_alias=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of ScheduleRequest from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of ScheduleRequest from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate(
|
|
85
|
+
{"name": obj.get("name"), "rrule": obj.get("rrule"), "workflowConfig": obj.get("workflowConfig")}
|
|
86
|
+
)
|
|
87
|
+
return _obj
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Automation Service API
|
|
5
|
+
|
|
6
|
+
API endpoints for automation management .
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0
|
|
9
|
+
Contact: support@stackit.de
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
|
+
from pydantic_core import to_jsonable_python
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class SnapshotRetentionPolicy(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
SnapshotRetentionPolicy
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
|
|
31
|
+
kind: StrictStr
|
|
32
|
+
additional_properties: Dict[str, Any] = {}
|
|
33
|
+
__properties: ClassVar[List[str]] = ["kind"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
validate_by_name=True,
|
|
37
|
+
validate_by_alias=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of SnapshotRetentionPolicy 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
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set(
|
|
67
|
+
[
|
|
68
|
+
"additional_properties",
|
|
69
|
+
]
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
# puts key-value pairs in additional_properties in the top level
|
|
78
|
+
if self.additional_properties is not None:
|
|
79
|
+
for _key, _value in self.additional_properties.items():
|
|
80
|
+
_dict[_key] = _value
|
|
81
|
+
|
|
82
|
+
return _dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of SnapshotRetentionPolicy from a dict"""
|
|
87
|
+
if obj is None:
|
|
88
|
+
return None
|
|
89
|
+
|
|
90
|
+
if not isinstance(obj, dict):
|
|
91
|
+
return cls.model_validate(obj)
|
|
92
|
+
|
|
93
|
+
_obj = cls.model_validate({"kind": obj.get("kind")})
|
|
94
|
+
# store additional fields in additional_properties
|
|
95
|
+
for _key in obj.keys():
|
|
96
|
+
if _key not in cls.__properties:
|
|
97
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
98
|
+
|
|
99
|
+
return _obj
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Automation Service API
|
|
5
|
+
|
|
6
|
+
API endpoints for automation management .
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0
|
|
9
|
+
Contact: support@stackit.de
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
import re # noqa: F401
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
22
|
+
|
|
23
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
24
|
+
from pydantic_core import to_jsonable_python
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class Template(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
Template
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
|
|
33
|
+
create_time: datetime = Field(alias="createTime")
|
|
34
|
+
description: StrictStr
|
|
35
|
+
id: StrictStr
|
|
36
|
+
name: StrictStr
|
|
37
|
+
__properties: ClassVar[List[str]] = ["createTime", "description", "id", "name"]
|
|
38
|
+
|
|
39
|
+
@field_validator("create_time", mode="before")
|
|
40
|
+
def create_time_change_year_zero_to_one(cls, value):
|
|
41
|
+
"""Workaround which prevents year 0 issue"""
|
|
42
|
+
if isinstance(value, str):
|
|
43
|
+
# Check for year "0000" at the beginning of the string
|
|
44
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
45
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
46
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
47
|
+
):
|
|
48
|
+
# Workaround: Replace "0000" with "0001"
|
|
49
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
50
|
+
return value
|
|
51
|
+
|
|
52
|
+
model_config = ConfigDict(
|
|
53
|
+
validate_by_name=True,
|
|
54
|
+
validate_by_alias=True,
|
|
55
|
+
validate_assignment=True,
|
|
56
|
+
protected_namespaces=(),
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
def to_str(self) -> str:
|
|
60
|
+
"""Returns the string representation of the model using alias"""
|
|
61
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
62
|
+
|
|
63
|
+
def to_json(self) -> str:
|
|
64
|
+
"""Returns the JSON representation of the model using alias"""
|
|
65
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
66
|
+
|
|
67
|
+
@classmethod
|
|
68
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
69
|
+
"""Create an instance of Template from a JSON string"""
|
|
70
|
+
return cls.from_dict(json.loads(json_str))
|
|
71
|
+
|
|
72
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
73
|
+
"""Return the dictionary representation of the model using alias.
|
|
74
|
+
|
|
75
|
+
This has the following differences from calling pydantic's
|
|
76
|
+
`self.model_dump(by_alias=True)`:
|
|
77
|
+
|
|
78
|
+
* `None` is only added to the output dict for nullable fields that
|
|
79
|
+
were set at model initialization. Other fields with value `None`
|
|
80
|
+
are ignored.
|
|
81
|
+
"""
|
|
82
|
+
excluded_fields: Set[str] = set([])
|
|
83
|
+
|
|
84
|
+
_dict = self.model_dump(
|
|
85
|
+
by_alias=True,
|
|
86
|
+
exclude=excluded_fields,
|
|
87
|
+
exclude_none=True,
|
|
88
|
+
)
|
|
89
|
+
return _dict
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
93
|
+
"""Create an instance of Template 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
|
+
{
|
|
102
|
+
"createTime": obj.get("createTime"),
|
|
103
|
+
"description": obj.get("description"),
|
|
104
|
+
"id": obj.get("id"),
|
|
105
|
+
"name": obj.get("name"),
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
return _obj
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Automation Service API
|
|
5
|
+
|
|
6
|
+
API endpoints for automation management .
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0
|
|
9
|
+
Contact: support@stackit.de
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
import re # noqa: F401
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
22
|
+
from uuid import UUID
|
|
23
|
+
|
|
24
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
from stackit.automation.models.automation_triggers import AutomationTriggers
|
|
29
|
+
from stackit.automation.models.volume_automation_input import VolumeAutomationInput
|
|
30
|
+
from stackit.automation.models.volume_output import VolumeOutput
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class VolumeAutomation(BaseModel):
|
|
34
|
+
"""
|
|
35
|
+
VolumeAutomation
|
|
36
|
+
""" # noqa: E501
|
|
37
|
+
|
|
38
|
+
create_time: datetime = Field(alias="createTime")
|
|
39
|
+
description: Optional[StrictStr] = None
|
|
40
|
+
id: UUID
|
|
41
|
+
input: Optional[VolumeAutomationInput] = None
|
|
42
|
+
name: Optional[StrictStr] = None
|
|
43
|
+
output: Optional[VolumeOutput] = None
|
|
44
|
+
template_id: Optional[UUID] = Field(default=None, alias="templateId")
|
|
45
|
+
triggers: Optional[AutomationTriggers] = None
|
|
46
|
+
update_time: datetime = Field(alias="updateTime")
|
|
47
|
+
__properties: ClassVar[List[str]] = [
|
|
48
|
+
"createTime",
|
|
49
|
+
"description",
|
|
50
|
+
"id",
|
|
51
|
+
"input",
|
|
52
|
+
"name",
|
|
53
|
+
"output",
|
|
54
|
+
"templateId",
|
|
55
|
+
"triggers",
|
|
56
|
+
"updateTime",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
@field_validator("create_time", mode="before")
|
|
60
|
+
def create_time_change_year_zero_to_one(cls, value):
|
|
61
|
+
"""Workaround which prevents year 0 issue"""
|
|
62
|
+
if isinstance(value, str):
|
|
63
|
+
# Check for year "0000" at the beginning of the string
|
|
64
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
65
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
66
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
67
|
+
):
|
|
68
|
+
# Workaround: Replace "0000" with "0001"
|
|
69
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
70
|
+
return value
|
|
71
|
+
|
|
72
|
+
@field_validator("update_time", mode="before")
|
|
73
|
+
def update_time_change_year_zero_to_one(cls, value):
|
|
74
|
+
"""Workaround which prevents year 0 issue"""
|
|
75
|
+
if isinstance(value, str):
|
|
76
|
+
# Check for year "0000" at the beginning of the string
|
|
77
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
78
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
79
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
80
|
+
):
|
|
81
|
+
# Workaround: Replace "0000" with "0001"
|
|
82
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
83
|
+
return value
|
|
84
|
+
|
|
85
|
+
model_config = ConfigDict(
|
|
86
|
+
validate_by_name=True,
|
|
87
|
+
validate_by_alias=True,
|
|
88
|
+
validate_assignment=True,
|
|
89
|
+
protected_namespaces=(),
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
def to_str(self) -> str:
|
|
93
|
+
"""Returns the string representation of the model using alias"""
|
|
94
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
95
|
+
|
|
96
|
+
def to_json(self) -> str:
|
|
97
|
+
"""Returns the JSON representation of the model using alias"""
|
|
98
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
99
|
+
|
|
100
|
+
@classmethod
|
|
101
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
102
|
+
"""Create an instance of VolumeAutomation from a JSON string"""
|
|
103
|
+
return cls.from_dict(json.loads(json_str))
|
|
104
|
+
|
|
105
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
106
|
+
"""Return the dictionary representation of the model using alias.
|
|
107
|
+
|
|
108
|
+
This has the following differences from calling pydantic's
|
|
109
|
+
`self.model_dump(by_alias=True)`:
|
|
110
|
+
|
|
111
|
+
* `None` is only added to the output dict for nullable fields that
|
|
112
|
+
were set at model initialization. Other fields with value `None`
|
|
113
|
+
are ignored.
|
|
114
|
+
"""
|
|
115
|
+
excluded_fields: Set[str] = set([])
|
|
116
|
+
|
|
117
|
+
_dict = self.model_dump(
|
|
118
|
+
by_alias=True,
|
|
119
|
+
exclude=excluded_fields,
|
|
120
|
+
exclude_none=True,
|
|
121
|
+
)
|
|
122
|
+
# override the default output from pydantic by calling `to_dict()` of input
|
|
123
|
+
if self.input:
|
|
124
|
+
_dict["input"] = self.input.to_dict()
|
|
125
|
+
# override the default output from pydantic by calling `to_dict()` of output
|
|
126
|
+
if self.output:
|
|
127
|
+
_dict["output"] = self.output.to_dict()
|
|
128
|
+
# override the default output from pydantic by calling `to_dict()` of triggers
|
|
129
|
+
if self.triggers:
|
|
130
|
+
_dict["triggers"] = self.triggers.to_dict()
|
|
131
|
+
# set to None if input (nullable) is None
|
|
132
|
+
# and model_fields_set contains the field
|
|
133
|
+
if self.input is None and "input" in self.model_fields_set:
|
|
134
|
+
_dict["input"] = None
|
|
135
|
+
|
|
136
|
+
# set to None if triggers (nullable) is None
|
|
137
|
+
# and model_fields_set contains the field
|
|
138
|
+
if self.triggers is None and "triggers" in self.model_fields_set:
|
|
139
|
+
_dict["triggers"] = None
|
|
140
|
+
|
|
141
|
+
return _dict
|
|
142
|
+
|
|
143
|
+
@classmethod
|
|
144
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
145
|
+
"""Create an instance of VolumeAutomation from a dict"""
|
|
146
|
+
if obj is None:
|
|
147
|
+
return None
|
|
148
|
+
|
|
149
|
+
if not isinstance(obj, dict):
|
|
150
|
+
return cls.model_validate(obj)
|
|
151
|
+
|
|
152
|
+
_obj = cls.model_validate(
|
|
153
|
+
{
|
|
154
|
+
"createTime": obj.get("createTime"),
|
|
155
|
+
"description": obj.get("description"),
|
|
156
|
+
"id": obj.get("id"),
|
|
157
|
+
"input": VolumeAutomationInput.from_dict(obj["input"]) if obj.get("input") is not None else None,
|
|
158
|
+
"name": obj.get("name"),
|
|
159
|
+
"output": VolumeOutput.from_dict(obj["output"]) if obj.get("output") is not None else None,
|
|
160
|
+
"templateId": obj.get("templateId"),
|
|
161
|
+
"triggers": AutomationTriggers.from_dict(obj["triggers"]) if obj.get("triggers") is not None else None,
|
|
162
|
+
"updateTime": obj.get("updateTime"),
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
return _obj
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Automation Service API
|
|
5
|
+
|
|
6
|
+
API endpoints for automation management .
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0
|
|
9
|
+
Contact: support@stackit.de
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
from typing import Any, ClassVar, Dict, List, Optional, Set
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
|
+
from pydantic_core import to_jsonable_python
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class VolumeAutomationInput(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
VolumeAutomationInput
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
|
|
31
|
+
kind: StrictStr
|
|
32
|
+
additional_properties: Dict[str, Any] = {}
|
|
33
|
+
__properties: ClassVar[List[str]] = ["kind"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
validate_by_name=True,
|
|
37
|
+
validate_by_alias=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of VolumeAutomationInput 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
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set(
|
|
67
|
+
[
|
|
68
|
+
"additional_properties",
|
|
69
|
+
]
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
_dict = self.model_dump(
|
|
73
|
+
by_alias=True,
|
|
74
|
+
exclude=excluded_fields,
|
|
75
|
+
exclude_none=True,
|
|
76
|
+
)
|
|
77
|
+
# puts key-value pairs in additional_properties in the top level
|
|
78
|
+
if self.additional_properties is not None:
|
|
79
|
+
for _key, _value in self.additional_properties.items():
|
|
80
|
+
_dict[_key] = _value
|
|
81
|
+
|
|
82
|
+
return _dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of VolumeAutomationInput from a dict"""
|
|
87
|
+
if obj is None:
|
|
88
|
+
return None
|
|
89
|
+
|
|
90
|
+
if not isinstance(obj, dict):
|
|
91
|
+
return cls.model_validate(obj)
|
|
92
|
+
|
|
93
|
+
_obj = cls.model_validate({"kind": obj.get("kind")})
|
|
94
|
+
# store additional fields in additional_properties
|
|
95
|
+
for _key in obj.keys():
|
|
96
|
+
if _key not in cls.__properties:
|
|
97
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
98
|
+
|
|
99
|
+
return _obj
|