stackit-sfs 0.4.0__tar.gz → 0.5.0__tar.gz

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.
Files changed (67) hide show
  1. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/PKG-INFO +1 -1
  2. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/pyproject.toml +1 -1
  3. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/__init__.py +4 -0
  4. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/__init__.py +3 -0
  5. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/snapshot_policy.py +30 -2
  6. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/snapshot_policy_schedule.py +13 -5
  7. stackit_sfs-0.5.0/src/stackit/sfs/models/snapshot_policy_snapshot_policy_schedule.py +126 -0
  8. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/.gitignore +0 -0
  9. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/LICENSE.md +0 -0
  10. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/NOTICE.txt +0 -0
  11. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/README.md +0 -0
  12. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/api/__init__.py +0 -0
  13. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/api/default_api.py +0 -0
  14. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/api_client.py +0 -0
  15. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/api_response.py +0 -0
  16. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/configuration.py +0 -0
  17. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/exceptions.py +0 -0
  18. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/create_resource_pool_payload.py +0 -0
  19. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/create_resource_pool_response.py +0 -0
  20. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/create_resource_pool_snapshot_payload.py +0 -0
  21. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/create_resource_pool_snapshot_response.py +0 -0
  22. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/create_share_export_policy_payload.py +0 -0
  23. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/create_share_export_policy_request_rule.py +0 -0
  24. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/create_share_export_policy_response.py +0 -0
  25. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/create_share_payload.py +0 -0
  26. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/create_share_response.py +0 -0
  27. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/enable_lock_response.py +0 -0
  28. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/error.py +0 -0
  29. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/get_lock_response.py +0 -0
  30. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/get_resource_pool_response.py +0 -0
  31. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/get_resource_pool_snapshot_response.py +0 -0
  32. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/get_schedule_response.py +0 -0
  33. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/get_share_export_policy_response.py +0 -0
  34. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/get_share_response.py +0 -0
  35. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/get_snapshot_policy_response.py +0 -0
  36. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/google_protobuf_any.py +0 -0
  37. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/list_performance_classes_response.py +0 -0
  38. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/list_resource_pool_snapshots_response.py +0 -0
  39. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/list_resource_pools_response.py +0 -0
  40. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/list_schedules_response.py +0 -0
  41. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/list_share_export_policies_response.py +0 -0
  42. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/list_shares_response.py +0 -0
  43. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/list_snapshot_policies_response.py +0 -0
  44. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/performance_class.py +0 -0
  45. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/resource_pool.py +0 -0
  46. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/resource_pool_performance_class.py +0 -0
  47. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/resource_pool_snapshot.py +0 -0
  48. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/resource_pool_snapshot_policy.py +0 -0
  49. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/resource_pool_space.py +0 -0
  50. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/schedule.py +0 -0
  51. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/share.py +0 -0
  52. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/share_export_policy.py +0 -0
  53. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/share_export_policy_rule.py +0 -0
  54. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/status.py +0 -0
  55. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/update_resource_pool_payload.py +0 -0
  56. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/update_resource_pool_response.py +0 -0
  57. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/update_resource_pool_snapshot_payload.py +0 -0
  58. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/update_resource_pool_snapshot_response.py +0 -0
  59. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/update_share_export_policy_body_rule.py +0 -0
  60. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/update_share_export_policy_payload.py +0 -0
  61. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/update_share_export_policy_response.py +0 -0
  62. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/update_share_payload.py +0 -0
  63. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/update_share_response.py +0 -0
  64. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/validation_error.py +0 -0
  65. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/models/validation_error_field.py +0 -0
  66. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/py.typed +0 -0
  67. {stackit_sfs-0.4.0 → stackit_sfs-0.5.0}/src/stackit/sfs/rest.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stackit-sfs
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: STACKIT File Storage (SFS)
5
5
  Project-URL: Homepage, https://github.com/stackitcloud/stackit-sdk-python
6
6
  Project-URL: Issues, https://github.com/stackitcloud/stackit-sdk-python/issues
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "stackit-sfs"
3
- version = "v0.4.0"
3
+ version = "v0.5.0"
4
4
  description = "STACKIT File Storage (SFS)"
5
5
  authors = [{ name = "STACKIT Developer Tools", email = "developer-tools@stackit.cloud" }]
6
6
  requires-python = ">=3.9,<4"
@@ -66,6 +66,7 @@ __all__ = [
66
66
  "ShareExportPolicyRule",
67
67
  "SnapshotPolicy",
68
68
  "SnapshotPolicySchedule",
69
+ "SnapshotPolicySnapshotPolicySchedule",
69
70
  "Status",
70
71
  "UpdateResourcePoolPayload",
71
72
  "UpdateResourcePoolResponse",
@@ -193,6 +194,9 @@ from stackit.sfs.models.snapshot_policy import SnapshotPolicy as SnapshotPolicy
193
194
  from stackit.sfs.models.snapshot_policy_schedule import (
194
195
  SnapshotPolicySchedule as SnapshotPolicySchedule,
195
196
  )
197
+ from stackit.sfs.models.snapshot_policy_snapshot_policy_schedule import (
198
+ SnapshotPolicySnapshotPolicySchedule as SnapshotPolicySnapshotPolicySchedule,
199
+ )
196
200
  from stackit.sfs.models.status import Status as Status
197
201
  from stackit.sfs.models.update_resource_pool_payload import (
198
202
  UpdateResourcePoolPayload as UpdateResourcePoolPayload,
@@ -75,6 +75,9 @@ from stackit.sfs.models.share_export_policy import ShareExportPolicy
75
75
  from stackit.sfs.models.share_export_policy_rule import ShareExportPolicyRule
76
76
  from stackit.sfs.models.snapshot_policy import SnapshotPolicy
77
77
  from stackit.sfs.models.snapshot_policy_schedule import SnapshotPolicySchedule
78
+ from stackit.sfs.models.snapshot_policy_snapshot_policy_schedule import (
79
+ SnapshotPolicySnapshotPolicySchedule,
80
+ )
78
81
  from stackit.sfs.models.status import Status
79
82
  from stackit.sfs.models.update_resource_pool_payload import UpdateResourcePoolPayload
80
83
  from stackit.sfs.models.update_resource_pool_response import UpdateResourcePoolResponse
@@ -30,6 +30,9 @@ from pydantic import (
30
30
  from typing_extensions import Self
31
31
 
32
32
  from stackit.sfs.models.snapshot_policy_schedule import SnapshotPolicySchedule
33
+ from stackit.sfs.models.snapshot_policy_snapshot_policy_schedule import (
34
+ SnapshotPolicySnapshotPolicySchedule,
35
+ )
33
36
 
34
37
 
35
38
  class SnapshotPolicy(BaseModel):
@@ -42,8 +45,21 @@ class SnapshotPolicy(BaseModel):
42
45
  enabled: Optional[StrictBool] = Field(default=None, description="Wether the Snapshot Policy is enabled")
43
46
  id: Optional[StrictStr] = Field(default=None, description="ID of the Snapshot Policy")
44
47
  name: Optional[StrictStr] = Field(default=None, description="Name of the Snapshot Policy")
45
- schedules: Optional[List[SnapshotPolicySchedule]] = Field(default=None, description="associated schedules")
46
- __properties: ClassVar[List[str]] = ["comment", "createdAt", "enabled", "id", "name", "schedules"]
48
+ schedules: Optional[List[SnapshotPolicySchedule]] = Field(
49
+ default=None, description="(deprecated) associated schedules"
50
+ )
51
+ snapshot_schedules: Optional[List[SnapshotPolicySnapshotPolicySchedule]] = Field(
52
+ default=None, description="associated schedules", alias="snapshotSchedules"
53
+ )
54
+ __properties: ClassVar[List[str]] = [
55
+ "comment",
56
+ "createdAt",
57
+ "enabled",
58
+ "id",
59
+ "name",
60
+ "schedules",
61
+ "snapshotSchedules",
62
+ ]
47
63
 
48
64
  @field_validator("created_at", mode="before")
49
65
  def created_at_change_year_zero_to_one(cls, value):
@@ -102,6 +118,13 @@ class SnapshotPolicy(BaseModel):
102
118
  if _item_schedules:
103
119
  _items.append(_item_schedules.to_dict())
104
120
  _dict["schedules"] = _items
121
+ # override the default output from pydantic by calling `to_dict()` of each item in snapshot_schedules (list)
122
+ _items = []
123
+ if self.snapshot_schedules:
124
+ for _item_snapshot_schedules in self.snapshot_schedules:
125
+ if _item_snapshot_schedules:
126
+ _items.append(_item_snapshot_schedules.to_dict())
127
+ _dict["snapshotSchedules"] = _items
105
128
  return _dict
106
129
 
107
130
  @classmethod
@@ -125,6 +148,11 @@ class SnapshotPolicy(BaseModel):
125
148
  if obj.get("schedules") is not None
126
149
  else None
127
150
  ),
151
+ "snapshotSchedules": (
152
+ [SnapshotPolicySnapshotPolicySchedule.from_dict(_item) for _item in obj["snapshotSchedules"]]
153
+ if obj.get("snapshotSchedules") is not None
154
+ else None
155
+ ),
128
156
  }
129
157
  )
130
158
  return _obj
@@ -26,11 +26,18 @@ class SnapshotPolicySchedule(BaseModel):
26
26
  SnapshotPolicySchedule
27
27
  """ # noqa: E501
28
28
 
29
- count: Optional[StrictInt] = None
30
- prefix: Optional[StrictStr] = None
31
- retention_period: Optional[StrictStr] = Field(default=None, alias="retentionPeriod")
32
- schedule_id: Optional[StrictStr] = Field(default=None, alias="scheduleId")
33
- __properties: ClassVar[List[str]] = ["count", "prefix", "retentionPeriod", "scheduleId"]
29
+ count: Optional[StrictInt] = Field(default=None, description="Retention Count")
30
+ interval: Optional[StrictStr] = Field(
31
+ default=None, description="Interval of the Schedule (follows the cron schedule expression in Unix-like systems)"
32
+ )
33
+ prefix: Optional[StrictStr] = Field(
34
+ default=None, description="Prefix used for the snapshots created by this policy"
35
+ )
36
+ retention_period: Optional[StrictStr] = Field(
37
+ default=None, description='Retention Period (ISO 8601 format or "infinite")', alias="retentionPeriod"
38
+ )
39
+ schedule_id: Optional[StrictStr] = Field(default=None, description="ID of the Schedule", alias="scheduleId")
40
+ __properties: ClassVar[List[str]] = ["count", "interval", "prefix", "retentionPeriod", "scheduleId"]
34
41
 
35
42
  model_config = ConfigDict(
36
43
  populate_by_name=True,
@@ -83,6 +90,7 @@ class SnapshotPolicySchedule(BaseModel):
83
90
  _obj = cls.model_validate(
84
91
  {
85
92
  "count": obj.get("count"),
93
+ "interval": obj.get("interval"),
86
94
  "prefix": obj.get("prefix"),
87
95
  "retentionPeriod": obj.get("retentionPeriod"),
88
96
  "scheduleId": obj.get("scheduleId"),
@@ -0,0 +1,126 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ STACKIT File Storage (SFS)
5
+
6
+ API used to create and manage NFS Shares.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ from __future__ import annotations
15
+
16
+ import json
17
+ import pprint
18
+ import re # noqa: F401
19
+ from datetime import datetime
20
+ from typing import Any, ClassVar, Dict, List, Optional, Set
21
+
22
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
23
+ from typing_extensions import Self
24
+
25
+
26
+ class SnapshotPolicySnapshotPolicySchedule(BaseModel):
27
+ """
28
+ SnapshotPolicySnapshotPolicySchedule
29
+ """ # noqa: E501
30
+
31
+ created_at: Optional[datetime] = Field(default=None, alias="createdAt")
32
+ id: Optional[StrictStr] = Field(default=None, description="ID of the Schedule")
33
+ interval: Optional[StrictStr] = Field(
34
+ default=None, description="Interval of the Schedule (follows the cron schedule expression in Unix-like systems)"
35
+ )
36
+ name: Optional[StrictStr] = Field(default=None, description="Name of the Schedule")
37
+ prefix: Optional[StrictStr] = Field(
38
+ default=None, description="Prefix used for the snapshots created by this policy"
39
+ )
40
+ retention_count: Optional[StrictInt] = Field(default=None, description="Retention Count", alias="retentionCount")
41
+ retention_period: Optional[StrictStr] = Field(
42
+ default=None, description='Retention Period (ISO 8601 format or "infinite")', alias="retentionPeriod"
43
+ )
44
+ __properties: ClassVar[List[str]] = [
45
+ "createdAt",
46
+ "id",
47
+ "interval",
48
+ "name",
49
+ "prefix",
50
+ "retentionCount",
51
+ "retentionPeriod",
52
+ ]
53
+
54
+ @field_validator("created_at", mode="before")
55
+ def created_at_change_year_zero_to_one(cls, value):
56
+ """Workaround which prevents year 0 issue"""
57
+ if isinstance(value, str):
58
+ # Check for year "0000" at the beginning of the string
59
+ # This assumes common date formats like YYYY-MM-DDTHH:MM:SS+00:00 or YYYY-MM-DDTHH:MM:SSZ
60
+ if value.startswith("0000-01-01T") and re.match(
61
+ r"^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\+\d{2}:\d{2}|Z)$", value
62
+ ):
63
+ # Workaround: Replace "0000" with "0001"
64
+ return "0001" + value[4:] # Take "0001" and append the rest of the string
65
+ return value
66
+
67
+ model_config = ConfigDict(
68
+ populate_by_name=True,
69
+ validate_assignment=True,
70
+ protected_namespaces=(),
71
+ )
72
+
73
+ def to_str(self) -> str:
74
+ """Returns the string representation of the model using alias"""
75
+ return pprint.pformat(self.model_dump(by_alias=True))
76
+
77
+ def to_json(self) -> str:
78
+ """Returns the JSON representation of the model using alias"""
79
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
80
+ return json.dumps(self.to_dict())
81
+
82
+ @classmethod
83
+ def from_json(cls, json_str: str) -> Optional[Self]:
84
+ """Create an instance of SnapshotPolicySnapshotPolicySchedule from a JSON string"""
85
+ return cls.from_dict(json.loads(json_str))
86
+
87
+ def to_dict(self) -> Dict[str, Any]:
88
+ """Return the dictionary representation of the model using alias.
89
+
90
+ This has the following differences from calling pydantic's
91
+ `self.model_dump(by_alias=True)`:
92
+
93
+ * `None` is only added to the output dict for nullable fields that
94
+ were set at model initialization. Other fields with value `None`
95
+ are ignored.
96
+ """
97
+ excluded_fields: Set[str] = set([])
98
+
99
+ _dict = self.model_dump(
100
+ by_alias=True,
101
+ exclude=excluded_fields,
102
+ exclude_none=True,
103
+ )
104
+ return _dict
105
+
106
+ @classmethod
107
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
108
+ """Create an instance of SnapshotPolicySnapshotPolicySchedule from a dict"""
109
+ if obj is None:
110
+ return None
111
+
112
+ if not isinstance(obj, dict):
113
+ return cls.model_validate(obj)
114
+
115
+ _obj = cls.model_validate(
116
+ {
117
+ "createdAt": obj.get("createdAt"),
118
+ "id": obj.get("id"),
119
+ "interval": obj.get("interval"),
120
+ "name": obj.get("name"),
121
+ "prefix": obj.get("prefix"),
122
+ "retentionCount": obj.get("retentionCount"),
123
+ "retentionPeriod": obj.get("retentionPeriod"),
124
+ }
125
+ )
126
+ return _obj
File without changes
File without changes
File without changes
File without changes