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,85 @@
|
|
|
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
|
+
from uuid import UUID
|
|
21
|
+
|
|
22
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
23
|
+
from pydantic_core import to_jsonable_python
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class GetVolumeIDsResult(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
GetVolumeIDsResult
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
|
|
32
|
+
kind: StrictStr
|
|
33
|
+
volume_ids: Optional[List[UUID]] = Field(default=None, alias="volumeIDs")
|
|
34
|
+
__properties: ClassVar[List[str]] = ["kind", "volumeIDs"]
|
|
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 GetVolumeIDsResult 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 GetVolumeIDsResult 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({"kind": obj.get("kind"), "volumeIDs": obj.get("volumeIDs")})
|
|
85
|
+
return _obj
|
|
@@ -0,0 +1,125 @@
|
|
|
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
|
+
from stackit.automation.models.volume_output import VolumeOutput
|
|
28
|
+
from stackit.automation.models.volume_template_automation_input import (
|
|
29
|
+
VolumeTemplateAutomationInput,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class GetVolumeTemplateResponse(BaseModel):
|
|
34
|
+
"""
|
|
35
|
+
GetVolumeTemplateResponse
|
|
36
|
+
""" # noqa: E501
|
|
37
|
+
|
|
38
|
+
create_time: datetime = Field(alias="createTime")
|
|
39
|
+
description: StrictStr
|
|
40
|
+
id: StrictStr
|
|
41
|
+
input: Optional[VolumeTemplateAutomationInput] = None
|
|
42
|
+
name: StrictStr
|
|
43
|
+
output: Optional[VolumeOutput] = None
|
|
44
|
+
__properties: ClassVar[List[str]] = ["createTime", "description", "id", "input", "name", "output"]
|
|
45
|
+
|
|
46
|
+
@field_validator("create_time", mode="before")
|
|
47
|
+
def create_time_change_year_zero_to_one(cls, value):
|
|
48
|
+
"""Workaround which prevents year 0 issue"""
|
|
49
|
+
if isinstance(value, str):
|
|
50
|
+
# Check for year "0000" at the beginning of the string
|
|
51
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
52
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
53
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
54
|
+
):
|
|
55
|
+
# Workaround: Replace "0000" with "0001"
|
|
56
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
57
|
+
return value
|
|
58
|
+
|
|
59
|
+
model_config = ConfigDict(
|
|
60
|
+
validate_by_name=True,
|
|
61
|
+
validate_by_alias=True,
|
|
62
|
+
validate_assignment=True,
|
|
63
|
+
protected_namespaces=(),
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
def to_str(self) -> str:
|
|
67
|
+
"""Returns the string representation of the model using alias"""
|
|
68
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
69
|
+
|
|
70
|
+
def to_json(self) -> str:
|
|
71
|
+
"""Returns the JSON representation of the model using alias"""
|
|
72
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of GetVolumeTemplateResponse from a JSON string"""
|
|
77
|
+
return cls.from_dict(json.loads(json_str))
|
|
78
|
+
|
|
79
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
80
|
+
"""Return the dictionary representation of the model using alias.
|
|
81
|
+
|
|
82
|
+
This has the following differences from calling pydantic's
|
|
83
|
+
`self.model_dump(by_alias=True)`:
|
|
84
|
+
|
|
85
|
+
* `None` is only added to the output dict for nullable fields that
|
|
86
|
+
were set at model initialization. Other fields with value `None`
|
|
87
|
+
are ignored.
|
|
88
|
+
"""
|
|
89
|
+
excluded_fields: Set[str] = set([])
|
|
90
|
+
|
|
91
|
+
_dict = self.model_dump(
|
|
92
|
+
by_alias=True,
|
|
93
|
+
exclude=excluded_fields,
|
|
94
|
+
exclude_none=True,
|
|
95
|
+
)
|
|
96
|
+
# override the default output from pydantic by calling `to_dict()` of input
|
|
97
|
+
if self.input:
|
|
98
|
+
_dict["input"] = self.input.to_dict()
|
|
99
|
+
# override the default output from pydantic by calling `to_dict()` of output
|
|
100
|
+
if self.output:
|
|
101
|
+
_dict["output"] = self.output.to_dict()
|
|
102
|
+
return _dict
|
|
103
|
+
|
|
104
|
+
@classmethod
|
|
105
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
106
|
+
"""Create an instance of GetVolumeTemplateResponse from a dict"""
|
|
107
|
+
if obj is None:
|
|
108
|
+
return None
|
|
109
|
+
|
|
110
|
+
if not isinstance(obj, dict):
|
|
111
|
+
return cls.model_validate(obj)
|
|
112
|
+
|
|
113
|
+
_obj = cls.model_validate(
|
|
114
|
+
{
|
|
115
|
+
"createTime": obj.get("createTime"),
|
|
116
|
+
"description": obj.get("description"),
|
|
117
|
+
"id": obj.get("id"),
|
|
118
|
+
"input": (
|
|
119
|
+
VolumeTemplateAutomationInput.from_dict(obj["input"]) if obj.get("input") is not None else None
|
|
120
|
+
),
|
|
121
|
+
"name": obj.get("name"),
|
|
122
|
+
"output": VolumeOutput.from_dict(obj["output"]) if obj.get("output") is not None else None,
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
return _obj
|
|
@@ -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 HelpErrorDetail(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
HelpErrorDetail
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
|
|
31
|
+
type: StrictStr = Field(alias="@type")
|
|
32
|
+
description: StrictStr
|
|
33
|
+
url: StrictStr
|
|
34
|
+
__properties: ClassVar[List[str]] = ["@type", "description", "url"]
|
|
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 HelpErrorDetail 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 HelpErrorDetail 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
|
+
{"@type": obj.get("@type"), "description": obj.get("description"), "url": obj.get("url")}
|
|
86
|
+
)
|
|
87
|
+
return _obj
|
|
@@ -0,0 +1,146 @@
|
|
|
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
|
+
|
|
30
|
+
|
|
31
|
+
class ListAutomationsItem(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
ListAutomationsItem
|
|
34
|
+
""" # noqa: E501
|
|
35
|
+
|
|
36
|
+
create_time: datetime = Field(alias="createTime")
|
|
37
|
+
description: Optional[StrictStr] = None
|
|
38
|
+
id: UUID
|
|
39
|
+
name: Optional[StrictStr] = None
|
|
40
|
+
template_id: Optional[UUID] = Field(default=None, alias="templateId")
|
|
41
|
+
triggers: Optional[AutomationTriggers] = None
|
|
42
|
+
update_time: datetime = Field(alias="updateTime")
|
|
43
|
+
__properties: ClassVar[List[str]] = [
|
|
44
|
+
"createTime",
|
|
45
|
+
"description",
|
|
46
|
+
"id",
|
|
47
|
+
"name",
|
|
48
|
+
"templateId",
|
|
49
|
+
"triggers",
|
|
50
|
+
"updateTime",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
@field_validator("create_time", mode="before")
|
|
54
|
+
def create_time_change_year_zero_to_one(cls, value):
|
|
55
|
+
"""Workaround which prevents year 0 issue"""
|
|
56
|
+
if isinstance(value, str):
|
|
57
|
+
# Check for year "0000" at the beginning of the string
|
|
58
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
59
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
60
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
61
|
+
):
|
|
62
|
+
# Workaround: Replace "0000" with "0001"
|
|
63
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
64
|
+
return value
|
|
65
|
+
|
|
66
|
+
@field_validator("update_time", mode="before")
|
|
67
|
+
def update_time_change_year_zero_to_one(cls, value):
|
|
68
|
+
"""Workaround which prevents year 0 issue"""
|
|
69
|
+
if isinstance(value, str):
|
|
70
|
+
# Check for year "0000" at the beginning of the string
|
|
71
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
72
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
73
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
74
|
+
):
|
|
75
|
+
# Workaround: Replace "0000" with "0001"
|
|
76
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
77
|
+
return value
|
|
78
|
+
|
|
79
|
+
model_config = ConfigDict(
|
|
80
|
+
validate_by_name=True,
|
|
81
|
+
validate_by_alias=True,
|
|
82
|
+
validate_assignment=True,
|
|
83
|
+
protected_namespaces=(),
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
def to_str(self) -> str:
|
|
87
|
+
"""Returns the string representation of the model using alias"""
|
|
88
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
89
|
+
|
|
90
|
+
def to_json(self) -> str:
|
|
91
|
+
"""Returns the JSON representation of the model using alias"""
|
|
92
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
93
|
+
|
|
94
|
+
@classmethod
|
|
95
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
96
|
+
"""Create an instance of ListAutomationsItem from a JSON string"""
|
|
97
|
+
return cls.from_dict(json.loads(json_str))
|
|
98
|
+
|
|
99
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
100
|
+
"""Return the dictionary representation of the model using alias.
|
|
101
|
+
|
|
102
|
+
This has the following differences from calling pydantic's
|
|
103
|
+
`self.model_dump(by_alias=True)`:
|
|
104
|
+
|
|
105
|
+
* `None` is only added to the output dict for nullable fields that
|
|
106
|
+
were set at model initialization. Other fields with value `None`
|
|
107
|
+
are ignored.
|
|
108
|
+
"""
|
|
109
|
+
excluded_fields: Set[str] = set([])
|
|
110
|
+
|
|
111
|
+
_dict = self.model_dump(
|
|
112
|
+
by_alias=True,
|
|
113
|
+
exclude=excluded_fields,
|
|
114
|
+
exclude_none=True,
|
|
115
|
+
)
|
|
116
|
+
# override the default output from pydantic by calling `to_dict()` of triggers
|
|
117
|
+
if self.triggers:
|
|
118
|
+
_dict["triggers"] = self.triggers.to_dict()
|
|
119
|
+
# set to None if triggers (nullable) is None
|
|
120
|
+
# and model_fields_set contains the field
|
|
121
|
+
if self.triggers is None and "triggers" in self.model_fields_set:
|
|
122
|
+
_dict["triggers"] = None
|
|
123
|
+
|
|
124
|
+
return _dict
|
|
125
|
+
|
|
126
|
+
@classmethod
|
|
127
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
128
|
+
"""Create an instance of ListAutomationsItem from a dict"""
|
|
129
|
+
if obj is None:
|
|
130
|
+
return None
|
|
131
|
+
|
|
132
|
+
if not isinstance(obj, dict):
|
|
133
|
+
return cls.model_validate(obj)
|
|
134
|
+
|
|
135
|
+
_obj = cls.model_validate(
|
|
136
|
+
{
|
|
137
|
+
"createTime": obj.get("createTime"),
|
|
138
|
+
"description": obj.get("description"),
|
|
139
|
+
"id": obj.get("id"),
|
|
140
|
+
"name": obj.get("name"),
|
|
141
|
+
"templateId": obj.get("templateId"),
|
|
142
|
+
"triggers": AutomationTriggers.from_dict(obj["triggers"]) if obj.get("triggers") is not None else None,
|
|
143
|
+
"updateTime": obj.get("updateTime"),
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
return _obj
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
from stackit.automation.models.list_automations_item import ListAutomationsItem
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ListAutomationsResponse(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
ListAutomationsResponse
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
|
|
33
|
+
items: List[ListAutomationsItem]
|
|
34
|
+
next_page_token: Optional[StrictStr] = Field(
|
|
35
|
+
default=None,
|
|
36
|
+
description="A token that can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.",
|
|
37
|
+
alias="nextPageToken",
|
|
38
|
+
)
|
|
39
|
+
__properties: ClassVar[List[str]] = ["items", "nextPageToken"]
|
|
40
|
+
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
validate_by_name=True,
|
|
43
|
+
validate_by_alias=True,
|
|
44
|
+
validate_assignment=True,
|
|
45
|
+
protected_namespaces=(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
55
|
+
|
|
56
|
+
@classmethod
|
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
58
|
+
"""Create an instance of ListAutomationsResponse from a JSON string"""
|
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
|
60
|
+
|
|
61
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
62
|
+
"""Return the dictionary representation of the model using alias.
|
|
63
|
+
|
|
64
|
+
This has the following differences from calling pydantic's
|
|
65
|
+
`self.model_dump(by_alias=True)`:
|
|
66
|
+
|
|
67
|
+
* `None` is only added to the output dict for nullable fields that
|
|
68
|
+
were set at model initialization. Other fields with value `None`
|
|
69
|
+
are ignored.
|
|
70
|
+
"""
|
|
71
|
+
excluded_fields: Set[str] = set([])
|
|
72
|
+
|
|
73
|
+
_dict = self.model_dump(
|
|
74
|
+
by_alias=True,
|
|
75
|
+
exclude=excluded_fields,
|
|
76
|
+
exclude_none=True,
|
|
77
|
+
)
|
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
|
79
|
+
_items = []
|
|
80
|
+
if self.items:
|
|
81
|
+
for _item_items in self.items:
|
|
82
|
+
if _item_items:
|
|
83
|
+
_items.append(_item_items.to_dict())
|
|
84
|
+
_dict["items"] = _items
|
|
85
|
+
return _dict
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
89
|
+
"""Create an instance of ListAutomationsResponse from a dict"""
|
|
90
|
+
if obj is None:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
if not isinstance(obj, dict):
|
|
94
|
+
return cls.model_validate(obj)
|
|
95
|
+
|
|
96
|
+
_obj = cls.model_validate(
|
|
97
|
+
{
|
|
98
|
+
"items": (
|
|
99
|
+
[ListAutomationsItem.from_dict(_item) for _item in obj["items"]]
|
|
100
|
+
if obj.get("items") is not None
|
|
101
|
+
else None
|
|
102
|
+
),
|
|
103
|
+
"nextPageToken": obj.get("nextPageToken"),
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
return _obj
|
|
@@ -0,0 +1,129 @@
|
|
|
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
|
+
|
|
29
|
+
class ListExecutionsItem(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
ListExecutionsItem
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
|
|
34
|
+
create_time: datetime = Field(alias="createTime")
|
|
35
|
+
end_time: Optional[datetime] = Field(default=None, alias="endTime")
|
|
36
|
+
id: UUID
|
|
37
|
+
status: StrictStr
|
|
38
|
+
__properties: ClassVar[List[str]] = ["createTime", "endTime", "id", "status"]
|
|
39
|
+
|
|
40
|
+
@field_validator("create_time", mode="before")
|
|
41
|
+
def create_time_change_year_zero_to_one(cls, value):
|
|
42
|
+
"""Workaround which prevents year 0 issue"""
|
|
43
|
+
if isinstance(value, str):
|
|
44
|
+
# Check for year "0000" at the beginning of the string
|
|
45
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
46
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
47
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
48
|
+
):
|
|
49
|
+
# Workaround: Replace "0000" with "0001"
|
|
50
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
51
|
+
return value
|
|
52
|
+
|
|
53
|
+
@field_validator("end_time", mode="before")
|
|
54
|
+
def end_time_change_year_zero_to_one(cls, value):
|
|
55
|
+
"""Workaround which prevents year 0 issue"""
|
|
56
|
+
if isinstance(value, str):
|
|
57
|
+
# Check for year "0000" at the beginning of the string
|
|
58
|
+
# This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
|
|
59
|
+
if value.startswith("0000-01-01T") and re.match(
|
|
60
|
+
r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
|
|
61
|
+
):
|
|
62
|
+
# Workaround: Replace "0000" with "0001"
|
|
63
|
+
return "0001" + value[4:] # Take "0001" and append the rest of the string
|
|
64
|
+
return value
|
|
65
|
+
|
|
66
|
+
@field_validator("status")
|
|
67
|
+
def status_validate_enum(cls, value):
|
|
68
|
+
"""Validates the enum"""
|
|
69
|
+
if value not in set(["PENDING", "RUNNING", "COMPLETED", "FAILED", "TERMINATED"]):
|
|
70
|
+
raise ValueError("must be one of enum values ('PENDING', 'RUNNING', 'COMPLETED', 'FAILED', 'TERMINATED')")
|
|
71
|
+
return value
|
|
72
|
+
|
|
73
|
+
model_config = ConfigDict(
|
|
74
|
+
validate_by_name=True,
|
|
75
|
+
validate_by_alias=True,
|
|
76
|
+
validate_assignment=True,
|
|
77
|
+
protected_namespaces=(),
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
def to_str(self) -> str:
|
|
81
|
+
"""Returns the string representation of the model using alias"""
|
|
82
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
83
|
+
|
|
84
|
+
def to_json(self) -> str:
|
|
85
|
+
"""Returns the JSON representation of the model using alias"""
|
|
86
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
90
|
+
"""Create an instance of ListExecutionsItem from a JSON string"""
|
|
91
|
+
return cls.from_dict(json.loads(json_str))
|
|
92
|
+
|
|
93
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
94
|
+
"""Return the dictionary representation of the model using alias.
|
|
95
|
+
|
|
96
|
+
This has the following differences from calling pydantic's
|
|
97
|
+
`self.model_dump(by_alias=True)`:
|
|
98
|
+
|
|
99
|
+
* `None` is only added to the output dict for nullable fields that
|
|
100
|
+
were set at model initialization. Other fields with value `None`
|
|
101
|
+
are ignored.
|
|
102
|
+
"""
|
|
103
|
+
excluded_fields: Set[str] = set([])
|
|
104
|
+
|
|
105
|
+
_dict = self.model_dump(
|
|
106
|
+
by_alias=True,
|
|
107
|
+
exclude=excluded_fields,
|
|
108
|
+
exclude_none=True,
|
|
109
|
+
)
|
|
110
|
+
return _dict
|
|
111
|
+
|
|
112
|
+
@classmethod
|
|
113
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
114
|
+
"""Create an instance of ListExecutionsItem from a dict"""
|
|
115
|
+
if obj is None:
|
|
116
|
+
return None
|
|
117
|
+
|
|
118
|
+
if not isinstance(obj, dict):
|
|
119
|
+
return cls.model_validate(obj)
|
|
120
|
+
|
|
121
|
+
_obj = cls.model_validate(
|
|
122
|
+
{
|
|
123
|
+
"createTime": obj.get("createTime"),
|
|
124
|
+
"endTime": obj.get("endTime"),
|
|
125
|
+
"id": obj.get("id"),
|
|
126
|
+
"status": obj.get("status"),
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
return _obj
|