From 7f2266c5c851b655f95d2f7e28e110cc0af87688 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Fri, 6 Mar 2026 10:54:11 +0000 Subject: [PATCH] Generate secretsmanager --- services/secretsmanager/oas_commit | 2 +- .../src/stackit/secretsmanager/__init__.py | 22 + .../stackit/secretsmanager/api/default_api.py | 3183 +++++++++++++++-- .../stackit/secretsmanager/models/__init__.py | 9 + .../stackit/secretsmanager/models/approle.py | 113 + .../secretsmanager/models/approle_list.py | 96 + .../secretsmanager/models/approle_secret.py | 107 + .../models/approle_secret_list.py | 98 + .../models/create_approle_payload.py | 115 + .../models/create_approle_secret_payload.py | 83 + .../models/update_approle_payload.py | 112 + 11 files changed, 3642 insertions(+), 298 deletions(-) create mode 100644 services/secretsmanager/src/stackit/secretsmanager/models/approle.py create mode 100644 services/secretsmanager/src/stackit/secretsmanager/models/approle_list.py create mode 100644 services/secretsmanager/src/stackit/secretsmanager/models/approle_secret.py create mode 100644 services/secretsmanager/src/stackit/secretsmanager/models/approle_secret_list.py create mode 100644 services/secretsmanager/src/stackit/secretsmanager/models/create_approle_payload.py create mode 100644 services/secretsmanager/src/stackit/secretsmanager/models/create_approle_secret_payload.py create mode 100644 services/secretsmanager/src/stackit/secretsmanager/models/update_approle_payload.py diff --git a/services/secretsmanager/oas_commit b/services/secretsmanager/oas_commit index 85295bf53..f5e4510f9 100644 --- a/services/secretsmanager/oas_commit +++ b/services/secretsmanager/oas_commit @@ -1 +1 @@ -9ba4c1ad01406fe6d0399b971043a2f9f74ea510 +73b7457504497158e2836857f5ca4d2e6186ee5d diff --git a/services/secretsmanager/src/stackit/secretsmanager/__init__.py b/services/secretsmanager/src/stackit/secretsmanager/__init__.py index af1d2751d..23b92920e 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/__init__.py +++ b/services/secretsmanager/src/stackit/secretsmanager/__init__.py @@ -29,9 +29,15 @@ "ApiAttributeError", "ApiException", "ACL", + "Approle", + "ApproleList", + "ApproleSecret", + "ApproleSecretList", "BadRequest", "Conflict", "CreateACLPayload", + "CreateApprolePayload", + "CreateApproleSecretPayload", "CreateInstancePayload", "CreateUserPayload", "Instance", @@ -42,6 +48,7 @@ "NotFound", "UpdateACLPayload", "UpdateACLsPayload", + "UpdateApprolePayload", "UpdateInstancePayload", "UpdateUserPayload", "User", @@ -63,11 +70,23 @@ # import models into sdk package from stackit.secretsmanager.models.acl import ACL as ACL +from stackit.secretsmanager.models.approle import Approle as Approle +from stackit.secretsmanager.models.approle_list import ApproleList as ApproleList +from stackit.secretsmanager.models.approle_secret import ApproleSecret as ApproleSecret +from stackit.secretsmanager.models.approle_secret_list import ( + ApproleSecretList as ApproleSecretList, +) from stackit.secretsmanager.models.bad_request import BadRequest as BadRequest from stackit.secretsmanager.models.conflict import Conflict as Conflict from stackit.secretsmanager.models.create_acl_payload import ( CreateACLPayload as CreateACLPayload, ) +from stackit.secretsmanager.models.create_approle_payload import ( + CreateApprolePayload as CreateApprolePayload, +) +from stackit.secretsmanager.models.create_approle_secret_payload import ( + CreateApproleSecretPayload as CreateApproleSecretPayload, +) from stackit.secretsmanager.models.create_instance_payload import ( CreateInstancePayload as CreateInstancePayload, ) @@ -92,6 +111,9 @@ from stackit.secretsmanager.models.update_acls_payload import ( UpdateACLsPayload as UpdateACLsPayload, ) +from stackit.secretsmanager.models.update_approle_payload import ( + UpdateApprolePayload as UpdateApprolePayload, +) from stackit.secretsmanager.models.update_instance_payload import ( UpdateInstancePayload as UpdateInstancePayload, ) diff --git a/services/secretsmanager/src/stackit/secretsmanager/api/default_api.py b/services/secretsmanager/src/stackit/secretsmanager/api/default_api.py index 6c238c8a7..dd8851198 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/api/default_api.py +++ b/services/secretsmanager/src/stackit/secretsmanager/api/default_api.py @@ -20,7 +20,15 @@ from stackit.secretsmanager.api_client import ApiClient, RequestSerialized from stackit.secretsmanager.api_response import ApiResponse from stackit.secretsmanager.models.acl import ACL +from stackit.secretsmanager.models.approle import Approle +from stackit.secretsmanager.models.approle_list import ApproleList +from stackit.secretsmanager.models.approle_secret import ApproleSecret +from stackit.secretsmanager.models.approle_secret_list import ApproleSecretList from stackit.secretsmanager.models.create_acl_payload import CreateACLPayload +from stackit.secretsmanager.models.create_approle_payload import CreateApprolePayload +from stackit.secretsmanager.models.create_approle_secret_payload import ( + CreateApproleSecretPayload, +) from stackit.secretsmanager.models.create_instance_payload import CreateInstancePayload from stackit.secretsmanager.models.create_user_payload import CreateUserPayload from stackit.secretsmanager.models.instance import Instance @@ -29,6 +37,7 @@ from stackit.secretsmanager.models.list_users_response import ListUsersResponse from stackit.secretsmanager.models.update_acl_payload import UpdateACLPayload from stackit.secretsmanager.models.update_acls_payload import UpdateACLsPayload +from stackit.secretsmanager.models.update_approle_payload import UpdateApprolePayload from stackit.secretsmanager.models.update_instance_payload import UpdateInstancePayload from stackit.secretsmanager.models.update_user_payload import UpdateUserPayload from stackit.secretsmanager.models.user import User @@ -334,12 +343,13 @@ def _create_acl_serialize( ) @validate_call - def create_instance( + def create_approle( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], - create_instance_payload: CreateInstancePayload, + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + create_approle_payload: CreateApprolePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -349,15 +359,17 @@ def create_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Instance: - """create_instance + ) -> Approle: + """create_approle - Creates a new Secrets Manager instance within the project. + Creates a new approle for the given Secrets Manager instance. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str - :param create_instance_payload: (required) - :type create_instance_payload: CreateInstancePayload + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param create_approle_payload: (required) + :type create_approle_payload: CreateApprolePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -380,9 +392,10 @@ def create_instance( :return: Returns the result object. """ # noqa: E501 - _param = self._create_instance_serialize( + _param = self._create_approle_serialize( project_id=project_id, - create_instance_payload=create_instance_payload, + instance_id=instance_id, + create_approle_payload=create_approle_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -390,9 +403,11 @@ def create_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Instance", + "201": "Approle", "400": "BadRequest", "401": "str", + "404": "NotFound", + "409": "Conflict", "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -403,12 +418,13 @@ def create_instance( ).data @validate_call - def create_instance_with_http_info( + def create_approle_with_http_info( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], - create_instance_payload: CreateInstancePayload, + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + create_approle_payload: CreateApprolePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -418,15 +434,17 @@ def create_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Instance]: - """create_instance + ) -> ApiResponse[Approle]: + """create_approle - Creates a new Secrets Manager instance within the project. + Creates a new approle for the given Secrets Manager instance. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str - :param create_instance_payload: (required) - :type create_instance_payload: CreateInstancePayload + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param create_approle_payload: (required) + :type create_approle_payload: CreateApprolePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -449,9 +467,10 @@ def create_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_instance_serialize( + _param = self._create_approle_serialize( project_id=project_id, - create_instance_payload=create_instance_payload, + instance_id=instance_id, + create_approle_payload=create_approle_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -459,9 +478,11 @@ def create_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Instance", + "201": "Approle", "400": "BadRequest", "401": "str", + "404": "NotFound", + "409": "Conflict", "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -472,12 +493,13 @@ def create_instance_with_http_info( ) @validate_call - def create_instance_without_preload_content( + def create_approle_without_preload_content( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], - create_instance_payload: CreateInstancePayload, + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + create_approle_payload: CreateApprolePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -488,14 +510,16 @@ def create_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """create_instance + """create_approle - Creates a new Secrets Manager instance within the project. + Creates a new approle for the given Secrets Manager instance. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str - :param create_instance_payload: (required) - :type create_instance_payload: CreateInstancePayload + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param create_approle_payload: (required) + :type create_approle_payload: CreateApprolePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -518,9 +542,10 @@ def create_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_instance_serialize( + _param = self._create_approle_serialize( project_id=project_id, - create_instance_payload=create_instance_payload, + instance_id=instance_id, + create_approle_payload=create_approle_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -528,18 +553,21 @@ def create_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "Instance", + "201": "Approle", "400": "BadRequest", "401": "str", + "404": "NotFound", + "409": "Conflict", "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_instance_serialize( + def _create_approle_serialize( self, project_id, - create_instance_payload, + instance_id, + create_approle_payload, _request_auth, _content_type, _headers, @@ -560,12 +588,14 @@ def _create_instance_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if create_instance_payload is not None: - _body_params = create_instance_payload + if create_approle_payload is not None: + _body_params = create_approle_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -584,7 +614,7 @@ def _create_instance_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/instances", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/approles", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -598,13 +628,16 @@ def _create_instance_serialize( ) @validate_call - def create_user( + def create_approle_secret( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], - create_user_payload: CreateUserPayload, + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + create_approle_secret_payload: CreateApproleSecretPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -614,17 +647,19 @@ def create_user( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> User: - """create_user + ) -> ApproleSecret: + """create_approle_secret - Creates a new user for the given Secrets Manager instance. + Generate new secret id for the given approle. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str - :param create_user_payload: (required) - :type create_user_payload: CreateUserPayload + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param create_approle_secret_payload: (required) + :type create_approle_secret_payload: CreateApproleSecretPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -647,10 +682,11 @@ def create_user( :return: Returns the result object. """ # noqa: E501 - _param = self._create_user_serialize( + _param = self._create_approle_secret_serialize( project_id=project_id, instance_id=instance_id, - create_user_payload=create_user_payload, + role_id=role_id, + create_approle_secret_payload=create_approle_secret_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -658,11 +694,10 @@ def create_user( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", + "201": "ApproleSecret", "400": "BadRequest", "401": "str", "404": "NotFound", - "409": "Conflict", "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -673,13 +708,16 @@ def create_user( ).data @validate_call - def create_user_with_http_info( + def create_approle_secret_with_http_info( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], - create_user_payload: CreateUserPayload, + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + create_approle_secret_payload: CreateApproleSecretPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -689,17 +727,19 @@ def create_user_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[User]: - """create_user + ) -> ApiResponse[ApproleSecret]: + """create_approle_secret - Creates a new user for the given Secrets Manager instance. + Generate new secret id for the given approle. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str - :param create_user_payload: (required) - :type create_user_payload: CreateUserPayload + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param create_approle_secret_payload: (required) + :type create_approle_secret_payload: CreateApproleSecretPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -722,10 +762,11 @@ def create_user_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_user_serialize( + _param = self._create_approle_secret_serialize( project_id=project_id, instance_id=instance_id, - create_user_payload=create_user_payload, + role_id=role_id, + create_approle_secret_payload=create_approle_secret_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -733,11 +774,10 @@ def create_user_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", + "201": "ApproleSecret", "400": "BadRequest", "401": "str", "404": "NotFound", - "409": "Conflict", "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -748,13 +788,16 @@ def create_user_with_http_info( ) @validate_call - def create_user_without_preload_content( + def create_approle_secret_without_preload_content( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], - create_user_payload: CreateUserPayload, + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + create_approle_secret_payload: CreateApproleSecretPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -765,16 +808,18 @@ def create_user_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """create_user + """create_approle_secret - Creates a new user for the given Secrets Manager instance. + Generate new secret id for the given approle. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str - :param create_user_payload: (required) - :type create_user_payload: CreateUserPayload + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param create_approle_secret_payload: (required) + :type create_approle_secret_payload: CreateApproleSecretPayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -797,10 +842,11 @@ def create_user_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_user_serialize( + _param = self._create_approle_secret_serialize( project_id=project_id, instance_id=instance_id, - create_user_payload=create_user_payload, + role_id=role_id, + create_approle_secret_payload=create_approle_secret_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -808,21 +854,21 @@ def create_user_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", + "201": "ApproleSecret", "400": "BadRequest", "401": "str", "404": "NotFound", - "409": "Conflict", "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_user_serialize( + def _create_approle_secret_serialize( self, project_id, instance_id, - create_user_payload, + role_id, + create_approle_secret_payload, _request_auth, _content_type, _headers, @@ -845,12 +891,14 @@ def _create_user_serialize( _path_params["projectId"] = project_id if instance_id is not None: _path_params["instanceId"] = instance_id + if role_id is not None: + _path_params["roleId"] = role_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if create_user_payload is not None: - _body_params = create_user_payload + if create_approle_secret_payload is not None: + _body_params = create_approle_secret_payload # set the HTTP header `Accept` if "Accept" not in _header_params: @@ -869,7 +917,7 @@ def _create_user_serialize( return self.api_client.param_serialize( method="POST", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/users", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/approles/{roleId}/secrets", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -883,13 +931,12 @@ def _create_user_serialize( ) @validate_call - def delete_acl( + def create_instance( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], - instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], - acl_id: Annotated[StrictStr, Field(description="The acl UUID of the Secrets Manager instance.")], + create_instance_payload: CreateInstancePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -899,17 +946,15 @@ def delete_acl( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """delete_acl + ) -> Instance: + """create_instance - Deletes the given acl. + Creates a new Secrets Manager instance within the project. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str - :param instance_id: The Secrets Manager instance UUID. (required) - :type instance_id: str - :param acl_id: The acl UUID of the Secrets Manager instance. (required) - :type acl_id: str + :param create_instance_payload: (required) + :type create_instance_payload: CreateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -932,10 +977,9 @@ def delete_acl( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_acl_serialize( + _param = self._create_instance_serialize( project_id=project_id, - instance_id=instance_id, - acl_id=acl_id, + create_instance_payload=create_instance_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -943,10 +987,9 @@ def delete_acl( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "Instance", "400": "BadRequest", "401": "str", - "404": "NotFound", "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -957,13 +1000,12 @@ def delete_acl( ).data @validate_call - def delete_acl_with_http_info( + def create_instance_with_http_info( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], - instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], - acl_id: Annotated[StrictStr, Field(description="The acl UUID of the Secrets Manager instance.")], + create_instance_payload: CreateInstancePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -973,17 +1015,15 @@ def delete_acl_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """delete_acl + ) -> ApiResponse[Instance]: + """create_instance - Deletes the given acl. + Creates a new Secrets Manager instance within the project. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str - :param instance_id: The Secrets Manager instance UUID. (required) - :type instance_id: str - :param acl_id: The acl UUID of the Secrets Manager instance. (required) - :type acl_id: str + :param create_instance_payload: (required) + :type create_instance_payload: CreateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1006,10 +1046,9 @@ def delete_acl_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_acl_serialize( + _param = self._create_instance_serialize( project_id=project_id, - instance_id=instance_id, - acl_id=acl_id, + create_instance_payload=create_instance_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1017,10 +1056,9 @@ def delete_acl_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "Instance", "400": "BadRequest", "401": "str", - "404": "NotFound", "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1031,13 +1069,12 @@ def delete_acl_with_http_info( ) @validate_call - def delete_acl_without_preload_content( + def create_instance_without_preload_content( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], - instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], - acl_id: Annotated[StrictStr, Field(description="The acl UUID of the Secrets Manager instance.")], + create_instance_payload: CreateInstancePayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1048,16 +1085,14 @@ def delete_acl_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_acl + """create_instance - Deletes the given acl. + Creates a new Secrets Manager instance within the project. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str - :param instance_id: The Secrets Manager instance UUID. (required) - :type instance_id: str - :param acl_id: The acl UUID of the Secrets Manager instance. (required) - :type acl_id: str + :param create_instance_payload: (required) + :type create_instance_payload: CreateInstancePayload :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1080,10 +1115,9 @@ def delete_acl_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_acl_serialize( + _param = self._create_instance_serialize( project_id=project_id, - instance_id=instance_id, - acl_id=acl_id, + create_instance_payload=create_instance_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1091,20 +1125,18 @@ def delete_acl_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "201": "Instance", "400": "BadRequest", "401": "str", - "404": "NotFound", "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_acl_serialize( + def _create_instance_serialize( self, project_id, - instance_id, - acl_id, + create_instance_payload, _request_auth, _content_type, _headers, @@ -1125,25 +1157,2258 @@ def _delete_acl_serialize( # process the path parameters if project_id is not None: _path_params["projectId"] = project_id - if instance_id is not None: - _path_params["instanceId"] = instance_id - if acl_id is not None: - _path_params["aclId"] = acl_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if create_instance_payload is not None: + _body_params = create_instance_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/acls/{aclId}", + method="POST", + resource_path="/v1/projects/{projectId}/instances", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def create_user( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + create_user_payload: CreateUserPayload, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> User: + """create_user + + Creates a new user for the given Secrets Manager instance. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param create_user_payload: (required) + :type create_user_payload: CreateUserPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_serialize( + project_id=project_id, + instance_id=instance_id, + create_user_payload=create_user_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "User", + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "409": "Conflict", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def create_user_with_http_info( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + create_user_payload: CreateUserPayload, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[User]: + """create_user + + Creates a new user for the given Secrets Manager instance. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param create_user_payload: (required) + :type create_user_payload: CreateUserPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_serialize( + project_id=project_id, + instance_id=instance_id, + create_user_payload=create_user_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "User", + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "409": "Conflict", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def create_user_without_preload_content( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + create_user_payload: CreateUserPayload, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """create_user + + Creates a new user for the given Secrets Manager instance. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param create_user_payload: (required) + :type create_user_payload: CreateUserPayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_serialize( + project_id=project_id, + instance_id=instance_id, + create_user_payload=create_user_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "User", + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "409": "Conflict", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_user_serialize( + self, + project_id, + instance_id, + create_user_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_user_payload is not None: + _body_params = create_user_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/users", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def delete_acl( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + acl_id: Annotated[StrictStr, Field(description="The acl UUID of the Secrets Manager instance.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete_acl + + Deletes the given acl. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param acl_id: The acl UUID of the Secrets Manager instance. (required) + :type acl_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_acl_serialize( + project_id=project_id, + instance_id=instance_id, + acl_id=acl_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_acl_with_http_info( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + acl_id: Annotated[StrictStr, Field(description="The acl UUID of the Secrets Manager instance.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete_acl + + Deletes the given acl. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param acl_id: The acl UUID of the Secrets Manager instance. (required) + :type acl_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_acl_serialize( + project_id=project_id, + instance_id=instance_id, + acl_id=acl_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_acl_without_preload_content( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + acl_id: Annotated[StrictStr, Field(description="The acl UUID of the Secrets Manager instance.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete_acl + + Deletes the given acl. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param acl_id: The acl UUID of the Secrets Manager instance. (required) + :type acl_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_acl_serialize( + project_id=project_id, + instance_id=instance_id, + acl_id=acl_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_acl_serialize( + self, + project_id, + instance_id, + acl_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + if acl_id is not None: + _path_params["aclId"] = acl_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/acls/{aclId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def delete_approle( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete_approle + + Deletes the given approle. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_approle_serialize( + project_id=project_id, + instance_id=instance_id, + role_id=role_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_approle_with_http_info( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete_approle + + Deletes the given approle. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_approle_serialize( + project_id=project_id, + instance_id=instance_id, + role_id=role_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_approle_without_preload_content( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete_approle + + Deletes the given approle. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_approle_serialize( + project_id=project_id, + instance_id=instance_id, + role_id=role_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_approle_serialize( + self, + project_id, + instance_id, + role_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + if role_id is not None: + _path_params["roleId"] = role_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/approles/{roleId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def delete_approle_secret( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + secret_version: Annotated[StrictInt, Field(description="The secret version.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete_approle_secret + + Deletes the secret id by its given version. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param secret_version: The secret version. (required) + :type secret_version: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_approle_secret_serialize( + project_id=project_id, + instance_id=instance_id, + role_id=role_id, + secret_version=secret_version, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_approle_secret_with_http_info( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + secret_version: Annotated[StrictInt, Field(description="The secret version.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete_approle_secret + + Deletes the secret id by its given version. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param secret_version: The secret version. (required) + :type secret_version: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_approle_secret_serialize( + project_id=project_id, + instance_id=instance_id, + role_id=role_id, + secret_version=secret_version, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_approle_secret_without_preload_content( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + secret_version: Annotated[StrictInt, Field(description="The secret version.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete_approle_secret + + Deletes the secret id by its given version. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param secret_version: The secret version. (required) + :type secret_version: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_approle_secret_serialize( + project_id=project_id, + instance_id=instance_id, + role_id=role_id, + secret_version=secret_version, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_approle_secret_serialize( + self, + project_id, + instance_id, + role_id, + secret_version, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + if role_id is not None: + _path_params["roleId"] = role_id + if secret_version is not None: + _path_params["secretVersion"] = secret_version + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/approles/{roleId}/secrets/{secretVersion}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def delete_instance( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete_instance + + Deletes the given Secrets Manager instance. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_instance_serialize( + project_id=project_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_instance_with_http_info( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete_instance + + Deletes the given Secrets Manager instance. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_instance_serialize( + project_id=project_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_instance_without_preload_content( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete_instance + + Deletes the given Secrets Manager instance. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_instance_serialize( + project_id=project_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_instance_serialize( + self, + project_id, + instance_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def delete_user( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + user_id: Annotated[ + StrictStr, Field(description="The user UUID with permissions on the Secrets Manager instance.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """delete_user + + Deletes the given user. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param user_id: The user UUID with permissions on the Secrets Manager instance. (required) + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_serialize( + project_id=project_id, + instance_id=instance_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_user_with_http_info( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + user_id: Annotated[ + StrictStr, Field(description="The user UUID with permissions on the Secrets Manager instance.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """delete_user + + Deletes the given user. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param user_id: The user UUID with permissions on the Secrets Manager instance. (required) + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_serialize( + project_id=project_id, + instance_id=instance_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_user_without_preload_content( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + user_id: Annotated[ + StrictStr, Field(description="The user UUID with permissions on the Secrets Manager instance.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete_user + + Deletes the given user. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param user_id: The user UUID with permissions on the Secrets Manager instance. (required) + :type user_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_serialize( + project_id=project_id, + instance_id=instance_id, + user_id=user_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_user_serialize( + self, + project_id, + instance_id, + user_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + if user_id is not None: + _path_params["userId"] = user_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/users/{userId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_acl( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + acl_id: Annotated[StrictStr, Field(description="The acl UUID of the Secrets Manager instance.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ACL: + """get_acl + + Returns the details for the given acl. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param acl_id: The acl UUID of the Secrets Manager instance. (required) + :type acl_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_acl_serialize( + project_id=project_id, + instance_id=instance_id, + acl_id=acl_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ACL", + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_acl_with_http_info( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + acl_id: Annotated[StrictStr, Field(description="The acl UUID of the Secrets Manager instance.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ACL]: + """get_acl + + Returns the details for the given acl. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param acl_id: The acl UUID of the Secrets Manager instance. (required) + :type acl_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_acl_serialize( + project_id=project_id, + instance_id=instance_id, + acl_id=acl_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ACL", + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_acl_without_preload_content( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + acl_id: Annotated[StrictStr, Field(description="The acl UUID of the Secrets Manager instance.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_acl + + Returns the details for the given acl. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param acl_id: The acl UUID of the Secrets Manager instance. (required) + :type acl_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_acl_serialize( + project_id=project_id, + instance_id=instance_id, + acl_id=acl_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ACL", + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_acl_serialize( + self, + project_id, + instance_id, + acl_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + if acl_id is not None: + _path_params["aclId"] = acl_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/acls/{aclId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def get_approle( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Approle: + """get_approle + + Returns the details for the given approle. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_approle_serialize( + project_id=project_id, + instance_id=instance_id, + role_id=role_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Approle", + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def get_approle_with_http_info( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Approle]: + """get_approle + + Returns the details for the given approle. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_approle_serialize( + project_id=project_id, + instance_id=instance_id, + role_id=role_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Approle", + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def get_approle_without_preload_content( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_approle + + Returns the details for the given approle. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_approle_serialize( + project_id=project_id, + instance_id=instance_id, + role_id=role_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Approle", + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_approle_serialize( + self, + project_id, + instance_id, + role_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + if role_id is not None: + _path_params["roleId"] = role_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/approles/{roleId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1157,12 +3422,16 @@ def _delete_acl_serialize( ) @validate_call - def delete_instance( + def get_approle_secret( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + secret_version: Annotated[StrictInt, Field(description="The secret version.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1172,15 +3441,19 @@ def delete_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """delete_instance + ) -> ApproleSecret: + """get_approle_secret - Deletes the given Secrets Manager instance. + Read the properties of a given secret id by its given version. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param secret_version: The secret version. (required) + :type secret_version: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1203,9 +3476,11 @@ def delete_instance( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_instance_serialize( + _param = self._get_approle_secret_serialize( project_id=project_id, instance_id=instance_id, + role_id=role_id, + secret_version=secret_version, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1213,7 +3488,7 @@ def delete_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "ApproleSecret", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -1227,12 +3502,16 @@ def delete_instance( ).data @validate_call - def delete_instance_with_http_info( + def get_approle_secret_with_http_info( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + secret_version: Annotated[StrictInt, Field(description="The secret version.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1242,15 +3521,19 @@ def delete_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """delete_instance + ) -> ApiResponse[ApproleSecret]: + """get_approle_secret - Deletes the given Secrets Manager instance. + Read the properties of a given secret id by its given version. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param secret_version: The secret version. (required) + :type secret_version: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1273,9 +3556,11 @@ def delete_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_instance_serialize( + _param = self._get_approle_secret_serialize( project_id=project_id, instance_id=instance_id, + role_id=role_id, + secret_version=secret_version, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1283,7 +3568,7 @@ def delete_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "ApproleSecret", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -1297,12 +3582,16 @@ def delete_instance_with_http_info( ) @validate_call - def delete_instance_without_preload_content( + def get_approle_secret_without_preload_content( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + secret_version: Annotated[StrictInt, Field(description="The secret version.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1313,14 +3602,18 @@ def delete_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_instance + """get_approle_secret - Deletes the given Secrets Manager instance. + Read the properties of a given secret id by its given version. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param secret_version: The secret version. (required) + :type secret_version: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1343,9 +3636,11 @@ def delete_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_instance_serialize( + _param = self._get_approle_secret_serialize( project_id=project_id, instance_id=instance_id, + role_id=role_id, + secret_version=secret_version, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1353,7 +3648,7 @@ def delete_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "ApproleSecret", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -1362,10 +3657,12 @@ def delete_instance_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_instance_serialize( + def _get_approle_secret_serialize( self, project_id, instance_id, + role_id, + secret_version, _request_auth, _content_type, _headers, @@ -1388,6 +3685,10 @@ def _delete_instance_serialize( _path_params["projectId"] = project_id if instance_id is not None: _path_params["instanceId"] = instance_id + if role_id is not None: + _path_params["roleId"] = role_id + if secret_version is not None: + _path_params["secretVersion"] = secret_version # process the query parameters # process the header parameters # process the form parameters @@ -1401,8 +3702,8 @@ def _delete_instance_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}", + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/approles/{roleId}/secrets/{secretVersion}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1416,15 +3717,12 @@ def _delete_instance_serialize( ) @validate_call - def delete_user( + def get_approles( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], - user_id: Annotated[ - StrictStr, Field(description="The user UUID with permissions on the Secrets Manager instance.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1434,17 +3732,15 @@ def delete_user( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """delete_user + ) -> ApproleList: + """get_approles - Deletes the given user. + Returns the approles for the given Secrets Manager instance. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str - :param user_id: The user UUID with permissions on the Secrets Manager instance. (required) - :type user_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1467,10 +3763,9 @@ def delete_user( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_user_serialize( + _param = self._get_approles_serialize( project_id=project_id, instance_id=instance_id, - user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1478,7 +3773,7 @@ def delete_user( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "ApproleList", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -1492,15 +3787,12 @@ def delete_user( ).data @validate_call - def delete_user_with_http_info( + def get_approles_with_http_info( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], - user_id: Annotated[ - StrictStr, Field(description="The user UUID with permissions on the Secrets Manager instance.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1510,17 +3802,15 @@ def delete_user_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """delete_user + ) -> ApiResponse[ApproleList]: + """get_approles - Deletes the given user. + Returns the approles for the given Secrets Manager instance. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str - :param user_id: The user UUID with permissions on the Secrets Manager instance. (required) - :type user_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1543,10 +3833,9 @@ def delete_user_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_user_serialize( + _param = self._get_approles_serialize( project_id=project_id, instance_id=instance_id, - user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1554,7 +3843,7 @@ def delete_user_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "ApproleList", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -1568,15 +3857,12 @@ def delete_user_with_http_info( ) @validate_call - def delete_user_without_preload_content( + def get_approles_without_preload_content( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], - user_id: Annotated[ - StrictStr, Field(description="The user UUID with permissions on the Secrets Manager instance.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1587,16 +3873,14 @@ def delete_user_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_user + """get_approles - Deletes the given user. + Returns the approles for the given Secrets Manager instance. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str - :param user_id: The user UUID with permissions on the Secrets Manager instance. (required) - :type user_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1619,10 +3903,9 @@ def delete_user_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_user_serialize( + _param = self._get_approles_serialize( project_id=project_id, instance_id=instance_id, - user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1630,7 +3913,7 @@ def delete_user_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "ApproleList", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -1639,11 +3922,10 @@ def delete_user_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_user_serialize( + def _get_approles_serialize( self, project_id, instance_id, - user_id, _request_auth, _content_type, _headers, @@ -1666,8 +3948,6 @@ def _delete_user_serialize( _path_params["projectId"] = project_id if instance_id is not None: _path_params["instanceId"] = instance_id - if user_id is not None: - _path_params["userId"] = user_id # process the query parameters # process the header parameters # process the form parameters @@ -1681,8 +3961,8 @@ def _delete_user_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/users/{userId}", + method="GET", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/approles", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1696,13 +3976,12 @@ def _delete_user_serialize( ) @validate_call - def get_acl( + def get_instance( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], - acl_id: Annotated[StrictStr, Field(description="The acl UUID of the Secrets Manager instance.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1712,17 +3991,15 @@ def get_acl( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ACL: - """get_acl + ) -> Instance: + """get_instance - Returns the details for the given acl. + Returns the details for the given Secrets Manager instance. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str - :param acl_id: The acl UUID of the Secrets Manager instance. (required) - :type acl_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1745,10 +4022,9 @@ def get_acl( :return: Returns the result object. """ # noqa: E501 - _param = self._get_acl_serialize( + _param = self._get_instance_serialize( project_id=project_id, instance_id=instance_id, - acl_id=acl_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1756,7 +4032,7 @@ def get_acl( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ACL", + "200": "Instance", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -1770,13 +4046,12 @@ def get_acl( ).data @validate_call - def get_acl_with_http_info( + def get_instance_with_http_info( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], - acl_id: Annotated[StrictStr, Field(description="The acl UUID of the Secrets Manager instance.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1786,17 +4061,15 @@ def get_acl_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ACL]: - """get_acl + ) -> ApiResponse[Instance]: + """get_instance - Returns the details for the given acl. + Returns the details for the given Secrets Manager instance. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str - :param acl_id: The acl UUID of the Secrets Manager instance. (required) - :type acl_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1819,10 +4092,9 @@ def get_acl_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_acl_serialize( + _param = self._get_instance_serialize( project_id=project_id, instance_id=instance_id, - acl_id=acl_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1830,7 +4102,7 @@ def get_acl_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ACL", + "200": "Instance", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -1844,13 +4116,12 @@ def get_acl_with_http_info( ) @validate_call - def get_acl_without_preload_content( + def get_instance_without_preload_content( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], - acl_id: Annotated[StrictStr, Field(description="The acl UUID of the Secrets Manager instance.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1861,16 +4132,14 @@ def get_acl_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_acl + """get_instance - Returns the details for the given acl. + Returns the details for the given Secrets Manager instance. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str - :param acl_id: The acl UUID of the Secrets Manager instance. (required) - :type acl_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1893,10 +4162,9 @@ def get_acl_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_acl_serialize( + _param = self._get_instance_serialize( project_id=project_id, instance_id=instance_id, - acl_id=acl_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1904,7 +4172,7 @@ def get_acl_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ACL", + "200": "Instance", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -1913,11 +4181,10 @@ def get_acl_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_acl_serialize( + def _get_instance_serialize( self, project_id, instance_id, - acl_id, _request_auth, _content_type, _headers, @@ -1940,8 +4207,6 @@ def _get_acl_serialize( _path_params["projectId"] = project_id if instance_id is not None: _path_params["instanceId"] = instance_id - if acl_id is not None: - _path_params["aclId"] = acl_id # process the query parameters # process the header parameters # process the form parameters @@ -1956,7 +4221,7 @@ def _get_acl_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/acls/{aclId}", + resource_path="/v1/projects/{projectId}/instances/{instanceId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1970,12 +4235,15 @@ def _get_acl_serialize( ) @validate_call - def get_instance( + def get_user( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + user_id: Annotated[ + StrictStr, Field(description="The user UUID with permissions on the Secrets Manager instance.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1985,15 +4253,17 @@ def get_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Instance: - """get_instance + ) -> User: + """get_user - Returns the details for the given Secrets Manager instance. + Returns the details for the given user. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str + :param user_id: The user UUID with permissions on the Secrets Manager instance. (required) + :type user_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2016,9 +4286,10 @@ def get_instance( :return: Returns the result object. """ # noqa: E501 - _param = self._get_instance_serialize( + _param = self._get_user_serialize( project_id=project_id, instance_id=instance_id, + user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2026,7 +4297,7 @@ def get_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Instance", + "200": "User", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -2040,12 +4311,15 @@ def get_instance( ).data @validate_call - def get_instance_with_http_info( + def get_user_with_http_info( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + user_id: Annotated[ + StrictStr, Field(description="The user UUID with permissions on the Secrets Manager instance.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2055,15 +4329,17 @@ def get_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Instance]: - """get_instance + ) -> ApiResponse[User]: + """get_user - Returns the details for the given Secrets Manager instance. + Returns the details for the given user. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str + :param user_id: The user UUID with permissions on the Secrets Manager instance. (required) + :type user_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2086,9 +4362,10 @@ def get_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_instance_serialize( + _param = self._get_user_serialize( project_id=project_id, instance_id=instance_id, + user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2096,7 +4373,7 @@ def get_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Instance", + "200": "User", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -2110,12 +4387,15 @@ def get_instance_with_http_info( ) @validate_call - def get_instance_without_preload_content( + def get_user_without_preload_content( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + user_id: Annotated[ + StrictStr, Field(description="The user UUID with permissions on the Secrets Manager instance.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2126,14 +4406,16 @@ def get_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_instance + """get_user - Returns the details for the given Secrets Manager instance. + Returns the details for the given user. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str + :param user_id: The user UUID with permissions on the Secrets Manager instance. (required) + :type user_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2156,9 +4438,10 @@ def get_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_instance_serialize( + _param = self._get_user_serialize( project_id=project_id, instance_id=instance_id, + user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2166,7 +4449,7 @@ def get_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "Instance", + "200": "User", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -2175,10 +4458,11 @@ def get_instance_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_instance_serialize( + def _get_user_serialize( self, project_id, instance_id, + user_id, _request_auth, _content_type, _headers, @@ -2201,6 +4485,8 @@ def _get_instance_serialize( _path_params["projectId"] = project_id if instance_id is not None: _path_params["instanceId"] = instance_id + if user_id is not None: + _path_params["userId"] = user_id # process the query parameters # process the header parameters # process the form parameters @@ -2215,7 +4501,7 @@ def _get_instance_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/users/{userId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2229,15 +4515,12 @@ def _get_instance_serialize( ) @validate_call - def get_user( + def list_acls( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], - user_id: Annotated[ - StrictStr, Field(description="The user UUID with permissions on the Secrets Manager instance.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2247,17 +4530,15 @@ def get_user( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> User: - """get_user + ) -> ListACLsResponse: + """list_acls - Returns the details for the given user. + Returns the acls for the given Secrets Manager instance. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str - :param user_id: The user UUID with permissions on the Secrets Manager instance. (required) - :type user_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2280,10 +4561,9 @@ def get_user( :return: Returns the result object. """ # noqa: E501 - _param = self._get_user_serialize( + _param = self._list_acls_serialize( project_id=project_id, instance_id=instance_id, - user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2291,7 +4571,7 @@ def get_user( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", + "200": "ListACLsResponse", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -2305,15 +4585,12 @@ def get_user( ).data @validate_call - def get_user_with_http_info( + def list_acls_with_http_info( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], - user_id: Annotated[ - StrictStr, Field(description="The user UUID with permissions on the Secrets Manager instance.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2323,17 +4600,15 @@ def get_user_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[User]: - """get_user + ) -> ApiResponse[ListACLsResponse]: + """list_acls - Returns the details for the given user. + Returns the acls for the given Secrets Manager instance. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str - :param user_id: The user UUID with permissions on the Secrets Manager instance. (required) - :type user_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2356,10 +4631,9 @@ def get_user_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_user_serialize( + _param = self._list_acls_serialize( project_id=project_id, instance_id=instance_id, - user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2367,7 +4641,7 @@ def get_user_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", + "200": "ListACLsResponse", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -2381,15 +4655,12 @@ def get_user_with_http_info( ) @validate_call - def get_user_without_preload_content( + def list_acls_without_preload_content( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], - user_id: Annotated[ - StrictStr, Field(description="The user UUID with permissions on the Secrets Manager instance.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2400,16 +4671,14 @@ def get_user_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_user + """list_acls - Returns the details for the given user. + Returns the acls for the given Secrets Manager instance. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str - :param user_id: The user UUID with permissions on the Secrets Manager instance. (required) - :type user_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2432,10 +4701,9 @@ def get_user_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_user_serialize( + _param = self._list_acls_serialize( project_id=project_id, instance_id=instance_id, - user_id=user_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2443,7 +4711,7 @@ def get_user_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "User", + "200": "ListACLsResponse", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -2452,11 +4720,10 @@ def get_user_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_user_serialize( + def _list_acls_serialize( self, project_id, instance_id, - user_id, _request_auth, _content_type, _headers, @@ -2479,8 +4746,6 @@ def _get_user_serialize( _path_params["projectId"] = project_id if instance_id is not None: _path_params["instanceId"] = instance_id - if user_id is not None: - _path_params["userId"] = user_id # process the query parameters # process the header parameters # process the form parameters @@ -2495,7 +4760,7 @@ def _get_user_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/users/{userId}", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/acls", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2509,12 +4774,15 @@ def _get_user_serialize( ) @validate_call - def list_acls( + def list_approle_secrets( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2524,15 +4792,17 @@ def list_acls( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListACLsResponse: - """list_acls + ) -> ApproleSecretList: + """list_approle_secrets - Returns the acls for the given Secrets Manager instance. + Returns the secret id list for the given Secrets Manager instance and approle. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2555,9 +4825,10 @@ def list_acls( :return: Returns the result object. """ # noqa: E501 - _param = self._list_acls_serialize( + _param = self._list_approle_secrets_serialize( project_id=project_id, instance_id=instance_id, + role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2565,7 +4836,7 @@ def list_acls( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListACLsResponse", + "200": "ApproleSecretList", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -2579,12 +4850,15 @@ def list_acls( ).data @validate_call - def list_acls_with_http_info( + def list_approle_secrets_with_http_info( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2594,15 +4868,17 @@ def list_acls_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ListACLsResponse]: - """list_acls + ) -> ApiResponse[ApproleSecretList]: + """list_approle_secrets - Returns the acls for the given Secrets Manager instance. + Returns the secret id list for the given Secrets Manager instance and approle. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2625,9 +4901,10 @@ def list_acls_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_acls_serialize( + _param = self._list_approle_secrets_serialize( project_id=project_id, instance_id=instance_id, + role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2635,7 +4912,7 @@ def list_acls_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListACLsResponse", + "200": "ApproleSecretList", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -2649,12 +4926,15 @@ def list_acls_with_http_info( ) @validate_call - def list_acls_without_preload_content( + def list_approle_secrets_without_preload_content( self, project_id: Annotated[ StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") ], instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2665,14 +4945,16 @@ def list_acls_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_acls + """list_approle_secrets - Returns the acls for the given Secrets Manager instance. + Returns the secret id list for the given Secrets Manager instance and approle. :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) :type project_id: str :param instance_id: The Secrets Manager instance UUID. (required) :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2695,9 +4977,10 @@ def list_acls_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_acls_serialize( + _param = self._list_approle_secrets_serialize( project_id=project_id, instance_id=instance_id, + role_id=role_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2705,7 +4988,7 @@ def list_acls_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListACLsResponse", + "200": "ApproleSecretList", "400": "BadRequest", "401": "str", "404": "NotFound", @@ -2714,10 +4997,11 @@ def list_acls_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_acls_serialize( + def _list_approle_secrets_serialize( self, project_id, instance_id, + role_id, _request_auth, _content_type, _headers, @@ -2740,6 +5024,8 @@ def _list_acls_serialize( _path_params["projectId"] = project_id if instance_id is not None: _path_params["instanceId"] = instance_id + if role_id is not None: + _path_params["roleId"] = role_id # process the query parameters # process the header parameters # process the form parameters @@ -2754,7 +5040,7 @@ def _list_acls_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/instances/{instanceId}/acls", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/approles/{roleId}/secrets", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3849,6 +6135,309 @@ def _update_acls_serialize( _request_auth=_request_auth, ) + @validate_call + def update_approle( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + update_approle_payload: UpdateApprolePayload, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Approle: + """update_approle + + Updates the details for the given approle. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param update_approle_payload: (required) + :type update_approle_payload: UpdateApprolePayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_approle_serialize( + project_id=project_id, + instance_id=instance_id, + role_id=role_id, + update_approle_payload=update_approle_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Approle", + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def update_approle_with_http_info( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + update_approle_payload: UpdateApprolePayload, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Approle]: + """update_approle + + Updates the details for the given approle. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param update_approle_payload: (required) + :type update_approle_payload: UpdateApprolePayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_approle_serialize( + project_id=project_id, + instance_id=instance_id, + role_id=role_id, + update_approle_payload=update_approle_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Approle", + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def update_approle_without_preload_content( + self, + project_id: Annotated[ + StrictStr, Field(description="The STACKIT portal project UUID the Secrets Manager instance is part of.") + ], + instance_id: Annotated[StrictStr, Field(description="The Secrets Manager instance UUID.")], + role_id: Annotated[ + StrictStr, Field(description="The approle with permissions on the Secrets Manager instance.") + ], + update_approle_payload: UpdateApprolePayload, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """update_approle + + Updates the details for the given approle. + + :param project_id: The STACKIT portal project UUID the Secrets Manager instance is part of. (required) + :type project_id: str + :param instance_id: The Secrets Manager instance UUID. (required) + :type instance_id: str + :param role_id: The approle with permissions on the Secrets Manager instance. (required) + :type role_id: str + :param update_approle_payload: (required) + :type update_approle_payload: UpdateApprolePayload + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_approle_serialize( + project_id=project_id, + instance_id=instance_id, + role_id=role_id, + update_approle_payload=update_approle_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "Approle", + "400": "BadRequest", + "401": "str", + "404": "NotFound", + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_approle_serialize( + self, + project_id, + instance_id, + role_id, + update_approle_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + if role_id is not None: + _path_params["roleId"] = role_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if update_approle_payload is not None: + _body_params = update_approle_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="PUT", + resource_path="/v1/projects/{projectId}/instances/{instanceId}/approles/{roleId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + @validate_call def update_instance( self, diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/__init__.py b/services/secretsmanager/src/stackit/secretsmanager/models/__init__.py index 4b32d654a..0e10434ff 100644 --- a/services/secretsmanager/src/stackit/secretsmanager/models/__init__.py +++ b/services/secretsmanager/src/stackit/secretsmanager/models/__init__.py @@ -15,9 +15,17 @@ # import models into model package from stackit.secretsmanager.models.acl import ACL +from stackit.secretsmanager.models.approle import Approle +from stackit.secretsmanager.models.approle_list import ApproleList +from stackit.secretsmanager.models.approle_secret import ApproleSecret +from stackit.secretsmanager.models.approle_secret_list import ApproleSecretList from stackit.secretsmanager.models.bad_request import BadRequest from stackit.secretsmanager.models.conflict import Conflict from stackit.secretsmanager.models.create_acl_payload import CreateACLPayload +from stackit.secretsmanager.models.create_approle_payload import CreateApprolePayload +from stackit.secretsmanager.models.create_approle_secret_payload import ( + CreateApproleSecretPayload, +) from stackit.secretsmanager.models.create_instance_payload import CreateInstancePayload from stackit.secretsmanager.models.create_user_payload import CreateUserPayload from stackit.secretsmanager.models.instance import Instance @@ -28,6 +36,7 @@ from stackit.secretsmanager.models.not_found import NotFound from stackit.secretsmanager.models.update_acl_payload import UpdateACLPayload from stackit.secretsmanager.models.update_acls_payload import UpdateACLsPayload +from stackit.secretsmanager.models.update_approle_payload import UpdateApprolePayload from stackit.secretsmanager.models.update_instance_payload import UpdateInstancePayload from stackit.secretsmanager.models.update_user_payload import UpdateUserPayload from stackit.secretsmanager.models.user import User diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/approle.py b/services/secretsmanager/src/stackit/secretsmanager/models/approle.py new file mode 100644 index 000000000..01b62602b --- /dev/null +++ b/services/secretsmanager/src/stackit/secretsmanager/models/approle.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + STACKIT Secrets Manager API + + This API provides endpoints for managing the Secrets-Manager. + + The version of the OpenAPI document: 1.4.2 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictInt, + StrictStr, + field_validator, +) +from typing_extensions import Annotated, Self + + +class Approle(BaseModel): + """ + Approle + """ # noqa: E501 + + description: StrictStr = Field(description="A user chosen description to differentiate between multiple approles.") + role_id: StrictStr = Field(description="Identifier used for authentication") + secret_id_num_uses: StrictInt + secret_id_ttl: Annotated[str, Field(strict=True)] = Field( + description="Token TTL in time.Duration format (eg 15m for 15 minutes, 1h for 1 hour)." + ) + write: StrictBool = Field( + description="Is true if the approle has write access to the secrets engine. Is false for a read-only approle." + ) + __properties: ClassVar[List[str]] = ["description", "role_id", "secret_id_num_uses", "secret_id_ttl", "write"] + + @field_validator("secret_id_ttl") + def secret_id_ttl_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[0-9]+[smh]$", value): + raise ValueError(r"must validate the regular expression /^[0-9]+[smh]$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Approle from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Approle from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "description": obj.get("description"), + "role_id": obj.get("role_id"), + "secret_id_num_uses": obj.get("secret_id_num_uses"), + "secret_id_ttl": obj.get("secret_id_ttl"), + "write": obj.get("write"), + } + ) + return _obj diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/approle_list.py b/services/secretsmanager/src/stackit/secretsmanager/models/approle_list.py new file mode 100644 index 000000000..02b79a943 --- /dev/null +++ b/services/secretsmanager/src/stackit/secretsmanager/models/approle_list.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + STACKIT Secrets Manager API + + This API provides endpoints for managing the Secrets-Manager. + + The version of the OpenAPI document: 1.4.2 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict +from typing_extensions import Self + +from stackit.secretsmanager.models.approle import Approle + + +class ApproleList(BaseModel): + """ + ApproleList + """ # noqa: E501 + + approles: List[Approle] + __properties: ClassVar[List[str]] = ["approles"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApproleList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in approles (list) + _items = [] + if self.approles: + for _item in self.approles: + if _item: + _items.append(_item.to_dict()) + _dict["approles"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApproleList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "approles": ( + [Approle.from_dict(_item) for _item in obj["approles"]] if obj.get("approles") is not None else None + ) + } + ) + return _obj diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/approle_secret.py b/services/secretsmanager/src/stackit/secretsmanager/models/approle_secret.py new file mode 100644 index 000000000..73448f23f --- /dev/null +++ b/services/secretsmanager/src/stackit/secretsmanager/models/approle_secret.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + STACKIT Secrets Manager API + + This API provides endpoints for managing the Secrets-Manager. + + The version of the OpenAPI document: 1.4.2 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing_extensions import Annotated, Self + + +class ApproleSecret(BaseModel): + """ + ApproleSecret + """ # noqa: E501 + + description: StrictStr = Field( + description="A user chosen description to differentiate between multiple approle secrets." + ) + num_uses: StrictInt + secret_id: Optional[StrictStr] = Field( + default=None, description="Identifier used for authentication, returned only at creation" + ) + ttl: Annotated[str, Field(strict=True)] = Field( + description="Token TTL in time.Duration format (eg 15m for 15 minutes, 1h for 1 hour)." + ) + version: StrictInt = Field(description="Accessor used for handling secrets") + __properties: ClassVar[List[str]] = ["description", "num_uses", "secret_id", "ttl", "version"] + + @field_validator("ttl") + def ttl_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^[0-9]+[smh]$", value): + raise ValueError(r"must validate the regular expression /^[0-9]+[smh]$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApproleSecret from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApproleSecret from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "description": obj.get("description"), + "num_uses": obj.get("num_uses"), + "secret_id": obj.get("secret_id"), + "ttl": obj.get("ttl"), + "version": obj.get("version"), + } + ) + return _obj diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/approle_secret_list.py b/services/secretsmanager/src/stackit/secretsmanager/models/approle_secret_list.py new file mode 100644 index 000000000..1febdc80b --- /dev/null +++ b/services/secretsmanager/src/stackit/secretsmanager/models/approle_secret_list.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + STACKIT Secrets Manager API + + This API provides endpoints for managing the Secrets-Manager. + + The version of the OpenAPI document: 1.4.2 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict +from typing_extensions import Self + +from stackit.secretsmanager.models.approle_secret import ApproleSecret + + +class ApproleSecretList(BaseModel): + """ + ApproleSecretList + """ # noqa: E501 + + secrets: List[ApproleSecret] + __properties: ClassVar[List[str]] = ["secrets"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApproleSecretList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in secrets (list) + _items = [] + if self.secrets: + for _item in self.secrets: + if _item: + _items.append(_item.to_dict()) + _dict["secrets"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApproleSecretList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "secrets": ( + [ApproleSecret.from_dict(_item) for _item in obj["secrets"]] + if obj.get("secrets") is not None + else None + ) + } + ) + return _obj diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/create_approle_payload.py b/services/secretsmanager/src/stackit/secretsmanager/models/create_approle_payload.py new file mode 100644 index 000000000..f9510879e --- /dev/null +++ b/services/secretsmanager/src/stackit/secretsmanager/models/create_approle_payload.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + STACKIT Secrets Manager API + + This API provides endpoints for managing the Secrets-Manager. + + The version of the OpenAPI document: 1.4.2 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictInt, + StrictStr, + field_validator, +) +from typing_extensions import Annotated, Self + + +class CreateApprolePayload(BaseModel): + """ + CreateApprolePayload + """ # noqa: E501 + + description: StrictStr = Field(description="A user chosen description to differentiate between multiple approles.") + secret_id_num_uses: Optional[StrictInt] = None + secret_id_ttl: Optional[Annotated[str, Field(strict=True)]] = Field( + default=None, description="Token TTL in time.Duration format (eg 15m for 15 minutes, 1h for 1 hour)." + ) + write: Optional[StrictBool] = Field( + default=None, + description="Is true if the approle has write access to the secrets engine. Is false for a read-only approle.", + ) + __properties: ClassVar[List[str]] = ["description", "secret_id_num_uses", "secret_id_ttl", "write"] + + @field_validator("secret_id_ttl") + def secret_id_ttl_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[0-9]+[smh]$", value): + raise ValueError(r"must validate the regular expression /^[0-9]+[smh]$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateApprolePayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateApprolePayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "description": obj.get("description"), + "secret_id_num_uses": obj.get("secret_id_num_uses"), + "secret_id_ttl": obj.get("secret_id_ttl"), + "write": obj.get("write"), + } + ) + return _obj diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/create_approle_secret_payload.py b/services/secretsmanager/src/stackit/secretsmanager/models/create_approle_secret_payload.py new file mode 100644 index 000000000..41440843b --- /dev/null +++ b/services/secretsmanager/src/stackit/secretsmanager/models/create_approle_secret_payload.py @@ -0,0 +1,83 @@ +# coding: utf-8 + +""" + STACKIT Secrets Manager API + + This API provides endpoints for managing the Secrets-Manager. + + The version of the OpenAPI document: 1.4.2 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + + +class CreateApproleSecretPayload(BaseModel): + """ + CreateApproleSecretPayload + """ # noqa: E501 + + description: StrictStr = Field( + description="A user chosen description to differentiate between multiple approle secrets." + ) + __properties: ClassVar[List[str]] = ["description"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateApproleSecretPayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateApproleSecretPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"description": obj.get("description")}) + return _obj diff --git a/services/secretsmanager/src/stackit/secretsmanager/models/update_approle_payload.py b/services/secretsmanager/src/stackit/secretsmanager/models/update_approle_payload.py new file mode 100644 index 000000000..f1be5d49a --- /dev/null +++ b/services/secretsmanager/src/stackit/secretsmanager/models/update_approle_payload.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + STACKIT Secrets Manager API + + This API provides endpoints for managing the Secrets-Manager. + + The version of the OpenAPI document: 1.4.2 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar, Dict, List, Optional, Set + +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictInt, + field_validator, +) +from typing_extensions import Annotated, Self + + +class UpdateApprolePayload(BaseModel): + """ + UpdateApprolePayload + """ # noqa: E501 + + secret_id_num_uses: Optional[StrictInt] = None + secret_id_ttl: Optional[Annotated[str, Field(strict=True)]] = Field( + default=None, description="Token TTL in time.Duration format (eg 15m for 15 minutes, 1h for 1 hour)." + ) + write: Optional[StrictBool] = Field( + default=None, + description="Is true if the approle has write access to the secrets engine. Is false for a read-only approle.", + ) + __properties: ClassVar[List[str]] = ["secret_id_num_uses", "secret_id_ttl", "write"] + + @field_validator("secret_id_ttl") + def secret_id_ttl_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if not re.match(r"^[0-9]+[smh]$", value): + raise ValueError(r"must validate the regular expression /^[0-9]+[smh]$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateApprolePayload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateApprolePayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "secret_id_num_uses": obj.get("secret_id_num_uses"), + "secret_id_ttl": obj.get("secret_id_ttl"), + "write": obj.get("write"), + } + ) + return _obj