From c0f6852b37f182cbdd5ea8f875c425dd315a8e34 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Tue, 24 Mar 2026 10:53:36 +0000 Subject: [PATCH] Generate objectstorage --- services/objectstorage/oas_commit | 2 +- .../src/stackit/objectstorage/__init__.py | 26 + .../stackit/objectstorage/api/default_api.py | 2387 +++++++++++++++-- .../stackit/objectstorage/models/__init__.py | 17 + .../stackit/objectstorage/models/bucket.py | 14 +- .../models/compliance_lock_response.py | 82 + .../models/credentials_group_extended.py | 91 + .../models/default_retention_response.py | 93 + .../delete_default_retention_response.py | 82 + .../models/get_credentials_group_response.py | 98 + .../objectstorage/models/retention_mode.py | 80 + .../models/set_default_retention_payload.py | 84 + 12 files changed, 2809 insertions(+), 247 deletions(-) create mode 100644 services/objectstorage/src/stackit/objectstorage/models/compliance_lock_response.py create mode 100644 services/objectstorage/src/stackit/objectstorage/models/credentials_group_extended.py create mode 100644 services/objectstorage/src/stackit/objectstorage/models/default_retention_response.py create mode 100644 services/objectstorage/src/stackit/objectstorage/models/delete_default_retention_response.py create mode 100644 services/objectstorage/src/stackit/objectstorage/models/get_credentials_group_response.py create mode 100644 services/objectstorage/src/stackit/objectstorage/models/retention_mode.py create mode 100644 services/objectstorage/src/stackit/objectstorage/models/set_default_retention_payload.py diff --git a/services/objectstorage/oas_commit b/services/objectstorage/oas_commit index e3713dde3..3423bbfe6 100644 --- a/services/objectstorage/oas_commit +++ b/services/objectstorage/oas_commit @@ -1 +1 @@ -0e64886dd0847341800d7191ed193b75413be998 +f15f0e449d347f36dde5feac11c328b72d7f10dc diff --git a/services/objectstorage/src/stackit/objectstorage/__init__.py b/services/objectstorage/src/stackit/objectstorage/__init__.py index 461f5a4c9..46ae69aeb 100644 --- a/services/objectstorage/src/stackit/objectstorage/__init__.py +++ b/services/objectstorage/src/stackit/objectstorage/__init__.py @@ -30,18 +30,23 @@ "ApiException", "AccessKey", "Bucket", + "ComplianceLockResponse", "CreateAccessKeyPayload", "CreateAccessKeyResponse", "CreateBucketResponse", "CreateCredentialsGroupPayload", "CreateCredentialsGroupResponse", "CredentialsGroup", + "CredentialsGroupExtended", + "DefaultRetentionResponse", "DeleteAccessKeyResponse", "DeleteBucketResponse", "DeleteCredentialsGroupResponse", + "DeleteDefaultRetentionResponse", "DetailedError", "ErrorMessage", "GetBucketResponse", + "GetCredentialsGroupResponse", "HTTPValidationError", "ListAccessKeysResponse", "ListBucketsResponse", @@ -49,6 +54,8 @@ "LocationInner", "ProjectScope", "ProjectStatus", + "RetentionMode", + "SetDefaultRetentionPayload", "ValidationError", ] @@ -69,6 +76,9 @@ # import models into sdk package from stackit.objectstorage.models.access_key import AccessKey as AccessKey from stackit.objectstorage.models.bucket import Bucket as Bucket +from stackit.objectstorage.models.compliance_lock_response import ( + ComplianceLockResponse as ComplianceLockResponse, +) from stackit.objectstorage.models.create_access_key_payload import ( CreateAccessKeyPayload as CreateAccessKeyPayload, ) @@ -87,6 +97,12 @@ from stackit.objectstorage.models.credentials_group import ( CredentialsGroup as CredentialsGroup, ) +from stackit.objectstorage.models.credentials_group_extended import ( + CredentialsGroupExtended as CredentialsGroupExtended, +) +from stackit.objectstorage.models.default_retention_response import ( + DefaultRetentionResponse as DefaultRetentionResponse, +) from stackit.objectstorage.models.delete_access_key_response import ( DeleteAccessKeyResponse as DeleteAccessKeyResponse, ) @@ -96,11 +112,17 @@ from stackit.objectstorage.models.delete_credentials_group_response import ( DeleteCredentialsGroupResponse as DeleteCredentialsGroupResponse, ) +from stackit.objectstorage.models.delete_default_retention_response import ( + DeleteDefaultRetentionResponse as DeleteDefaultRetentionResponse, +) from stackit.objectstorage.models.detailed_error import DetailedError as DetailedError from stackit.objectstorage.models.error_message import ErrorMessage as ErrorMessage from stackit.objectstorage.models.get_bucket_response import ( GetBucketResponse as GetBucketResponse, ) +from stackit.objectstorage.models.get_credentials_group_response import ( + GetCredentialsGroupResponse as GetCredentialsGroupResponse, +) from stackit.objectstorage.models.http_validation_error import ( HTTPValidationError as HTTPValidationError, ) @@ -116,6 +138,10 @@ from stackit.objectstorage.models.location_inner import LocationInner as LocationInner from stackit.objectstorage.models.project_scope import ProjectScope as ProjectScope from stackit.objectstorage.models.project_status import ProjectStatus as ProjectStatus +from stackit.objectstorage.models.retention_mode import RetentionMode as RetentionMode +from stackit.objectstorage.models.set_default_retention_payload import ( + SetDefaultRetentionPayload as SetDefaultRetentionPayload, +) from stackit.objectstorage.models.validation_error import ( ValidationError as ValidationError, ) diff --git a/services/objectstorage/src/stackit/objectstorage/api/default_api.py b/services/objectstorage/src/stackit/objectstorage/api/default_api.py index 5fa229b37..02f2051be 100644 --- a/services/objectstorage/src/stackit/objectstorage/api/default_api.py +++ b/services/objectstorage/src/stackit/objectstorage/api/default_api.py @@ -13,12 +13,13 @@ from typing import Any, Dict, List, Optional, Tuple, Union -from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call +from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, validate_call from stackit.core.configuration import Configuration from typing_extensions import Annotated from stackit.objectstorage.api_client import ApiClient, RequestSerialized from stackit.objectstorage.api_response import ApiResponse +from stackit.objectstorage.models.compliance_lock_response import ComplianceLockResponse from stackit.objectstorage.models.create_access_key_payload import ( CreateAccessKeyPayload, ) @@ -32,6 +33,9 @@ from stackit.objectstorage.models.create_credentials_group_response import ( CreateCredentialsGroupResponse, ) +from stackit.objectstorage.models.default_retention_response import ( + DefaultRetentionResponse, +) from stackit.objectstorage.models.delete_access_key_response import ( DeleteAccessKeyResponse, ) @@ -39,7 +43,13 @@ from stackit.objectstorage.models.delete_credentials_group_response import ( DeleteCredentialsGroupResponse, ) +from stackit.objectstorage.models.delete_default_retention_response import ( + DeleteDefaultRetentionResponse, +) from stackit.objectstorage.models.get_bucket_response import GetBucketResponse +from stackit.objectstorage.models.get_credentials_group_response import ( + GetCredentialsGroupResponse, +) from stackit.objectstorage.models.list_access_keys_response import ( ListAccessKeysResponse, ) @@ -48,6 +58,9 @@ ListCredentialsGroupsResponse, ) from stackit.objectstorage.models.project_status import ProjectStatus +from stackit.objectstorage.models.set_default_retention_payload import ( + SetDefaultRetentionPayload, +) from stackit.objectstorage.rest import RESTResponseType @@ -368,6 +381,12 @@ def create_bucket( bucket_name: Annotated[ str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") ], + object_lock_enabled: Annotated[ + Optional[StrictBool], + Field( + description="Enable S3 Object Lock on this bucket. Can only be set at creation time. Requires an active project-level compliance lock." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -388,6 +407,8 @@ def create_bucket( :type region: str :param bucket_name: The name has to be dns-conform. (required) :type bucket_name: str + :param object_lock_enabled: Enable S3 Object Lock on this bucket. Can only be set at creation time. Requires an active project-level compliance lock. + :type object_lock_enabled: bool :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 @@ -414,6 +435,7 @@ def create_bucket( project_id=project_id, region=region, bucket_name=bucket_name, + object_lock_enabled=object_lock_enabled, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -443,6 +465,12 @@ def create_bucket_with_http_info( bucket_name: Annotated[ str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") ], + object_lock_enabled: Annotated[ + Optional[StrictBool], + Field( + description="Enable S3 Object Lock on this bucket. Can only be set at creation time. Requires an active project-level compliance lock." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -463,6 +491,8 @@ def create_bucket_with_http_info( :type region: str :param bucket_name: The name has to be dns-conform. (required) :type bucket_name: str + :param object_lock_enabled: Enable S3 Object Lock on this bucket. Can only be set at creation time. Requires an active project-level compliance lock. + :type object_lock_enabled: bool :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 @@ -489,6 +519,7 @@ def create_bucket_with_http_info( project_id=project_id, region=region, bucket_name=bucket_name, + object_lock_enabled=object_lock_enabled, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -518,6 +549,12 @@ def create_bucket_without_preload_content( bucket_name: Annotated[ str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") ], + object_lock_enabled: Annotated[ + Optional[StrictBool], + Field( + description="Enable S3 Object Lock on this bucket. Can only be set at creation time. Requires an active project-level compliance lock." + ), + ] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -538,6 +575,8 @@ def create_bucket_without_preload_content( :type region: str :param bucket_name: The name has to be dns-conform. (required) :type bucket_name: str + :param object_lock_enabled: Enable S3 Object Lock on this bucket. Can only be set at creation time. Requires an active project-level compliance lock. + :type object_lock_enabled: bool :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 @@ -564,6 +603,7 @@ def create_bucket_without_preload_content( project_id=project_id, region=region, bucket_name=bucket_name, + object_lock_enabled=object_lock_enabled, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -586,6 +626,7 @@ def _create_bucket_serialize( project_id, region, bucket_name, + object_lock_enabled, _request_auth, _content_type, _headers, @@ -611,6 +652,10 @@ def _create_bucket_serialize( if bucket_name is not None: _path_params["bucketName"] = bucket_name # process the query parameters + if object_lock_enabled is not None: + + _query_params.append(("objectLockEnabled", object_lock_enabled)) + # process the header parameters # process the form parameters # process the body parameter @@ -637,6 +682,256 @@ def _create_bucket_serialize( _request_auth=_request_auth, ) + @validate_call + def create_compliance_lock( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + _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, + ) -> ComplianceLockResponse: + """Create Compliance Lock + + Enable compliance lock for a project. + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: 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._create_compliance_lock_serialize( + project_id=project_id, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ComplianceLockResponse", + "404": "ErrorMessage", + "409": "ErrorMessage", + "500": "ErrorMessage", + } + 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_compliance_lock_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + _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[ComplianceLockResponse]: + """Create Compliance Lock + + Enable compliance lock for a project. + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: 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._create_compliance_lock_serialize( + project_id=project_id, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ComplianceLockResponse", + "404": "ErrorMessage", + "409": "ErrorMessage", + "500": "ErrorMessage", + } + 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_compliance_lock_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + _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 Compliance Lock + + Enable compliance lock for a project. + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: 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._create_compliance_lock_serialize( + project_id=project_id, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "ComplianceLockResponse", + "404": "ErrorMessage", + "409": "ErrorMessage", + "500": "ErrorMessage", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_compliance_lock_serialize( + self, + project_id, + region, + _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 region is not None: + _path_params["region"] = region + # 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"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/v2/project/{projectId}/regions/{region}/compliance-lock", + 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_credentials_group( self, @@ -1482,11 +1777,10 @@ def _delete_bucket_serialize( ) @validate_call - def delete_credentials_group( + def delete_compliance_lock( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], - group_id: Annotated[StrictStr, Field(description="Id of the credentials group")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1496,17 +1790,15 @@ def delete_credentials_group( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> DeleteCredentialsGroupResponse: - """Delete Credentials Group + ) -> ComplianceLockResponse: + """Delete Compliance Lock - Delete a credentials group inside a project if the project exists and no valid access keys are left in the group. + Remove compliance lock from a project. :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str - :param group_id: Id of the credentials group (required) - :type group_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 @@ -1529,10 +1821,9 @@ def delete_credentials_group( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_credentials_group_serialize( + _param = self._delete_compliance_lock_serialize( project_id=project_id, region=region, - group_id=group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1540,10 +1831,9 @@ def delete_credentials_group( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeleteCredentialsGroupResponse", - "401": "ErrorMessage", + "200": "ComplianceLockResponse", "404": "ErrorMessage", - "422": "HTTPValidationError", + "409": "ErrorMessage", "500": "ErrorMessage", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1554,11 +1844,10 @@ def delete_credentials_group( ).data @validate_call - def delete_credentials_group_with_http_info( + def delete_compliance_lock_with_http_info( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], - group_id: Annotated[StrictStr, Field(description="Id of the credentials group")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1568,17 +1857,15 @@ def delete_credentials_group_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[DeleteCredentialsGroupResponse]: - """Delete Credentials Group + ) -> ApiResponse[ComplianceLockResponse]: + """Delete Compliance Lock - Delete a credentials group inside a project if the project exists and no valid access keys are left in the group. + Remove compliance lock from a project. :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str - :param group_id: Id of the credentials group (required) - :type group_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 @@ -1601,10 +1888,9 @@ def delete_credentials_group_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_credentials_group_serialize( + _param = self._delete_compliance_lock_serialize( project_id=project_id, region=region, - group_id=group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1612,10 +1898,9 @@ def delete_credentials_group_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeleteCredentialsGroupResponse", - "401": "ErrorMessage", + "200": "ComplianceLockResponse", "404": "ErrorMessage", - "422": "HTTPValidationError", + "409": "ErrorMessage", "500": "ErrorMessage", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1626,11 +1911,10 @@ def delete_credentials_group_with_http_info( ) @validate_call - def delete_credentials_group_without_preload_content( + def delete_compliance_lock_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], - group_id: Annotated[StrictStr, Field(description="Id of the credentials group")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1641,16 +1925,14 @@ def delete_credentials_group_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete Credentials Group + """Delete Compliance Lock - Delete a credentials group inside a project if the project exists and no valid access keys are left in the group. + Remove compliance lock from a project. :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str - :param group_id: Id of the credentials group (required) - :type group_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 @@ -1673,10 +1955,9 @@ def delete_credentials_group_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_credentials_group_serialize( + _param = self._delete_compliance_lock_serialize( project_id=project_id, region=region, - group_id=group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1684,20 +1965,18 @@ def delete_credentials_group_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "DeleteCredentialsGroupResponse", - "401": "ErrorMessage", + "200": "ComplianceLockResponse", "404": "ErrorMessage", - "422": "HTTPValidationError", + "409": "ErrorMessage", "500": "ErrorMessage", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_credentials_group_serialize( + def _delete_compliance_lock_serialize( self, project_id, region, - group_id, _request_auth, _content_type, _headers, @@ -1720,8 +1999,6 @@ def _delete_credentials_group_serialize( _path_params["projectId"] = project_id if region is not None: _path_params["region"] = region - if group_id is not None: - _path_params["groupId"] = group_id # process the query parameters # process the header parameters # process the form parameters @@ -1736,7 +2013,7 @@ def _delete_credentials_group_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v2/project/{projectId}/regions/{region}/credentials-group/{groupId}", + resource_path="/v2/project/{projectId}/regions/{region}/compliance-lock", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1750,10 +2027,11 @@ def _delete_credentials_group_serialize( ) @validate_call - def disable_service( + def delete_credentials_group( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], + group_id: Annotated[StrictStr, Field(description="Id of the credentials group")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1763,15 +2041,17 @@ def disable_service( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ProjectStatus: - """Delete Project + ) -> DeleteCredentialsGroupResponse: + """Delete Credentials Group - Delete the given project + Delete a credentials group inside a project if the project exists and no valid access keys are left in the group. :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str + :param group_id: Id of the credentials group (required) + :type group_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 @@ -1794,9 +2074,10 @@ def disable_service( :return: Returns the result object. """ # noqa: E501 - _param = self._disable_service_serialize( + _param = self._delete_credentials_group_serialize( project_id=project_id, region=region, + group_id=group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1804,12 +2085,10 @@ def disable_service( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectStatus", - "400": "ErrorMessage", + "200": "DeleteCredentialsGroupResponse", "401": "ErrorMessage", - "403": "ErrorMessage", "404": "ErrorMessage", - "422": "ErrorMessage", + "422": "HTTPValidationError", "500": "ErrorMessage", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1820,10 +2099,11 @@ def disable_service( ).data @validate_call - def disable_service_with_http_info( + def delete_credentials_group_with_http_info( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], + group_id: Annotated[StrictStr, Field(description="Id of the credentials group")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1833,15 +2113,17 @@ def disable_service_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[ProjectStatus]: - """Delete Project + ) -> ApiResponse[DeleteCredentialsGroupResponse]: + """Delete Credentials Group - Delete the given project + Delete a credentials group inside a project if the project exists and no valid access keys are left in the group. :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str + :param group_id: Id of the credentials group (required) + :type group_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 @@ -1864,9 +2146,10 @@ def disable_service_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._disable_service_serialize( + _param = self._delete_credentials_group_serialize( project_id=project_id, region=region, + group_id=group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1874,12 +2157,10 @@ def disable_service_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectStatus", - "400": "ErrorMessage", + "200": "DeleteCredentialsGroupResponse", "401": "ErrorMessage", - "403": "ErrorMessage", "404": "ErrorMessage", - "422": "ErrorMessage", + "422": "HTTPValidationError", "500": "ErrorMessage", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1890,10 +2171,11 @@ def disable_service_with_http_info( ) @validate_call - def disable_service_without_preload_content( + def delete_credentials_group_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], + group_id: Annotated[StrictStr, Field(description="Id of the credentials group")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1904,14 +2186,16 @@ def disable_service_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete Project + """Delete Credentials Group - Delete the given project + Delete a credentials group inside a project if the project exists and no valid access keys are left in the group. :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str + :param group_id: Id of the credentials group (required) + :type group_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 @@ -1934,9 +2218,10 @@ def disable_service_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._disable_service_serialize( + _param = self._delete_credentials_group_serialize( project_id=project_id, region=region, + group_id=group_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1944,21 +2229,20 @@ def disable_service_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectStatus", - "400": "ErrorMessage", + "200": "DeleteCredentialsGroupResponse", "401": "ErrorMessage", - "403": "ErrorMessage", "404": "ErrorMessage", - "422": "ErrorMessage", + "422": "HTTPValidationError", "500": "ErrorMessage", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _disable_service_serialize( + def _delete_credentials_group_serialize( self, project_id, region, + group_id, _request_auth, _content_type, _headers, @@ -1981,6 +2265,8 @@ def _disable_service_serialize( _path_params["projectId"] = project_id if region is not None: _path_params["region"] = region + if group_id is not None: + _path_params["groupId"] = group_id # process the query parameters # process the header parameters # process the form parameters @@ -1995,7 +2281,7 @@ def _disable_service_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v2/project/{projectId}/regions/{region}", + resource_path="/v2/project/{projectId}/regions/{region}/credentials-group/{groupId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2009,10 +2295,13 @@ def _disable_service_serialize( ) @validate_call - def enable_service( + def delete_default_retention( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], + bucket_name: Annotated[ + str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2022,15 +2311,17 @@ def enable_service( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ProjectStatus: - """Create Project + ) -> DeleteDefaultRetentionResponse: + """Delete Default Retention - Create a project. Creation will also be successful if the project already exists, but will not create a duplicate + Remove the default retention from a bucket. Object Lock itself remains enabled. :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str + :param bucket_name: The name has to be dns-conform. (required) + :type bucket_name: 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 @@ -2053,9 +2344,10 @@ def enable_service( :return: Returns the result object. """ # noqa: E501 - _param = self._enable_service_serialize( + _param = self._delete_default_retention_serialize( project_id=project_id, region=region, + bucket_name=bucket_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2063,12 +2355,9 @@ def enable_service( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectStatus", - "201": "ProjectStatus", - "401": "ErrorMessage", - "403": "ErrorMessage", + "200": "DeleteDefaultRetentionResponse", + "404": "ErrorMessage", "409": "ErrorMessage", - "422": "HTTPValidationError", "500": "ErrorMessage", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2079,10 +2368,13 @@ def enable_service( ).data @validate_call - def enable_service_with_http_info( + def delete_default_retention_with_http_info( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], + bucket_name: Annotated[ + str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2092,15 +2384,17 @@ def enable_service_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[ProjectStatus]: - """Create Project + ) -> ApiResponse[DeleteDefaultRetentionResponse]: + """Delete Default Retention - Create a project. Creation will also be successful if the project already exists, but will not create a duplicate + Remove the default retention from a bucket. Object Lock itself remains enabled. :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str + :param bucket_name: The name has to be dns-conform. (required) + :type bucket_name: 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 @@ -2123,9 +2417,10 @@ def enable_service_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._enable_service_serialize( + _param = self._delete_default_retention_serialize( project_id=project_id, region=region, + bucket_name=bucket_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2133,12 +2428,9 @@ def enable_service_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectStatus", - "201": "ProjectStatus", - "401": "ErrorMessage", - "403": "ErrorMessage", + "200": "DeleteDefaultRetentionResponse", + "404": "ErrorMessage", "409": "ErrorMessage", - "422": "HTTPValidationError", "500": "ErrorMessage", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2149,10 +2441,13 @@ def enable_service_with_http_info( ) @validate_call - def enable_service_without_preload_content( + def delete_default_retention_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], + bucket_name: Annotated[ + str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") + ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2163,14 +2458,16 @@ def enable_service_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create Project + """Delete Default Retention - Create a project. Creation will also be successful if the project already exists, but will not create a duplicate + Remove the default retention from a bucket. Object Lock itself remains enabled. :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str + :param bucket_name: The name has to be dns-conform. (required) + :type bucket_name: 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 @@ -2193,9 +2490,10 @@ def enable_service_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._enable_service_serialize( + _param = self._delete_default_retention_serialize( project_id=project_id, region=region, + bucket_name=bucket_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2203,21 +2501,19 @@ def enable_service_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectStatus", - "201": "ProjectStatus", - "401": "ErrorMessage", - "403": "ErrorMessage", + "200": "DeleteDefaultRetentionResponse", + "404": "ErrorMessage", "409": "ErrorMessage", - "422": "HTTPValidationError", "500": "ErrorMessage", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _enable_service_serialize( + def _delete_default_retention_serialize( self, project_id, region, + bucket_name, _request_auth, _content_type, _headers, @@ -2240,6 +2536,8 @@ def _enable_service_serialize( _path_params["projectId"] = project_id if region is not None: _path_params["region"] = region + if bucket_name is not None: + _path_params["bucketName"] = bucket_name # process the query parameters # process the header parameters # process the form parameters @@ -2253,8 +2551,8 @@ def _enable_service_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="POST", - resource_path="/v2/project/{projectId}/regions/{region}", + method="DELETE", + resource_path="/v2/project/{projectId}/regions/{region}/bucket/{bucketName}/default-retention", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2268,13 +2566,10 @@ def _enable_service_serialize( ) @validate_call - def get_bucket( + def disable_service( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], - bucket_name: Annotated[ - str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2284,17 +2579,15 @@ def get_bucket( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetBucketResponse: - """Get Bucket + ) -> ProjectStatus: + """Delete Project - Get information for the given bucket in the project. + Delete the given project :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str - :param bucket_name: The name has to be dns-conform. (required) - :type bucket_name: 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 @@ -2317,10 +2610,1590 @@ def get_bucket( :return: Returns the result object. """ # noqa: E501 - _param = self._get_bucket_serialize( + _param = self._disable_service_serialize( + project_id=project_id, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectStatus", + "400": "ErrorMessage", + "401": "ErrorMessage", + "403": "ErrorMessage", + "404": "ErrorMessage", + "409": "ErrorMessage", + "422": "ErrorMessage", + "500": "ErrorMessage", + } + 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 disable_service_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + _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[ProjectStatus]: + """Delete Project + + Delete the given project + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: 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._disable_service_serialize( + project_id=project_id, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectStatus", + "400": "ErrorMessage", + "401": "ErrorMessage", + "403": "ErrorMessage", + "404": "ErrorMessage", + "409": "ErrorMessage", + "422": "ErrorMessage", + "500": "ErrorMessage", + } + 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 disable_service_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + _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 Project + + Delete the given project + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: 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._disable_service_serialize( + project_id=project_id, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectStatus", + "400": "ErrorMessage", + "401": "ErrorMessage", + "403": "ErrorMessage", + "404": "ErrorMessage", + "409": "ErrorMessage", + "422": "ErrorMessage", + "500": "ErrorMessage", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _disable_service_serialize( + self, + project_id, + region, + _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 region is not None: + _path_params["region"] = region + # 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"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/v2/project/{projectId}/regions/{region}", + 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 enable_service( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + _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, + ) -> ProjectStatus: + """Create Project + + Create a project. Creation will also be successful if the project already exists, but will not create a duplicate + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: 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._enable_service_serialize( + project_id=project_id, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectStatus", + "201": "ProjectStatus", + "401": "ErrorMessage", + "403": "ErrorMessage", + "409": "ErrorMessage", + "422": "HTTPValidationError", + "500": "ErrorMessage", + } + 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 enable_service_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + _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[ProjectStatus]: + """Create Project + + Create a project. Creation will also be successful if the project already exists, but will not create a duplicate + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: 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._enable_service_serialize( + project_id=project_id, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectStatus", + "201": "ProjectStatus", + "401": "ErrorMessage", + "403": "ErrorMessage", + "409": "ErrorMessage", + "422": "HTTPValidationError", + "500": "ErrorMessage", + } + 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 enable_service_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + _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 Project + + Create a project. Creation will also be successful if the project already exists, but will not create a duplicate + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: 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._enable_service_serialize( + project_id=project_id, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ProjectStatus", + "201": "ProjectStatus", + "401": "ErrorMessage", + "403": "ErrorMessage", + "409": "ErrorMessage", + "422": "HTTPValidationError", + "500": "ErrorMessage", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _enable_service_serialize( + self, + project_id, + region, + _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 region is not None: + _path_params["region"] = region + # 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"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/v2/project/{projectId}/regions/{region}", + 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_bucket( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + bucket_name: Annotated[ + str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") + ], + _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, + ) -> GetBucketResponse: + """Get Bucket + + Get information for the given bucket in the project. + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: str + :param bucket_name: The name has to be dns-conform. (required) + :type bucket_name: 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_bucket_serialize( + project_id=project_id, + region=region, + bucket_name=bucket_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetBucketResponse", + "401": "ErrorMessage", + "403": "ErrorMessage", + "404": "ErrorMessage", + "422": "HTTPValidationError", + "500": "ErrorMessage", + } + 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_bucket_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + bucket_name: Annotated[ + str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") + ], + _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[GetBucketResponse]: + """Get Bucket + + Get information for the given bucket in the project. + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: str + :param bucket_name: The name has to be dns-conform. (required) + :type bucket_name: 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_bucket_serialize( + project_id=project_id, + region=region, + bucket_name=bucket_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetBucketResponse", + "401": "ErrorMessage", + "403": "ErrorMessage", + "404": "ErrorMessage", + "422": "HTTPValidationError", + "500": "ErrorMessage", + } + 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_bucket_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + bucket_name: Annotated[ + str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") + ], + _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 Bucket + + Get information for the given bucket in the project. + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: str + :param bucket_name: The name has to be dns-conform. (required) + :type bucket_name: 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_bucket_serialize( + project_id=project_id, + region=region, + bucket_name=bucket_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetBucketResponse", + "401": "ErrorMessage", + "403": "ErrorMessage", + "404": "ErrorMessage", + "422": "HTTPValidationError", + "500": "ErrorMessage", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_bucket_serialize( + self, + project_id, + region, + bucket_name, + _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 region is not None: + _path_params["region"] = region + if bucket_name is not None: + _path_params["bucketName"] = bucket_name + # 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"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v2/project/{projectId}/regions/{region}/bucket/{bucketName}", + 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_compliance_lock( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + _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, + ) -> ComplianceLockResponse: + """Get Compliance Lock + + Get the project-level compliance lock. + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: 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_compliance_lock_serialize( + project_id=project_id, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ComplianceLockResponse", + "404": "ErrorMessage", + "500": "ErrorMessage", + } + 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_compliance_lock_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + _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[ComplianceLockResponse]: + """Get Compliance Lock + + Get the project-level compliance lock. + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: 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_compliance_lock_serialize( + project_id=project_id, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ComplianceLockResponse", + "404": "ErrorMessage", + "500": "ErrorMessage", + } + 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_compliance_lock_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + _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 Compliance Lock + + Get the project-level compliance lock. + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: 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_compliance_lock_serialize( + project_id=project_id, + region=region, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "ComplianceLockResponse", + "404": "ErrorMessage", + "500": "ErrorMessage", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_compliance_lock_serialize( + self, + project_id, + region, + _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 region is not None: + _path_params["region"] = region + # 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"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v2/project/{projectId}/regions/{region}/compliance-lock", + 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_credentials_group( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + group_id: Annotated[StrictStr, Field(description="Id of the credentials group")], + _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, + ) -> GetCredentialsGroupResponse: + """Get Credentials Group + + Get the details of a single credentials group + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: str + :param group_id: Id of the credentials group (required) + :type group_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_credentials_group_serialize( + project_id=project_id, + region=region, + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetCredentialsGroupResponse", + "404": "ErrorMessage", + "422": "HTTPValidationError", + "500": "ErrorMessage", + } + 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_credentials_group_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + group_id: Annotated[StrictStr, Field(description="Id of the credentials group")], + _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[GetCredentialsGroupResponse]: + """Get Credentials Group + + Get the details of a single credentials group + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: str + :param group_id: Id of the credentials group (required) + :type group_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_credentials_group_serialize( + project_id=project_id, + region=region, + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetCredentialsGroupResponse", + "404": "ErrorMessage", + "422": "HTTPValidationError", + "500": "ErrorMessage", + } + 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_credentials_group_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + group_id: Annotated[StrictStr, Field(description="Id of the credentials group")], + _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 Credentials Group + + Get the details of a single credentials group + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: str + :param group_id: Id of the credentials group (required) + :type group_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_credentials_group_serialize( + project_id=project_id, + region=region, + group_id=group_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "GetCredentialsGroupResponse", + "404": "ErrorMessage", + "422": "HTTPValidationError", + "500": "ErrorMessage", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_credentials_group_serialize( + self, + project_id, + region, + group_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 region is not None: + _path_params["region"] = region + if group_id is not None: + _path_params["groupId"] = group_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"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v2/project/{projectId}/regions/{region}/credentials-group/{groupId}", + 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_default_retention( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + bucket_name: Annotated[ + str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") + ], + _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, + ) -> DefaultRetentionResponse: + """Get Default Retention + + Get the default retention configuration for a bucket. + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: str + :param bucket_name: The name has to be dns-conform. (required) + :type bucket_name: 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_default_retention_serialize( + project_id=project_id, + region=region, + bucket_name=bucket_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DefaultRetentionResponse", + "404": "ErrorMessage", + "409": "ErrorMessage", + "500": "ErrorMessage", + } + 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_default_retention_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + bucket_name: Annotated[ + str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") + ], + _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[DefaultRetentionResponse]: + """Get Default Retention + + Get the default retention configuration for a bucket. + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: str + :param bucket_name: The name has to be dns-conform. (required) + :type bucket_name: 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_default_retention_serialize( + project_id=project_id, + region=region, + bucket_name=bucket_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DefaultRetentionResponse", + "404": "ErrorMessage", + "409": "ErrorMessage", + "500": "ErrorMessage", + } + 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_default_retention_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + bucket_name: Annotated[ + str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") + ], + _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 Default Retention + + Get the default retention configuration for a bucket. + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: str + :param bucket_name: The name has to be dns-conform. (required) + :type bucket_name: 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_default_retention_serialize( + project_id=project_id, + region=region, + bucket_name=bucket_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "DefaultRetentionResponse", + "404": "ErrorMessage", + "409": "ErrorMessage", + "500": "ErrorMessage", + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_default_retention_serialize( + self, + project_id, + region, + bucket_name, + _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 region is not None: + _path_params["region"] = region + if bucket_name is not None: + _path_params["bucketName"] = bucket_name + # 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"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="GET", + resource_path="/v2/project/{projectId}/regions/{region}/bucket/{bucketName}/default-retention", + 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_service_status( + self, + project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], + region: Annotated[StrictStr, Field(description="STACKIT Region")], + _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, + ) -> ProjectStatus: + """Get Project + + Get project details. + + :param project_id: STACKIT project ID (required) + :type project_id: str + :param region: STACKIT Region (required) + :type region: 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_service_status_serialize( project_id=project_id, region=region, - bucket_name=bucket_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2328,7 +4201,7 @@ def get_bucket( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetBucketResponse", + "200": "ProjectStatus", "401": "ErrorMessage", "403": "ErrorMessage", "404": "ErrorMessage", @@ -2343,13 +4216,10 @@ def get_bucket( ).data @validate_call - def get_bucket_with_http_info( + def get_service_status_with_http_info( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], - bucket_name: Annotated[ - str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2359,17 +4229,15 @@ def get_bucket_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[GetBucketResponse]: - """Get Bucket + ) -> ApiResponse[ProjectStatus]: + """Get Project - Get information for the given bucket in the project. + Get project details. :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str - :param bucket_name: The name has to be dns-conform. (required) - :type bucket_name: 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 @@ -2392,10 +4260,9 @@ def get_bucket_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_bucket_serialize( + _param = self._get_service_status_serialize( project_id=project_id, region=region, - bucket_name=bucket_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2403,7 +4270,7 @@ def get_bucket_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetBucketResponse", + "200": "ProjectStatus", "401": "ErrorMessage", "403": "ErrorMessage", "404": "ErrorMessage", @@ -2418,13 +4285,10 @@ def get_bucket_with_http_info( ) @validate_call - def get_bucket_without_preload_content( + def get_service_status_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], - bucket_name: Annotated[ - str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") - ], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2435,16 +4299,14 @@ def get_bucket_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Bucket + """Get Project - Get information for the given bucket in the project. + Get project details. :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str - :param bucket_name: The name has to be dns-conform. (required) - :type bucket_name: 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 @@ -2467,10 +4329,9 @@ def get_bucket_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_bucket_serialize( + _param = self._get_service_status_serialize( project_id=project_id, region=region, - bucket_name=bucket_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2478,7 +4339,7 @@ def get_bucket_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "GetBucketResponse", + "200": "ProjectStatus", "401": "ErrorMessage", "403": "ErrorMessage", "404": "ErrorMessage", @@ -2488,11 +4349,10 @@ def get_bucket_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_bucket_serialize( + def _get_service_status_serialize( self, project_id, region, - bucket_name, _request_auth, _content_type, _headers, @@ -2515,8 +4375,6 @@ def _get_bucket_serialize( _path_params["projectId"] = project_id if region is not None: _path_params["region"] = region - if bucket_name is not None: - _path_params["bucketName"] = bucket_name # process the query parameters # process the header parameters # process the form parameters @@ -2531,7 +4389,7 @@ def _get_bucket_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2/project/{projectId}/regions/{region}/bucket/{bucketName}", + resource_path="/v2/project/{projectId}/regions/{region}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2545,10 +4403,11 @@ def _get_bucket_serialize( ) @validate_call - def get_service_status( + def list_access_keys( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], + credentials_group: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2558,15 +4417,17 @@ def get_service_status( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ProjectStatus: - """Get Project + ) -> ListAccessKeysResponse: + """Get Access Keys - Get project details. + Get a list of access keys for the given project. :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str + :param credentials_group: + :type credentials_group: 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 @@ -2589,9 +4450,10 @@ def get_service_status( :return: Returns the result object. """ # noqa: E501 - _param = self._get_service_status_serialize( + _param = self._list_access_keys_serialize( project_id=project_id, region=region, + credentials_group=credentials_group, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2599,7 +4461,7 @@ def get_service_status( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectStatus", + "200": "ListAccessKeysResponse", "401": "ErrorMessage", "403": "ErrorMessage", "404": "ErrorMessage", @@ -2614,10 +4476,11 @@ def get_service_status( ).data @validate_call - def get_service_status_with_http_info( + def list_access_keys_with_http_info( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], + credentials_group: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2627,15 +4490,17 @@ def get_service_status_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[ProjectStatus]: - """Get Project + ) -> ApiResponse[ListAccessKeysResponse]: + """Get Access Keys - Get project details. + Get a list of access keys for the given project. :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str + :param credentials_group: + :type credentials_group: 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 @@ -2658,9 +4523,10 @@ def get_service_status_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_service_status_serialize( + _param = self._list_access_keys_serialize( project_id=project_id, region=region, + credentials_group=credentials_group, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2668,7 +4534,7 @@ def get_service_status_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectStatus", + "200": "ListAccessKeysResponse", "401": "ErrorMessage", "403": "ErrorMessage", "404": "ErrorMessage", @@ -2683,10 +4549,11 @@ def get_service_status_with_http_info( ) @validate_call - def get_service_status_without_preload_content( + def list_access_keys_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], + credentials_group: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2697,14 +4564,16 @@ def get_service_status_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Project + """Get Access Keys - Get project details. + Get a list of access keys for the given project. :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str + :param credentials_group: + :type credentials_group: 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 @@ -2727,9 +4596,10 @@ def get_service_status_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_service_status_serialize( + _param = self._list_access_keys_serialize( project_id=project_id, region=region, + credentials_group=credentials_group, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2737,7 +4607,7 @@ def get_service_status_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ProjectStatus", + "200": "ListAccessKeysResponse", "401": "ErrorMessage", "403": "ErrorMessage", "404": "ErrorMessage", @@ -2747,10 +4617,11 @@ def get_service_status_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_service_status_serialize( + def _list_access_keys_serialize( self, project_id, region, + credentials_group, _request_auth, _content_type, _headers, @@ -2774,6 +4645,10 @@ def _get_service_status_serialize( if region is not None: _path_params["region"] = region # process the query parameters + if credentials_group is not None: + + _query_params.append(("credentials-group", credentials_group)) + # process the header parameters # process the form parameters # process the body parameter @@ -2787,7 +4662,7 @@ def _get_service_status_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2/project/{projectId}/regions/{region}", + resource_path="/v2/project/{projectId}/regions/{region}/access-keys", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2801,11 +4676,10 @@ def _get_service_status_serialize( ) @validate_call - def list_access_keys( + def list_buckets( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], - credentials_group: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2815,17 +4689,15 @@ def list_access_keys( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListAccessKeysResponse: - """Get Access Keys + ) -> ListBucketsResponse: + """Get Buckets - Get a list of access keys for the given project. + Get the list of all buckets in the given project :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str - :param credentials_group: - :type credentials_group: 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 @@ -2848,10 +4720,9 @@ def list_access_keys( :return: Returns the result object. """ # noqa: E501 - _param = self._list_access_keys_serialize( + _param = self._list_buckets_serialize( project_id=project_id, region=region, - credentials_group=credentials_group, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2859,7 +4730,7 @@ def list_access_keys( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListAccessKeysResponse", + "200": "ListBucketsResponse", "401": "ErrorMessage", "403": "ErrorMessage", "404": "ErrorMessage", @@ -2874,11 +4745,10 @@ def list_access_keys( ).data @validate_call - def list_access_keys_with_http_info( + def list_buckets_with_http_info( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], - credentials_group: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2888,17 +4758,15 @@ def list_access_keys_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[ListAccessKeysResponse]: - """Get Access Keys + ) -> ApiResponse[ListBucketsResponse]: + """Get Buckets - Get a list of access keys for the given project. + Get the list of all buckets in the given project :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str - :param credentials_group: - :type credentials_group: 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 @@ -2921,10 +4789,9 @@ def list_access_keys_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_access_keys_serialize( + _param = self._list_buckets_serialize( project_id=project_id, region=region, - credentials_group=credentials_group, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2932,7 +4799,7 @@ def list_access_keys_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListAccessKeysResponse", + "200": "ListBucketsResponse", "401": "ErrorMessage", "403": "ErrorMessage", "404": "ErrorMessage", @@ -2947,11 +4814,10 @@ def list_access_keys_with_http_info( ) @validate_call - def list_access_keys_without_preload_content( + def list_buckets_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], - credentials_group: Optional[Annotated[str, Field(min_length=36, strict=True, max_length=36)]] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2962,16 +4828,14 @@ def list_access_keys_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Access Keys + """Get Buckets - Get a list of access keys for the given project. + Get the list of all buckets in the given project :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str - :param credentials_group: - :type credentials_group: 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 @@ -2994,10 +4858,9 @@ def list_access_keys_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_access_keys_serialize( + _param = self._list_buckets_serialize( project_id=project_id, region=region, - credentials_group=credentials_group, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3005,7 +4868,7 @@ def list_access_keys_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListAccessKeysResponse", + "200": "ListBucketsResponse", "401": "ErrorMessage", "403": "ErrorMessage", "404": "ErrorMessage", @@ -3015,11 +4878,10 @@ def list_access_keys_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_access_keys_serialize( + def _list_buckets_serialize( self, project_id, region, - credentials_group, _request_auth, _content_type, _headers, @@ -3043,10 +4905,6 @@ def _list_access_keys_serialize( if region is not None: _path_params["region"] = region # process the query parameters - if credentials_group is not None: - - _query_params.append(("credentials-group", credentials_group)) - # process the header parameters # process the form parameters # process the body parameter @@ -3060,7 +4918,7 @@ def _list_access_keys_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2/project/{projectId}/regions/{region}/access-keys", + resource_path="/v2/project/{projectId}/regions/{region}/buckets", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3074,7 +4932,7 @@ def _list_access_keys_serialize( ) @validate_call - def list_buckets( + def list_credentials_groups( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], @@ -3087,10 +4945,10 @@ def list_buckets( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListBucketsResponse: - """Get Buckets + ) -> ListCredentialsGroupsResponse: + """Get Credentials Groups - Get the list of all buckets in the given project + Get credentials groups inside a project if the project exists :param project_id: STACKIT project ID (required) :type project_id: str @@ -3118,7 +4976,7 @@ def list_buckets( :return: Returns the result object. """ # noqa: E501 - _param = self._list_buckets_serialize( + _param = self._list_credentials_groups_serialize( project_id=project_id, region=region, _request_auth=_request_auth, @@ -3128,9 +4986,8 @@ def list_buckets( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListBucketsResponse", + "200": "ListCredentialsGroupsResponse", "401": "ErrorMessage", - "403": "ErrorMessage", "404": "ErrorMessage", "422": "HTTPValidationError", "500": "ErrorMessage", @@ -3143,7 +5000,7 @@ def list_buckets( ).data @validate_call - def list_buckets_with_http_info( + def list_credentials_groups_with_http_info( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], @@ -3156,10 +5013,10 @@ def list_buckets_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[ListBucketsResponse]: - """Get Buckets + ) -> ApiResponse[ListCredentialsGroupsResponse]: + """Get Credentials Groups - Get the list of all buckets in the given project + Get credentials groups inside a project if the project exists :param project_id: STACKIT project ID (required) :type project_id: str @@ -3187,7 +5044,7 @@ def list_buckets_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_buckets_serialize( + _param = self._list_credentials_groups_serialize( project_id=project_id, region=region, _request_auth=_request_auth, @@ -3197,9 +5054,8 @@ def list_buckets_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListBucketsResponse", + "200": "ListCredentialsGroupsResponse", "401": "ErrorMessage", - "403": "ErrorMessage", "404": "ErrorMessage", "422": "HTTPValidationError", "500": "ErrorMessage", @@ -3212,7 +5068,7 @@ def list_buckets_with_http_info( ) @validate_call - def list_buckets_without_preload_content( + def list_credentials_groups_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], @@ -3226,9 +5082,9 @@ def list_buckets_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Buckets + """Get Credentials Groups - Get the list of all buckets in the given project + Get credentials groups inside a project if the project exists :param project_id: STACKIT project ID (required) :type project_id: str @@ -3256,7 +5112,7 @@ def list_buckets_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_buckets_serialize( + _param = self._list_credentials_groups_serialize( project_id=project_id, region=region, _request_auth=_request_auth, @@ -3266,9 +5122,8 @@ def list_buckets_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListBucketsResponse", + "200": "ListCredentialsGroupsResponse", "401": "ErrorMessage", - "403": "ErrorMessage", "404": "ErrorMessage", "422": "HTTPValidationError", "500": "ErrorMessage", @@ -3276,7 +5131,7 @@ def list_buckets_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_buckets_serialize( + def _list_credentials_groups_serialize( self, project_id, region, @@ -3316,7 +5171,7 @@ def _list_buckets_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v2/project/{projectId}/regions/{region}/buckets", + resource_path="/v2/project/{projectId}/regions/{region}/credentials-groups", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3330,10 +5185,14 @@ def _list_buckets_serialize( ) @validate_call - def list_credentials_groups( + def set_default_retention( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], + bucket_name: Annotated[ + str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") + ], + set_default_retention_payload: SetDefaultRetentionPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3343,15 +5202,19 @@ def list_credentials_groups( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ListCredentialsGroupsResponse: - """Get Credentials Groups + ) -> DefaultRetentionResponse: + """Update Default Retention - Get credentials groups inside a project if the project exists + Set or update the default retention for a bucket. :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str + :param bucket_name: The name has to be dns-conform. (required) + :type bucket_name: str + :param set_default_retention_payload: (required) + :type set_default_retention_payload: SetDefaultRetentionPayload :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 @@ -3374,9 +5237,11 @@ def list_credentials_groups( :return: Returns the result object. """ # noqa: E501 - _param = self._list_credentials_groups_serialize( + _param = self._set_default_retention_serialize( project_id=project_id, region=region, + bucket_name=bucket_name, + set_default_retention_payload=set_default_retention_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3384,10 +5249,10 @@ def list_credentials_groups( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListCredentialsGroupsResponse", - "401": "ErrorMessage", + "200": "DefaultRetentionResponse", + "400": "ErrorMessage", "404": "ErrorMessage", - "422": "HTTPValidationError", + "409": "ErrorMessage", "500": "ErrorMessage", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3398,10 +5263,14 @@ def list_credentials_groups( ).data @validate_call - def list_credentials_groups_with_http_info( + def set_default_retention_with_http_info( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], + bucket_name: Annotated[ + str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") + ], + set_default_retention_payload: SetDefaultRetentionPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3411,15 +5280,19 @@ def list_credentials_groups_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[ListCredentialsGroupsResponse]: - """Get Credentials Groups + ) -> ApiResponse[DefaultRetentionResponse]: + """Update Default Retention - Get credentials groups inside a project if the project exists + Set or update the default retention for a bucket. :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str + :param bucket_name: The name has to be dns-conform. (required) + :type bucket_name: str + :param set_default_retention_payload: (required) + :type set_default_retention_payload: SetDefaultRetentionPayload :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 @@ -3442,9 +5315,11 @@ def list_credentials_groups_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_credentials_groups_serialize( + _param = self._set_default_retention_serialize( project_id=project_id, region=region, + bucket_name=bucket_name, + set_default_retention_payload=set_default_retention_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3452,10 +5327,10 @@ def list_credentials_groups_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListCredentialsGroupsResponse", - "401": "ErrorMessage", + "200": "DefaultRetentionResponse", + "400": "ErrorMessage", "404": "ErrorMessage", - "422": "HTTPValidationError", + "409": "ErrorMessage", "500": "ErrorMessage", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -3466,10 +5341,14 @@ def list_credentials_groups_with_http_info( ) @validate_call - def list_credentials_groups_without_preload_content( + def set_default_retention_without_preload_content( self, project_id: Annotated[StrictStr, Field(description="STACKIT project ID")], region: Annotated[StrictStr, Field(description="STACKIT Region")], + bucket_name: Annotated[ + str, Field(min_length=3, strict=True, max_length=63, description="The name has to be dns-conform.") + ], + set_default_retention_payload: SetDefaultRetentionPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3480,14 +5359,18 @@ def list_credentials_groups_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Credentials Groups + """Update Default Retention - Get credentials groups inside a project if the project exists + Set or update the default retention for a bucket. :param project_id: STACKIT project ID (required) :type project_id: str :param region: STACKIT Region (required) :type region: str + :param bucket_name: The name has to be dns-conform. (required) + :type bucket_name: str + :param set_default_retention_payload: (required) + :type set_default_retention_payload: SetDefaultRetentionPayload :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 @@ -3510,9 +5393,11 @@ def list_credentials_groups_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_credentials_groups_serialize( + _param = self._set_default_retention_serialize( project_id=project_id, region=region, + bucket_name=bucket_name, + set_default_retention_payload=set_default_retention_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3520,19 +5405,21 @@ def list_credentials_groups_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "ListCredentialsGroupsResponse", - "401": "ErrorMessage", + "200": "DefaultRetentionResponse", + "400": "ErrorMessage", "404": "ErrorMessage", - "422": "HTTPValidationError", + "409": "ErrorMessage", "500": "ErrorMessage", } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_credentials_groups_serialize( + def _set_default_retention_serialize( self, project_id, region, + bucket_name, + set_default_retention_payload, _request_auth, _content_type, _headers, @@ -3555,21 +5442,33 @@ def _list_credentials_groups_serialize( _path_params["projectId"] = project_id if region is not None: _path_params["region"] = region + if bucket_name is not None: + _path_params["bucketName"] = bucket_name # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if set_default_retention_payload is not None: + _body_params = set_default_retention_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + # 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="GET", - resource_path="/v2/project/{projectId}/regions/{region}/credentials-groups", + method="PUT", + resource_path="/v2/project/{projectId}/regions/{region}/bucket/{bucketName}/default-retention", path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/services/objectstorage/src/stackit/objectstorage/models/__init__.py b/services/objectstorage/src/stackit/objectstorage/models/__init__.py index 5079528d4..1308cda5c 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/__init__.py +++ b/services/objectstorage/src/stackit/objectstorage/models/__init__.py @@ -15,6 +15,7 @@ # import models into model package from stackit.objectstorage.models.access_key import AccessKey from stackit.objectstorage.models.bucket import Bucket +from stackit.objectstorage.models.compliance_lock_response import ComplianceLockResponse from stackit.objectstorage.models.create_access_key_payload import ( CreateAccessKeyPayload, ) @@ -29,6 +30,12 @@ CreateCredentialsGroupResponse, ) from stackit.objectstorage.models.credentials_group import CredentialsGroup +from stackit.objectstorage.models.credentials_group_extended import ( + CredentialsGroupExtended, +) +from stackit.objectstorage.models.default_retention_response import ( + DefaultRetentionResponse, +) from stackit.objectstorage.models.delete_access_key_response import ( DeleteAccessKeyResponse, ) @@ -36,9 +43,15 @@ from stackit.objectstorage.models.delete_credentials_group_response import ( DeleteCredentialsGroupResponse, ) +from stackit.objectstorage.models.delete_default_retention_response import ( + DeleteDefaultRetentionResponse, +) from stackit.objectstorage.models.detailed_error import DetailedError from stackit.objectstorage.models.error_message import ErrorMessage from stackit.objectstorage.models.get_bucket_response import GetBucketResponse +from stackit.objectstorage.models.get_credentials_group_response import ( + GetCredentialsGroupResponse, +) from stackit.objectstorage.models.http_validation_error import HTTPValidationError from stackit.objectstorage.models.list_access_keys_response import ( ListAccessKeysResponse, @@ -50,4 +63,8 @@ from stackit.objectstorage.models.location_inner import LocationInner from stackit.objectstorage.models.project_scope import ProjectScope from stackit.objectstorage.models.project_status import ProjectStatus +from stackit.objectstorage.models.retention_mode import RetentionMode +from stackit.objectstorage.models.set_default_retention_payload import ( + SetDefaultRetentionPayload, +) from stackit.objectstorage.models.validation_error import ValidationError diff --git a/services/objectstorage/src/stackit/objectstorage/models/bucket.py b/services/objectstorage/src/stackit/objectstorage/models/bucket.py index 93fa50f2c..632bd707d 100644 --- a/services/objectstorage/src/stackit/objectstorage/models/bucket.py +++ b/services/objectstorage/src/stackit/objectstorage/models/bucket.py @@ -17,7 +17,13 @@ import pprint from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import ( + BaseModel, + ConfigDict, + Field, + StrictBool, + StrictStr, +) from typing_extensions import Self @@ -27,12 +33,15 @@ class Bucket(BaseModel): """ # noqa: E501 name: StrictStr + object_lock_enabled: StrictBool = Field( + description="Whether S3 Object Lock is enabled for this bucket", alias="objectLockEnabled" + ) region: StrictStr url_path_style: StrictStr = Field(description="URL in path style", alias="urlPathStyle") url_virtual_hosted_style: StrictStr = Field( description="URL in virtual hosted style", alias="urlVirtualHostedStyle" ) - __properties: ClassVar[List[str]] = ["name", "region", "urlPathStyle", "urlVirtualHostedStyle"] + __properties: ClassVar[List[str]] = ["name", "objectLockEnabled", "region", "urlPathStyle", "urlVirtualHostedStyle"] model_config = ConfigDict( populate_by_name=True, @@ -85,6 +94,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate( { "name": obj.get("name"), + "objectLockEnabled": obj.get("objectLockEnabled"), "region": obj.get("region"), "urlPathStyle": obj.get("urlPathStyle"), "urlVirtualHostedStyle": obj.get("urlVirtualHostedStyle"), diff --git a/services/objectstorage/src/stackit/objectstorage/models/compliance_lock_response.py b/services/objectstorage/src/stackit/objectstorage/models/compliance_lock_response.py new file mode 100644 index 000000000..f628b9c37 --- /dev/null +++ b/services/objectstorage/src/stackit/objectstorage/models/compliance_lock_response.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + STACKIT Object Storage API + + STACKIT API to manage the Object Storage + + The version of the OpenAPI document: 2.0.1 + 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, StrictInt, StrictStr +from typing_extensions import Self + + +class ComplianceLockResponse(BaseModel): + """ + ComplianceLockResponse + """ # noqa: E501 + + max_retention_days: StrictInt = Field(description="Maximum retention period in days", alias="maxRetentionDays") + project: StrictStr = Field(description="Project ID") + __properties: ClassVar[List[str]] = ["maxRetentionDays", "project"] + + 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 ComplianceLockResponse 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 ComplianceLockResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"maxRetentionDays": obj.get("maxRetentionDays"), "project": obj.get("project")}) + return _obj diff --git a/services/objectstorage/src/stackit/objectstorage/models/credentials_group_extended.py b/services/objectstorage/src/stackit/objectstorage/models/credentials_group_extended.py new file mode 100644 index 000000000..80dbb4308 --- /dev/null +++ b/services/objectstorage/src/stackit/objectstorage/models/credentials_group_extended.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + STACKIT Object Storage API + + STACKIT API to manage the Object Storage + + The version of the OpenAPI document: 2.0.1 + 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 CredentialsGroupExtended(BaseModel): + """ + CredentialsGroupExtended + """ # noqa: E501 + + credentials_group_id: StrictStr = Field(description="The ID of the credentials group", alias="credentialsGroupId") + display_name: StrictStr = Field(description="Name of the group holding credentials", alias="displayName") + urn: StrictStr = Field(description="StorageGRID group URN") + user_urn: StrictStr = Field(description="StorageGRID user URN", alias="userUrn") + __properties: ClassVar[List[str]] = ["credentialsGroupId", "displayName", "urn", "userUrn"] + + 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 CredentialsGroupExtended 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 CredentialsGroupExtended from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "credentialsGroupId": obj.get("credentialsGroupId"), + "displayName": obj.get("displayName"), + "urn": obj.get("urn"), + "userUrn": obj.get("userUrn"), + } + ) + return _obj diff --git a/services/objectstorage/src/stackit/objectstorage/models/default_retention_response.py b/services/objectstorage/src/stackit/objectstorage/models/default_retention_response.py new file mode 100644 index 000000000..c9346d084 --- /dev/null +++ b/services/objectstorage/src/stackit/objectstorage/models/default_retention_response.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + STACKIT Object Storage API + + STACKIT API to manage the Object Storage + + The version of the OpenAPI document: 2.0.1 + 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, StrictInt, StrictStr +from typing_extensions import Self + +from stackit.objectstorage.models.retention_mode import RetentionMode + + +class DefaultRetentionResponse(BaseModel): + """ + DefaultRetentionResponse + """ # noqa: E501 + + bucket: StrictStr = Field(description="Name of the bucket") + days: StrictInt = Field(description="Retention period in days") + mode: RetentionMode + project: StrictStr = Field(description="Project ID") + __properties: ClassVar[List[str]] = ["bucket", "days", "mode", "project"] + + 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 DefaultRetentionResponse 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 DefaultRetentionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "bucket": obj.get("bucket"), + "days": obj.get("days"), + "mode": obj.get("mode"), + "project": obj.get("project"), + } + ) + return _obj diff --git a/services/objectstorage/src/stackit/objectstorage/models/delete_default_retention_response.py b/services/objectstorage/src/stackit/objectstorage/models/delete_default_retention_response.py new file mode 100644 index 000000000..2c97baade --- /dev/null +++ b/services/objectstorage/src/stackit/objectstorage/models/delete_default_retention_response.py @@ -0,0 +1,82 @@ +# coding: utf-8 + +""" + STACKIT Object Storage API + + STACKIT API to manage the Object Storage + + The version of the OpenAPI document: 2.0.1 + 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 DeleteDefaultRetentionResponse(BaseModel): + """ + DeleteDefaultRetentionResponse + """ # noqa: E501 + + bucket: StrictStr = Field(description="Name of the bucket") + project: StrictStr = Field(description="Project ID") + __properties: ClassVar[List[str]] = ["bucket", "project"] + + 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 DeleteDefaultRetentionResponse 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 DeleteDefaultRetentionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"bucket": obj.get("bucket"), "project": obj.get("project")}) + return _obj diff --git a/services/objectstorage/src/stackit/objectstorage/models/get_credentials_group_response.py b/services/objectstorage/src/stackit/objectstorage/models/get_credentials_group_response.py new file mode 100644 index 000000000..1fc94f1d1 --- /dev/null +++ b/services/objectstorage/src/stackit/objectstorage/models/get_credentials_group_response.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + STACKIT Object Storage API + + STACKIT API to manage the Object Storage + + The version of the OpenAPI document: 2.0.1 + 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 + +from stackit.objectstorage.models.credentials_group_extended import ( + CredentialsGroupExtended, +) + + +class GetCredentialsGroupResponse(BaseModel): + """ + GetCredentialsGroupResponse + """ # noqa: E501 + + credentials_group: CredentialsGroupExtended = Field(alias="credentialsGroup") + project: StrictStr = Field(description="Project ID") + __properties: ClassVar[List[str]] = ["credentialsGroup", "project"] + + 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 GetCredentialsGroupResponse 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 credentials_group + if self.credentials_group: + _dict["credentialsGroup"] = self.credentials_group.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetCredentialsGroupResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "credentialsGroup": ( + CredentialsGroupExtended.from_dict(obj["credentialsGroup"]) + if obj.get("credentialsGroup") is not None + else None + ), + "project": obj.get("project"), + } + ) + return _obj diff --git a/services/objectstorage/src/stackit/objectstorage/models/retention_mode.py b/services/objectstorage/src/stackit/objectstorage/models/retention_mode.py new file mode 100644 index 000000000..eec24d452 --- /dev/null +++ b/services/objectstorage/src/stackit/objectstorage/models/retention_mode.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + STACKIT Object Storage API + + STACKIT API to manage the Object Storage + + The version of the OpenAPI document: 2.0.1 + 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 + + +class RetentionMode(BaseModel): + """ + The retention mode for default retention on a bucket. + """ # noqa: E501 + + __properties: ClassVar[List[str]] = [] + + 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 RetentionMode 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 RetentionMode from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({}) + return _obj diff --git a/services/objectstorage/src/stackit/objectstorage/models/set_default_retention_payload.py b/services/objectstorage/src/stackit/objectstorage/models/set_default_retention_payload.py new file mode 100644 index 000000000..8105f5526 --- /dev/null +++ b/services/objectstorage/src/stackit/objectstorage/models/set_default_retention_payload.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +""" + STACKIT Object Storage API + + STACKIT API to manage the Object Storage + + The version of the OpenAPI document: 2.0.1 + 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 +from typing_extensions import Annotated, Self + +from stackit.objectstorage.models.retention_mode import RetentionMode + + +class SetDefaultRetentionPayload(BaseModel): + """ + SetDefaultRetentionPayload + """ # noqa: E501 + + days: Annotated[int, Field(strict=True, gt=0)] = Field(description="Retention period in days") + mode: RetentionMode + __properties: ClassVar[List[str]] = ["days", "mode"] + + 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 SetDefaultRetentionPayload 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 SetDefaultRetentionPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"days": obj.get("days"), "mode": obj.get("mode")}) + return _obj