Skip to content

Commit bc96527

Browse files
Generator: Update SDK /services/secretsmanager (#2784)
* Generate secretsmanager * Add changelogs Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de> --------- Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de> Co-authored-by: Alexander Dahmen <alexander.dahmen@inovex.de>
1 parent 04941ea commit bc96527

File tree

10 files changed

+145
-5
lines changed

10 files changed

+145
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
## Release (2026-xx-xx)
2+
- `secretsmanager` [v0.4.0](services/secretsmanager/CHANGELOG.md#v040)
3+
- **Feature:** added KmsKey model
4+
- **Feature:** added KmsKey to Instance, CreateInstancePayload and UpdateInstancePayload
25
- `sfs`: [v0.1.0](services/sfs/CHANGELOG.md#v010)
36
- **New:** STACKIT File Storage (SFS) service
47
- `alb` [v0.7.0](services/alb/CHANGELOG.md#v070)

services/secretsmanager/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v0.4.0
2+
- **Feature:** added KmsKey model
3+
- **Feature:** added KmsKey to Instance, CreateInstancePayload and UpdateInstancePayload
4+
15
## v0.3.0
26
- **Version**: Minimal version is now python 3.9
37

services/secretsmanager/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "stackit-secretsmanager"
33

44
[tool.poetry]
55
name = "stackit-secretsmanager"
6-
version = "v0.3.0"
6+
version = "v0.4.0"
77
authors = [
88
"STACKIT Developer Tools <developer-tools@stackit.cloud>",
99
]

services/secretsmanager/src/stackit/secretsmanager/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"CreateInstancePayload",
3636
"CreateUserPayload",
3737
"Instance",
38+
"KmsKeyPayload",
3839
"ListACLsResponse",
3940
"ListInstancesResponse",
4041
"ListUsersResponse",
@@ -74,6 +75,7 @@
7475
CreateUserPayload as CreateUserPayload,
7576
)
7677
from stackit.secretsmanager.models.instance import Instance as Instance
78+
from stackit.secretsmanager.models.kms_key_payload import KmsKeyPayload as KmsKeyPayload
7779
from stackit.secretsmanager.models.list_acls_response import (
7880
ListACLsResponse as ListACLsResponse,
7981
)

services/secretsmanager/src/stackit/secretsmanager/api/default_api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def create_acl(
113113
"400": "BadRequest",
114114
"401": "str",
115115
"404": "NotFound",
116+
"409": "Conflict",
116117
"500": None,
117118
}
118119
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -187,6 +188,7 @@ def create_acl_with_http_info(
187188
"400": "BadRequest",
188189
"401": "str",
189190
"404": "NotFound",
191+
"409": "Conflict",
190192
"500": None,
191193
}
192194
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -261,6 +263,7 @@ def create_acl_without_preload_content(
261263
"400": "BadRequest",
262264
"401": "str",
263265
"404": "NotFound",
266+
"409": "Conflict",
264267
"500": None,
265268
}
266269
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -3626,6 +3629,7 @@ def update_acls(
36263629
"400": "BadRequest",
36273630
"401": "str",
36283631
"404": "NotFound",
3632+
"409": "Conflict",
36293633
"500": None,
36303634
}
36313635
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -3700,6 +3704,7 @@ def update_acls_with_http_info(
37003704
"400": "BadRequest",
37013705
"401": "str",
37023706
"404": "NotFound",
3707+
"409": "Conflict",
37033708
"500": None,
37043709
}
37053710
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
@@ -3774,6 +3779,7 @@ def update_acls_without_preload_content(
37743779
"400": "BadRequest",
37753780
"401": "str",
37763781
"404": "NotFound",
3782+
"409": "Conflict",
37773783
"500": None,
37783784
}
37793785
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)

services/secretsmanager/src/stackit/secretsmanager/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from stackit.secretsmanager.models.create_instance_payload import CreateInstancePayload
2222
from stackit.secretsmanager.models.create_user_payload import CreateUserPayload
2323
from stackit.secretsmanager.models.instance import Instance
24+
from stackit.secretsmanager.models.kms_key_payload import KmsKeyPayload
2425
from stackit.secretsmanager.models.list_acls_response import ListACLsResponse
2526
from stackit.secretsmanager.models.list_instances_response import ListInstancesResponse
2627
from stackit.secretsmanager.models.list_users_response import ListUsersResponse

services/secretsmanager/src/stackit/secretsmanager/models/create_instance_payload.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@
2020
from pydantic import BaseModel, ConfigDict, Field, StrictStr
2121
from typing_extensions import Self
2222

23+
from stackit.secretsmanager.models.kms_key_payload import KmsKeyPayload
24+
2325

2426
class CreateInstancePayload(BaseModel):
2527
"""
2628
CreateInstancePayload
2729
""" # noqa: E501
2830

31+
kms_key: Optional[KmsKeyPayload] = Field(default=None, alias="kmsKey")
2932
name: StrictStr = Field(description="A user chosen name to distinguish multiple secrets manager instances.")
30-
__properties: ClassVar[List[str]] = ["name"]
33+
__properties: ClassVar[List[str]] = ["kmsKey", "name"]
3134

3235
model_config = ConfigDict(
3336
populate_by_name=True,
@@ -66,6 +69,9 @@ def to_dict(self) -> Dict[str, Any]:
6669
exclude=excluded_fields,
6770
exclude_none=True,
6871
)
72+
# override the default output from pydantic by calling `to_dict()` of kms_key
73+
if self.kms_key:
74+
_dict["kmsKey"] = self.kms_key.to_dict()
6975
return _dict
7076

7177
@classmethod
@@ -77,5 +83,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
7783
if not isinstance(obj, dict):
7884
return cls.model_validate(obj)
7985

80-
_obj = cls.model_validate({"name": obj.get("name")})
86+
_obj = cls.model_validate(
87+
{
88+
"kmsKey": KmsKeyPayload.from_dict(obj["kmsKey"]) if obj.get("kmsKey") is not None else None,
89+
"name": obj.get("name"),
90+
}
91+
)
8192
return _obj

services/secretsmanager/src/stackit/secretsmanager/models/instance.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
2121
from typing_extensions import Self
2222

23+
from stackit.secretsmanager.models.kms_key_payload import KmsKeyPayload
24+
2325

2426
class Instance(BaseModel):
2527
"""
@@ -37,6 +39,7 @@ class Instance(BaseModel):
3739
alias="creationStartDate",
3840
)
3941
id: StrictStr = Field(description="A auto generated unique id which identifies the secrets manager instances.")
42+
kms_key: Optional[KmsKeyPayload] = Field(default=None, alias="kmsKey")
4043
name: StrictStr = Field(description="A user chosen name to distinguish multiple secrets manager instances.")
4144
secret_count: StrictInt = Field(
4245
description="The number of secrets currently stored inside of the instance. This value will be updated once per hour.",
@@ -51,6 +54,7 @@ class Instance(BaseModel):
5154
"creationFinishedDate",
5255
"creationStartDate",
5356
"id",
57+
"kmsKey",
5458
"name",
5559
"secretCount",
5660
"secretsEngine",
@@ -96,6 +100,9 @@ def to_dict(self) -> Dict[str, Any]:
96100
exclude=excluded_fields,
97101
exclude_none=True,
98102
)
103+
# override the default output from pydantic by calling `to_dict()` of kms_key
104+
if self.kms_key:
105+
_dict["kmsKey"] = self.kms_key.to_dict()
99106
return _dict
100107

101108
@classmethod
@@ -113,6 +120,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
113120
"creationFinishedDate": obj.get("creationFinishedDate"),
114121
"creationStartDate": obj.get("creationStartDate"),
115122
"id": obj.get("id"),
123+
"kmsKey": KmsKeyPayload.from_dict(obj["kmsKey"]) if obj.get("kmsKey") is not None else None,
116124
"name": obj.get("name"),
117125
"secretCount": obj.get("secretCount"),
118126
"secretsEngine": obj.get("secretsEngine"),
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# coding: utf-8
2+
3+
"""
4+
STACKIT Secrets Manager API
5+
6+
This API provides endpoints for managing the Secrets-Manager.
7+
8+
The version of the OpenAPI document: 1.4.1
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+
from typing import Any, ClassVar, Dict, List, Optional, Set
19+
20+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
21+
from typing_extensions import Self
22+
23+
24+
class KmsKeyPayload(BaseModel):
25+
"""
26+
The key for secret encryption and decryption.
27+
""" # noqa: E501
28+
29+
key_id: StrictStr = Field(description="The key UUID.", alias="keyId")
30+
key_ring_id: StrictStr = Field(description="The key ring UUID the key is part of.", alias="keyRingId")
31+
key_version: StrictInt = Field(description="The Key version number.", alias="keyVersion")
32+
service_account_email: StrictStr = Field(
33+
description="The Service account email that will consume the key. Must be in the same project as the Secrets Manager instance.",
34+
alias="serviceAccountEmail",
35+
)
36+
__properties: ClassVar[List[str]] = ["keyId", "keyRingId", "keyVersion", "serviceAccountEmail"]
37+
38+
model_config = ConfigDict(
39+
populate_by_name=True,
40+
validate_assignment=True,
41+
protected_namespaces=(),
42+
)
43+
44+
def to_str(self) -> str:
45+
"""Returns the string representation of the model using alias"""
46+
return pprint.pformat(self.model_dump(by_alias=True))
47+
48+
def to_json(self) -> str:
49+
"""Returns the JSON representation of the model using alias"""
50+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51+
return json.dumps(self.to_dict())
52+
53+
@classmethod
54+
def from_json(cls, json_str: str) -> Optional[Self]:
55+
"""Create an instance of KmsKeyPayload from a JSON string"""
56+
return cls.from_dict(json.loads(json_str))
57+
58+
def to_dict(self) -> Dict[str, Any]:
59+
"""Return the dictionary representation of the model using alias.
60+
61+
This has the following differences from calling pydantic's
62+
`self.model_dump(by_alias=True)`:
63+
64+
* `None` is only added to the output dict for nullable fields that
65+
were set at model initialization. Other fields with value `None`
66+
are ignored.
67+
"""
68+
excluded_fields: Set[str] = set([])
69+
70+
_dict = self.model_dump(
71+
by_alias=True,
72+
exclude=excluded_fields,
73+
exclude_none=True,
74+
)
75+
return _dict
76+
77+
@classmethod
78+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79+
"""Create an instance of KmsKeyPayload 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+
{
88+
"keyId": obj.get("keyId"),
89+
"keyRingId": obj.get("keyRingId"),
90+
"keyVersion": obj.get("keyVersion"),
91+
"serviceAccountEmail": obj.get("serviceAccountEmail"),
92+
}
93+
)
94+
return _obj

services/secretsmanager/src/stackit/secretsmanager/models/update_instance_payload.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@
2020
from pydantic import BaseModel, ConfigDict, Field, StrictStr
2121
from typing_extensions import Self
2222

23+
from stackit.secretsmanager.models.kms_key_payload import KmsKeyPayload
24+
2325

2426
class UpdateInstancePayload(BaseModel):
2527
"""
2628
UpdateInstancePayload
2729
""" # noqa: E501
2830

31+
kms_key: Optional[KmsKeyPayload] = Field(default=None, alias="kmsKey")
2932
name: StrictStr = Field(description="A user chosen name to distinguish multiple secrets manager instances.")
30-
__properties: ClassVar[List[str]] = ["name"]
33+
__properties: ClassVar[List[str]] = ["kmsKey", "name"]
3134

3235
model_config = ConfigDict(
3336
populate_by_name=True,
@@ -66,6 +69,9 @@ def to_dict(self) -> Dict[str, Any]:
6669
exclude=excluded_fields,
6770
exclude_none=True,
6871
)
72+
# override the default output from pydantic by calling `to_dict()` of kms_key
73+
if self.kms_key:
74+
_dict["kmsKey"] = self.kms_key.to_dict()
6975
return _dict
7076

7177
@classmethod
@@ -77,5 +83,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
7783
if not isinstance(obj, dict):
7884
return cls.model_validate(obj)
7985

80-
_obj = cls.model_validate({"name": obj.get("name")})
86+
_obj = cls.model_validate(
87+
{
88+
"kmsKey": KmsKeyPayload.from_dict(obj["kmsKey"]) if obj.get("kmsKey") is not None else None,
89+
"name": obj.get("name"),
90+
}
91+
)
8192
return _obj

0 commit comments

Comments
 (0)