From f25c076b611ce26950d6a782d5ba5ebd9d94fc03 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Fri, 28 Aug 2026 11:28:41 +0000 Subject: [PATCH] Generate logs --- services/logs/oas_commit | 2 +- services/logs/src/stackit/logs/__init__.py | 14 +- .../logs/src/stackit/logs/api/default_api.py | 2301 ++++++++++++++--- services/logs/src/stackit/logs/api_client.py | 2 +- .../logs/src/stackit/logs/configuration.py | 2 +- services/logs/src/stackit/logs/exceptions.py | 2 +- .../logs/src/stackit/logs/models/__init__.py | 6 +- .../src/stackit/logs/models/access_policy.py | 107 + .../stackit/logs/models/access_policy_list.py | 99 + .../src/stackit/logs/models/access_token.py | 6 +- .../stackit/logs/models/access_token_list.py | 2 +- .../models/create_access_policy_payload.py | 105 + .../models/create_access_token_payload.py | 6 +- .../models/create_logs_instance_payload.py | 2 +- .../src/stackit/logs/models/logs_instance.py | 2 +- .../logs/models/logs_instances_list.py | 2 +- .../models/update_access_policy_payload.py | 104 + .../models/update_access_token_payload.py | 2 +- .../models/update_logs_instance_payload.py | 2 +- services/logs/src/stackit/logs/rest.py | 2 +- 20 files changed, 2463 insertions(+), 307 deletions(-) create mode 100644 services/logs/src/stackit/logs/models/access_policy.py create mode 100644 services/logs/src/stackit/logs/models/access_policy_list.py create mode 100644 services/logs/src/stackit/logs/models/create_access_policy_payload.py create mode 100644 services/logs/src/stackit/logs/models/update_access_policy_payload.py diff --git a/services/logs/oas_commit b/services/logs/oas_commit index fd8ff3e68..fc3f2e0cd 100644 --- a/services/logs/oas_commit +++ b/services/logs/oas_commit @@ -1 +1 @@ -c09e232a83532c75ca1041153e3ebc7ce2d50eb6 +3495dec9dec80e7ef859725d8161fdb7940238a6 diff --git a/services/logs/src/stackit/logs/__init__.py b/services/logs/src/stackit/logs/__init__.py index 309f72d4c..26aac08c3 100644 --- a/services/logs/src/stackit/logs/__init__.py +++ b/services/logs/src/stackit/logs/__init__.py @@ -7,7 +7,7 @@ This API provides endpoints for managing STACKIT Logs. -The version of the OpenAPI document: 1.0.0 +The version of the OpenAPI document: 1.1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -27,12 +27,16 @@ "ApiKeyError", "ApiAttributeError", "ApiException", + "AccessPolicy", + "AccessPolicyList", "AccessToken", "AccessTokenList", + "CreateAccessPolicyPayload", "CreateAccessTokenPayload", "CreateLogsInstancePayload", "LogsInstance", "LogsInstancesList", + "UpdateAccessPolicyPayload", "UpdateAccessTokenPayload", "UpdateLogsInstancePayload", ] @@ -52,8 +56,13 @@ from stackit.logs.exceptions import OpenApiException as OpenApiException # import models into sdk package +from stackit.logs.models.access_policy import AccessPolicy as AccessPolicy +from stackit.logs.models.access_policy_list import AccessPolicyList as AccessPolicyList from stackit.logs.models.access_token import AccessToken as AccessToken from stackit.logs.models.access_token_list import AccessTokenList as AccessTokenList +from stackit.logs.models.create_access_policy_payload import ( + CreateAccessPolicyPayload as CreateAccessPolicyPayload, +) from stackit.logs.models.create_access_token_payload import ( CreateAccessTokenPayload as CreateAccessTokenPayload, ) @@ -64,6 +73,9 @@ from stackit.logs.models.logs_instances_list import ( LogsInstancesList as LogsInstancesList, ) +from stackit.logs.models.update_access_policy_payload import ( + UpdateAccessPolicyPayload as UpdateAccessPolicyPayload, +) from stackit.logs.models.update_access_token_payload import ( UpdateAccessTokenPayload as UpdateAccessTokenPayload, ) diff --git a/services/logs/src/stackit/logs/api/default_api.py b/services/logs/src/stackit/logs/api/default_api.py index 678e4b907..2e367b987 100644 --- a/services/logs/src/stackit/logs/api/default_api.py +++ b/services/logs/src/stackit/logs/api/default_api.py @@ -5,7 +5,7 @@ This API provides endpoints for managing STACKIT Logs. -The version of the OpenAPI document: 1.0.0 +The version of the OpenAPI document: 1.1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -26,12 +26,16 @@ from stackit.logs.api_client import ApiClient, RequestSerialized from stackit.logs.api_response import ApiResponse +from stackit.logs.models.access_policy import AccessPolicy +from stackit.logs.models.access_policy_list import AccessPolicyList from stackit.logs.models.access_token import AccessToken from stackit.logs.models.access_token_list import AccessTokenList +from stackit.logs.models.create_access_policy_payload import CreateAccessPolicyPayload from stackit.logs.models.create_access_token_payload import CreateAccessTokenPayload from stackit.logs.models.create_logs_instance_payload import CreateLogsInstancePayload from stackit.logs.models.logs_instance import LogsInstance from stackit.logs.models.logs_instances_list import LogsInstancesList +from stackit.logs.models.update_access_policy_payload import UpdateAccessPolicyPayload from stackit.logs.models.update_access_token_payload import UpdateAccessTokenPayload from stackit.logs.models.update_logs_instance_payload import UpdateLogsInstancePayload from stackit.logs.rest import RESTResponseType @@ -50,13 +54,1722 @@ def __init__(self, configuration: Configuration = None) -> None: self.configuration = configuration self.api_client = ApiClient(self.configuration) + @validate_call + def create_access_policy( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + create_access_policy_payload: CreateAccessPolicyPayload, + _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, + ) -> AccessPolicy: + """Create Access Policy + + Create a new access policy for Logs instance + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param create_access_policy_payload: (required) + :type create_access_policy_payload: CreateAccessPolicyPayload + :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_access_policy_serialize( + project_id=project_id, + region_id=region_id, + instance_id=instance_id, + create_access_policy_payload=create_access_policy_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "AccessPolicy", + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def create_access_policy_with_http_info( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + create_access_policy_payload: CreateAccessPolicyPayload, + _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[AccessPolicy]: + """Create Access Policy + + Create a new access policy for Logs instance + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param create_access_policy_payload: (required) + :type create_access_policy_payload: CreateAccessPolicyPayload + :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_access_policy_serialize( + project_id=project_id, + region_id=region_id, + instance_id=instance_id, + create_access_policy_payload=create_access_policy_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "AccessPolicy", + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def create_access_policy_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + create_access_policy_payload: CreateAccessPolicyPayload, + _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 Access Policy + + Create a new access policy for Logs instance + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param create_access_policy_payload: (required) + :type create_access_policy_payload: CreateAccessPolicyPayload + :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_access_policy_serialize( + project_id=project_id, + region_id=region_id, + instance_id=instance_id, + create_access_policy_payload=create_access_policy_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "AccessPolicy", + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_access_policy_serialize( + self, + project_id, + region_id, + instance_id, + create_access_policy_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if region_id is not None: + _path_params["regionId"] = region_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_access_policy_payload is not None: + _body_params = create_access_policy_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-policies", + 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_access_token( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], - create_access_token_payload: CreateAccessTokenPayload, + create_access_token_payload: CreateAccessTokenPayload, + _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, + ) -> AccessToken: + """Create Access Token + + Create a new Logs instance access token + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param create_access_token_payload: (required) + :type create_access_token_payload: CreateAccessTokenPayload + :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_access_token_serialize( + project_id=project_id, + region_id=region_id, + instance_id=instance_id, + create_access_token_payload=create_access_token_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "AccessToken", + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def create_access_token_with_http_info( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + create_access_token_payload: CreateAccessTokenPayload, + _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[AccessToken]: + """Create Access Token + + Create a new Logs instance access token + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param create_access_token_payload: (required) + :type create_access_token_payload: CreateAccessTokenPayload + :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_access_token_serialize( + project_id=project_id, + region_id=region_id, + instance_id=instance_id, + create_access_token_payload=create_access_token_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "AccessToken", + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def create_access_token_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + create_access_token_payload: CreateAccessTokenPayload, + _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 Access Token + + Create a new Logs instance access token + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param create_access_token_payload: (required) + :type create_access_token_payload: CreateAccessTokenPayload + :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_access_token_serialize( + project_id=project_id, + region_id=region_id, + instance_id=instance_id, + create_access_token_payload=create_access_token_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "AccessToken", + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_access_token_serialize( + self, + project_id, + region_id, + instance_id, + create_access_token_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if region_id is not None: + _path_params["regionId"] = region_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_access_token_payload is not None: + _body_params = create_access_token_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens", + 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_logs_instance( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + create_logs_instance_payload: CreateLogsInstancePayload, + _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, + ) -> LogsInstance: + """Create Logs instance + + Creates a new Logs instance within the project. + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param create_logs_instance_payload: (required) + :type create_logs_instance_payload: CreateLogsInstancePayload + :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_logs_instance_serialize( + project_id=project_id, + region_id=region_id, + create_logs_instance_payload=create_logs_instance_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "LogsInstance", + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def create_logs_instance_with_http_info( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + create_logs_instance_payload: CreateLogsInstancePayload, + _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[LogsInstance]: + """Create Logs instance + + Creates a new Logs instance within the project. + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param create_logs_instance_payload: (required) + :type create_logs_instance_payload: CreateLogsInstancePayload + :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_logs_instance_serialize( + project_id=project_id, + region_id=region_id, + create_logs_instance_payload=create_logs_instance_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "LogsInstance", + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def create_logs_instance_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + create_logs_instance_payload: CreateLogsInstancePayload, + _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 Logs instance + + Creates a new Logs instance within the project. + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param create_logs_instance_payload: (required) + :type create_logs_instance_payload: CreateLogsInstancePayload + :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_logs_instance_serialize( + project_id=project_id, + region_id=region_id, + create_logs_instance_payload=create_logs_instance_payload, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "201": "LogsInstance", + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_logs_instance_serialize( + self, + project_id, + region_id, + create_logs_instance_payload, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if region_id is not None: + _path_params["regionId"] = region_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_logs_instance_payload is not None: + _body_params = create_logs_instance_payload + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="POST", + resource_path="/v1/projects/{projectId}/regions/{regionId}/instances", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def delete_access_policy( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + p_id: Annotated[UUID, Field(description="The access policy unique id.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete Access Policy + + Deletes a Logs instance access policy + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param p_id: The access policy unique id. (required) + :type p_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_access_policy_serialize( + project_id=project_id, + region_id=region_id, + instance_id=instance_id, + p_id=p_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_access_policy_with_http_info( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + p_id: Annotated[UUID, Field(description="The access policy unique id.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Access Policy + + Deletes a Logs instance access policy + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param p_id: The access policy unique id. (required) + :type p_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_access_policy_serialize( + project_id=project_id, + region_id=region_id, + instance_id=instance_id, + p_id=p_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_access_policy_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + p_id: Annotated[UUID, Field(description="The access policy unique id.")], + _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 Access Policy + + Deletes a Logs instance access policy + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param p_id: The access policy unique id. (required) + :type p_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_access_policy_serialize( + project_id=project_id, + region_id=region_id, + instance_id=instance_id, + p_id=p_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_access_policy_serialize( + self, + project_id, + region_id, + instance_id, + p_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_id is not None: + _path_params["regionId"] = region_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + if p_id is not None: + _path_params["pId"] = p_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(["text/plain"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-policies/{pId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def delete_access_token( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + t_id: Annotated[UUID, Field(description="The access token UUID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete Access Token + + Deletes a Logs instance access token + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param t_id: The access token UUID. (required) + :type t_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_access_token_serialize( + project_id=project_id, + region_id=region_id, + instance_id=instance_id, + t_id=t_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_access_token_with_http_info( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + t_id: Annotated[UUID, Field(description="The access token UUID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete Access Token + + Deletes a Logs instance access token + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param t_id: The access token UUID. (required) + :type t_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_access_token_serialize( + project_id=project_id, + region_id=region_id, + instance_id=instance_id, + t_id=t_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_access_token_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + t_id: Annotated[UUID, Field(description="The access token UUID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete Access Token + + Deletes a Logs instance access token + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param t_id: The access token UUID. (required) + :type t_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_access_token_serialize( + project_id=project_id, + region_id=region_id, + instance_id=instance_id, + t_id=t_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "204": None, + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_access_token_serialize( + self, + project_id, + region_id, + instance_id, + t_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_id is not None: + _path_params["regionId"] = region_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + if t_id is not None: + _path_params["tId"] = t_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(["text/plain"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens/{tId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def delete_all_access_policies( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AccessPolicyList: + """Delete All Access Policies + + Deletes all access policies for a Logs instance + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_all_access_policies_serialize( + project_id=project_id, + region_id=region_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AccessPolicyList", + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def delete_all_access_policies_with_http_info( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AccessPolicyList]: + """Delete All Access Policies + + Deletes all access policies for a Logs instance + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_all_access_policies_serialize( + project_id=project_id, + region_id=region_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AccessPolicyList", + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def delete_all_access_policies_without_preload_content( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete All Access Policies + + Deletes all access policies for a Logs instance + + :param project_id: The STACKIT portal project UUID the resource is located in. (required) + :type project_id: UUID + :param region_id: The STACKIT region name the resource is located in. (required) + :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_all_access_policies_serialize( + project_id=project_id, + region_id=region_id, + instance_id=instance_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: Dict[str, Optional[str]] = { + "200": "AccessPolicyList", + "400": None, + "401": "str", + "404": None, + "409": None, + "500": None, + } + response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _delete_all_access_policies_serialize( + self, + project_id, + region_id, + instance_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = {} + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params["projectId"] = project_id + if region_id is not None: + _path_params["regionId"] = region_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + if "Accept" not in _header_params: + _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) + + # authentication setting + _auth_settings: List[str] = [] + + return self.api_client.param_serialize( + method="DELETE", + resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-policies", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + def delete_all_access_tokens( + self, + project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], + region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -66,10 +1779,10 @@ def create_access_token( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AccessToken: - """Create Access Token + ) -> AccessTokenList: + """Delete All Access Tokens - Create a new Logs instance access token + Deletes all access tokens available for a Logs instance :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -77,8 +1790,6 @@ def create_access_token( :type region_id: str :param instance_id: The Logs Instance UUID. (required) :type instance_id: UUID - :param create_access_token_payload: (required) - :type create_access_token_payload: CreateAccessTokenPayload :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 @@ -101,11 +1812,10 @@ def create_access_token( :return: Returns the result object. """ # noqa: E501 - _param = self._create_access_token_serialize( + _param = self._delete_all_access_tokens_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, - create_access_token_payload=create_access_token_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -113,7 +1823,7 @@ def create_access_token( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "AccessToken", + "200": "AccessTokenList", "400": None, "401": "str", "404": None, @@ -128,12 +1838,11 @@ def create_access_token( ).data @validate_call - def create_access_token_with_http_info( + def delete_all_access_tokens_with_http_info( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], - create_access_token_payload: CreateAccessTokenPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -143,10 +1852,10 @@ def create_access_token_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[AccessToken]: - """Create Access Token + ) -> ApiResponse[AccessTokenList]: + """Delete All Access Tokens - Create a new Logs instance access token + Deletes all access tokens available for a Logs instance :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -154,8 +1863,6 @@ def create_access_token_with_http_info( :type region_id: str :param instance_id: The Logs Instance UUID. (required) :type instance_id: UUID - :param create_access_token_payload: (required) - :type create_access_token_payload: CreateAccessTokenPayload :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 @@ -178,11 +1885,10 @@ def create_access_token_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_access_token_serialize( + _param = self._delete_all_access_tokens_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, - create_access_token_payload=create_access_token_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -190,7 +1896,7 @@ def create_access_token_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "AccessToken", + "200": "AccessTokenList", "400": None, "401": "str", "404": None, @@ -205,12 +1911,11 @@ def create_access_token_with_http_info( ) @validate_call - def create_access_token_without_preload_content( + def delete_all_access_tokens_without_preload_content( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], - create_access_token_payload: CreateAccessTokenPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -221,9 +1926,9 @@ def create_access_token_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create Access Token + """Delete All Access Tokens - Create a new Logs instance access token + Deletes all access tokens available for a Logs instance :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -231,8 +1936,6 @@ def create_access_token_without_preload_content( :type region_id: str :param instance_id: The Logs Instance UUID. (required) :type instance_id: UUID - :param create_access_token_payload: (required) - :type create_access_token_payload: CreateAccessTokenPayload :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 @@ -255,11 +1958,10 @@ def create_access_token_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_access_token_serialize( + _param = self._delete_all_access_tokens_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, - create_access_token_payload=create_access_token_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -267,7 +1969,7 @@ def create_access_token_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "AccessToken", + "200": "AccessTokenList", "400": None, "401": "str", "404": None, @@ -277,12 +1979,11 @@ def create_access_token_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_access_token_serialize( + def _delete_all_access_tokens_serialize( self, project_id, region_id, instance_id, - create_access_token_payload, _request_auth, _content_type, _headers, @@ -311,26 +2012,16 @@ def _create_access_token_serialize( # process the header parameters # process the form parameters # process the body parameter - if create_access_token_payload is not None: - _body_params = create_access_token_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="POST", + method="DELETE", resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens", path_params=_path_params, query_params=_query_params, @@ -345,11 +2036,11 @@ def _create_access_token_serialize( ) @validate_call - def create_logs_instance( + def delete_all_expired_access_tokens( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], - create_logs_instance_payload: CreateLogsInstancePayload, + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -359,17 +2050,17 @@ def create_logs_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> LogsInstance: - """Create Logs instance + ) -> AccessTokenList: + """Deletes all expired access tokens - Creates a new Logs instance within the project. + Deletes all expired access tokens :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID :param region_id: The STACKIT region name the resource is located in. (required) :type region_id: str - :param create_logs_instance_payload: (required) - :type create_logs_instance_payload: CreateLogsInstancePayload + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID :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 @@ -392,10 +2083,10 @@ def create_logs_instance( :return: Returns the result object. """ # noqa: E501 - _param = self._create_logs_instance_serialize( + _param = self._delete_all_expired_access_tokens_serialize( project_id=project_id, region_id=region_id, - create_logs_instance_payload=create_logs_instance_payload, + instance_id=instance_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -403,7 +2094,7 @@ def create_logs_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "LogsInstance", + "200": "AccessTokenList", "400": None, "401": "str", "404": None, @@ -418,11 +2109,11 @@ def create_logs_instance( ).data @validate_call - def create_logs_instance_with_http_info( + def delete_all_expired_access_tokens_with_http_info( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], - create_logs_instance_payload: CreateLogsInstancePayload, + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -432,17 +2123,17 @@ def create_logs_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[LogsInstance]: - """Create Logs instance + ) -> ApiResponse[AccessTokenList]: + """Deletes all expired access tokens - Creates a new Logs instance within the project. + Deletes all expired access tokens :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID :param region_id: The STACKIT region name the resource is located in. (required) :type region_id: str - :param create_logs_instance_payload: (required) - :type create_logs_instance_payload: CreateLogsInstancePayload + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID :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 @@ -465,10 +2156,10 @@ def create_logs_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_logs_instance_serialize( + _param = self._delete_all_expired_access_tokens_serialize( project_id=project_id, region_id=region_id, - create_logs_instance_payload=create_logs_instance_payload, + instance_id=instance_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -476,7 +2167,7 @@ def create_logs_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "LogsInstance", + "200": "AccessTokenList", "400": None, "401": "str", "404": None, @@ -491,11 +2182,11 @@ def create_logs_instance_with_http_info( ) @validate_call - def create_logs_instance_without_preload_content( + def delete_all_expired_access_tokens_without_preload_content( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], - create_logs_instance_payload: CreateLogsInstancePayload, + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -506,16 +2197,16 @@ def create_logs_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create Logs instance + """Deletes all expired access tokens - Creates a new Logs instance within the project. + Deletes all expired access tokens :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID :param region_id: The STACKIT region name the resource is located in. (required) :type region_id: str - :param create_logs_instance_payload: (required) - :type create_logs_instance_payload: CreateLogsInstancePayload + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID :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 @@ -538,10 +2229,10 @@ def create_logs_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_logs_instance_serialize( + _param = self._delete_all_expired_access_tokens_serialize( project_id=project_id, region_id=region_id, - create_logs_instance_payload=create_logs_instance_payload, + instance_id=instance_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -549,7 +2240,7 @@ def create_logs_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "201": "LogsInstance", + "200": "AccessTokenList", "400": None, "401": "str", "404": None, @@ -559,11 +2250,11 @@ def create_logs_instance_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _create_logs_instance_serialize( + def _delete_all_expired_access_tokens_serialize( self, project_id, region_id, - create_logs_instance_payload, + instance_id, _request_auth, _content_type, _headers, @@ -586,31 +2277,23 @@ def _create_logs_instance_serialize( _path_params["projectId"] = project_id if region_id is not None: _path_params["regionId"] = region_id + if instance_id is not None: + _path_params["instanceId"] = instance_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if create_logs_instance_payload is not None: - _body_params = create_logs_instance_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) - # set the HTTP header `Content-Type` - if _content_type: - _header_params["Content-Type"] = _content_type - else: - _default_content_type = self.api_client.select_header_content_type(["application/json"]) - if _default_content_type is not None: - _header_params["Content-Type"] = _default_content_type - # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="POST", - resource_path="/v1/projects/{projectId}/regions/{regionId}/instances", + method="DELETE", + resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens/expired", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -624,12 +2307,11 @@ def _create_logs_instance_serialize( ) @validate_call - def delete_access_token( + def delete_logs_instance( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], - t_id: Annotated[UUID, Field(description="The access token UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -640,9 +2322,9 @@ def delete_access_token( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Delete Access Token + """Delete Logs instance - Deletes a Logs instance access token + Deletes the given Logs instance. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -650,8 +2332,6 @@ def delete_access_token( :type region_id: str :param instance_id: The Logs Instance UUID. (required) :type instance_id: UUID - :param t_id: The access token UUID. (required) - :type t_id: UUID :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 @@ -674,11 +2354,10 @@ def delete_access_token( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_access_token_serialize( + _param = self._delete_logs_instance_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, - t_id=t_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -701,12 +2380,11 @@ def delete_access_token( ).data @validate_call - def delete_access_token_with_http_info( + def delete_logs_instance_with_http_info( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], - t_id: Annotated[UUID, Field(description="The access token UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -717,9 +2395,9 @@ def delete_access_token_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Delete Access Token + """Delete Logs instance - Deletes a Logs instance access token + Deletes the given Logs instance. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -727,8 +2405,6 @@ def delete_access_token_with_http_info( :type region_id: str :param instance_id: The Logs Instance UUID. (required) :type instance_id: UUID - :param t_id: The access token UUID. (required) - :type t_id: UUID :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 @@ -751,11 +2427,10 @@ def delete_access_token_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_access_token_serialize( + _param = self._delete_logs_instance_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, - t_id=t_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -778,12 +2453,11 @@ def delete_access_token_with_http_info( ) @validate_call - def delete_access_token_without_preload_content( + def delete_logs_instance_without_preload_content( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], - t_id: Annotated[UUID, Field(description="The access token UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -794,9 +2468,9 @@ def delete_access_token_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete Access Token + """Delete Logs instance - Deletes a Logs instance access token + Deletes the given Logs instance. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -804,8 +2478,6 @@ def delete_access_token_without_preload_content( :type region_id: str :param instance_id: The Logs Instance UUID. (required) :type instance_id: UUID - :param t_id: The access token UUID. (required) - :type t_id: UUID :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 @@ -828,11 +2500,10 @@ def delete_access_token_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_access_token_serialize( + _param = self._delete_logs_instance_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, - t_id=t_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -850,12 +2521,11 @@ def delete_access_token_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_access_token_serialize( + def _delete_logs_instance_serialize( self, project_id, region_id, instance_id, - t_id, _request_auth, _content_type, _headers, @@ -880,8 +2550,6 @@ def _delete_access_token_serialize( _path_params["regionId"] = region_id if instance_id is not None: _path_params["instanceId"] = instance_id - if t_id is not None: - _path_params["tId"] = t_id # process the query parameters # process the header parameters # process the form parameters @@ -896,7 +2564,7 @@ def _delete_access_token_serialize( return self.api_client.param_serialize( method="DELETE", - resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens/{tId}", + resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -910,11 +2578,12 @@ def _delete_access_token_serialize( ) @validate_call - def delete_all_access_tokens( + def get_access_policy( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + p_id: Annotated[UUID, Field(description="The access policy unique id.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -924,10 +2593,10 @@ def delete_all_access_tokens( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AccessTokenList: - """Delete All Access Tokens + ) -> AccessPolicy: + """Get Access Policy - Deletes all access tokens available for a Logs instance + Get the information of the given access policy. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -935,6 +2604,8 @@ def delete_all_access_tokens( :type region_id: str :param instance_id: The Logs Instance UUID. (required) :type instance_id: UUID + :param p_id: The access policy unique id. (required) + :type p_id: UUID :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 @@ -957,10 +2628,11 @@ def delete_all_access_tokens( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_all_access_tokens_serialize( + _param = self._get_access_policy_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, + p_id=p_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -968,7 +2640,7 @@ def delete_all_access_tokens( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AccessTokenList", + "200": "AccessPolicy", "400": None, "401": "str", "404": None, @@ -983,11 +2655,12 @@ def delete_all_access_tokens( ).data @validate_call - def delete_all_access_tokens_with_http_info( + def get_access_policy_with_http_info( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + p_id: Annotated[UUID, Field(description="The access policy unique id.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -997,10 +2670,10 @@ def delete_all_access_tokens_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[AccessTokenList]: - """Delete All Access Tokens + ) -> ApiResponse[AccessPolicy]: + """Get Access Policy - Deletes all access tokens available for a Logs instance + Get the information of the given access policy. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -1008,6 +2681,8 @@ def delete_all_access_tokens_with_http_info( :type region_id: str :param instance_id: The Logs Instance UUID. (required) :type instance_id: UUID + :param p_id: The access policy unique id. (required) + :type p_id: UUID :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 @@ -1030,10 +2705,11 @@ def delete_all_access_tokens_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_all_access_tokens_serialize( + _param = self._get_access_policy_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, + p_id=p_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1041,7 +2717,7 @@ def delete_all_access_tokens_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AccessTokenList", + "200": "AccessPolicy", "400": None, "401": "str", "404": None, @@ -1056,11 +2732,12 @@ def delete_all_access_tokens_with_http_info( ) @validate_call - def delete_all_access_tokens_without_preload_content( + def get_access_policy_without_preload_content( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + p_id: Annotated[UUID, Field(description="The access policy unique id.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1071,9 +2748,9 @@ def delete_all_access_tokens_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete All Access Tokens + """Get Access Policy - Deletes all access tokens available for a Logs instance + Get the information of the given access policy. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -1081,6 +2758,8 @@ def delete_all_access_tokens_without_preload_content( :type region_id: str :param instance_id: The Logs Instance UUID. (required) :type instance_id: UUID + :param p_id: The access policy unique id. (required) + :type p_id: UUID :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 @@ -1103,10 +2782,11 @@ def delete_all_access_tokens_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_all_access_tokens_serialize( + _param = self._get_access_policy_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, + p_id=p_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1114,7 +2794,7 @@ def delete_all_access_tokens_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AccessTokenList", + "200": "AccessPolicy", "400": None, "401": "str", "404": None, @@ -1124,11 +2804,12 @@ def delete_all_access_tokens_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_all_access_tokens_serialize( + def _get_access_policy_serialize( self, project_id, region_id, instance_id, + p_id, _request_auth, _content_type, _headers, @@ -1153,6 +2834,8 @@ def _delete_all_access_tokens_serialize( _path_params["regionId"] = region_id if instance_id is not None: _path_params["instanceId"] = instance_id + if p_id is not None: + _path_params["pId"] = p_id # process the query parameters # process the header parameters # process the form parameters @@ -1166,8 +2849,8 @@ def _delete_all_access_tokens_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens", + method="GET", + resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-policies/{pId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1181,11 +2864,12 @@ def _delete_all_access_tokens_serialize( ) @validate_call - def delete_all_expired_access_tokens( + def get_access_token( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + t_id: Annotated[UUID, Field(description="The access token UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1195,10 +2879,10 @@ def delete_all_expired_access_tokens( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AccessTokenList: - """Deletes all expired access tokens + ) -> AccessToken: + """Get Access Token - Deletes all expired access tokens + Get the information of the given access token. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -1206,6 +2890,8 @@ def delete_all_expired_access_tokens( :type region_id: str :param instance_id: The Logs Instance UUID. (required) :type instance_id: UUID + :param t_id: The access token UUID. (required) + :type t_id: UUID :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 @@ -1228,10 +2914,11 @@ def delete_all_expired_access_tokens( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_all_expired_access_tokens_serialize( + _param = self._get_access_token_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, + t_id=t_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1239,7 +2926,7 @@ def delete_all_expired_access_tokens( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AccessTokenList", + "200": "AccessToken", "400": None, "401": "str", "404": None, @@ -1254,11 +2941,12 @@ def delete_all_expired_access_tokens( ).data @validate_call - def delete_all_expired_access_tokens_with_http_info( + def get_access_token_with_http_info( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + t_id: Annotated[UUID, Field(description="The access token UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1268,10 +2956,10 @@ def delete_all_expired_access_tokens_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[AccessTokenList]: - """Deletes all expired access tokens + ) -> ApiResponse[AccessToken]: + """Get Access Token - Deletes all expired access tokens + Get the information of the given access token. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -1279,6 +2967,8 @@ def delete_all_expired_access_tokens_with_http_info( :type region_id: str :param instance_id: The Logs Instance UUID. (required) :type instance_id: UUID + :param t_id: The access token UUID. (required) + :type t_id: UUID :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 @@ -1301,10 +2991,11 @@ def delete_all_expired_access_tokens_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_all_expired_access_tokens_serialize( + _param = self._get_access_token_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, + t_id=t_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1312,7 +3003,7 @@ def delete_all_expired_access_tokens_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AccessTokenList", + "200": "AccessToken", "400": None, "401": "str", "404": None, @@ -1327,11 +3018,12 @@ def delete_all_expired_access_tokens_with_http_info( ) @validate_call - def delete_all_expired_access_tokens_without_preload_content( + def get_access_token_without_preload_content( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + t_id: Annotated[UUID, Field(description="The access token UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1342,9 +3034,9 @@ def delete_all_expired_access_tokens_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Deletes all expired access tokens + """Get Access Token - Deletes all expired access tokens + Get the information of the given access token. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -1352,6 +3044,8 @@ def delete_all_expired_access_tokens_without_preload_content( :type region_id: str :param instance_id: The Logs Instance UUID. (required) :type instance_id: UUID + :param t_id: The access token UUID. (required) + :type t_id: UUID :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 @@ -1374,10 +3068,11 @@ def delete_all_expired_access_tokens_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_all_expired_access_tokens_serialize( + _param = self._get_access_token_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, + t_id=t_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1385,7 +3080,7 @@ def delete_all_expired_access_tokens_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AccessTokenList", + "200": "AccessToken", "400": None, "401": "str", "404": None, @@ -1395,11 +3090,12 @@ def delete_all_expired_access_tokens_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_all_expired_access_tokens_serialize( + def _get_access_token_serialize( self, project_id, region_id, instance_id, + t_id, _request_auth, _content_type, _headers, @@ -1424,6 +3120,8 @@ def _delete_all_expired_access_tokens_serialize( _path_params["regionId"] = region_id if instance_id is not None: _path_params["instanceId"] = instance_id + if t_id is not None: + _path_params["tId"] = t_id # process the query parameters # process the header parameters # process the form parameters @@ -1437,8 +3135,8 @@ def _delete_all_expired_access_tokens_serialize( _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", - resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens/expired", + method="GET", + resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens/{tId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1452,7 +3150,7 @@ def _delete_all_expired_access_tokens_serialize( ) @validate_call - def delete_logs_instance( + def get_logs_instance( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], @@ -1466,10 +3164,10 @@ def delete_logs_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete Logs instance + ) -> LogsInstance: + """Get Logs Instance - Deletes the given Logs instance. + Returns the details for the given Logs instance. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -1499,7 +3197,7 @@ def delete_logs_instance( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_logs_instance_serialize( + _param = self._get_logs_instance_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, @@ -1510,11 +3208,10 @@ def delete_logs_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "LogsInstance", "400": None, "401": "str", "404": None, - "409": None, "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1525,7 +3222,7 @@ def delete_logs_instance( ).data @validate_call - def delete_logs_instance_with_http_info( + def get_logs_instance_with_http_info( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], @@ -1539,10 +3236,10 @@ def delete_logs_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete Logs instance + ) -> ApiResponse[LogsInstance]: + """Get Logs Instance - Deletes the given Logs instance. + Returns the details for the given Logs instance. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -1572,7 +3269,7 @@ def delete_logs_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_logs_instance_serialize( + _param = self._get_logs_instance_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, @@ -1583,11 +3280,10 @@ def delete_logs_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "LogsInstance", "400": None, "401": "str", "404": None, - "409": None, "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -1598,7 +3294,7 @@ def delete_logs_instance_with_http_info( ) @validate_call - def delete_logs_instance_without_preload_content( + def get_logs_instance_without_preload_content( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], @@ -1613,9 +3309,9 @@ def delete_logs_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete Logs instance + """Get Logs Instance - Deletes the given Logs instance. + Returns the details for the given Logs instance. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -1645,7 +3341,7 @@ def delete_logs_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_logs_instance_serialize( + _param = self._get_logs_instance_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, @@ -1656,17 +3352,16 @@ def delete_logs_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "204": None, + "200": "LogsInstance", "400": None, "401": "str", "404": None, - "409": None, "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _delete_logs_instance_serialize( + def _get_logs_instance_serialize( self, project_id, region_id, @@ -1702,13 +3397,13 @@ def _delete_logs_instance_serialize( # set the HTTP header `Accept` if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["text/plain"]) + _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="DELETE", + method="GET", resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}", path_params=_path_params, query_params=_query_params, @@ -1723,12 +3418,11 @@ def _delete_logs_instance_serialize( ) @validate_call - def get_access_token( + def list_access_policies( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], - t_id: Annotated[UUID, Field(description="The access token UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1738,10 +3432,10 @@ def get_access_token( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AccessToken: - """Get Access Token + ) -> AccessPolicyList: + """List Access Policies - Get the information of the given access token. + Returns a list of access policies created for a Logs instance :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -1749,8 +3443,6 @@ def get_access_token( :type region_id: str :param instance_id: The Logs Instance UUID. (required) :type instance_id: UUID - :param t_id: The access token UUID. (required) - :type t_id: UUID :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 @@ -1773,11 +3465,10 @@ def get_access_token( :return: Returns the result object. """ # noqa: E501 - _param = self._get_access_token_serialize( + _param = self._list_access_policies_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, - t_id=t_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1785,7 +3476,7 @@ def get_access_token( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AccessToken", + "200": "AccessPolicyList", "400": None, "401": "str", "404": None, @@ -1800,12 +3491,11 @@ def get_access_token( ).data @validate_call - def get_access_token_with_http_info( + def list_access_policies_with_http_info( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], - t_id: Annotated[UUID, Field(description="The access token UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1815,10 +3505,10 @@ def get_access_token_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[AccessToken]: - """Get Access Token + ) -> ApiResponse[AccessPolicyList]: + """List Access Policies - Get the information of the given access token. + Returns a list of access policies created for a Logs instance :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -1826,8 +3516,6 @@ def get_access_token_with_http_info( :type region_id: str :param instance_id: The Logs Instance UUID. (required) :type instance_id: UUID - :param t_id: The access token UUID. (required) - :type t_id: UUID :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 @@ -1850,11 +3538,10 @@ def get_access_token_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_access_token_serialize( + _param = self._list_access_policies_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, - t_id=t_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1862,7 +3549,7 @@ def get_access_token_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AccessToken", + "200": "AccessPolicyList", "400": None, "401": "str", "404": None, @@ -1877,12 +3564,11 @@ def get_access_token_with_http_info( ) @validate_call - def get_access_token_without_preload_content( + def list_access_policies_without_preload_content( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], - t_id: Annotated[UUID, Field(description="The access token UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1893,9 +3579,9 @@ def get_access_token_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Access Token + """List Access Policies - Get the information of the given access token. + Returns a list of access policies created for a Logs instance :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -1903,8 +3589,6 @@ def get_access_token_without_preload_content( :type region_id: str :param instance_id: The Logs Instance UUID. (required) :type instance_id: UUID - :param t_id: The access token UUID. (required) - :type t_id: UUID :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 @@ -1927,11 +3611,10 @@ def get_access_token_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_access_token_serialize( + _param = self._list_access_policies_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, - t_id=t_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1939,7 +3622,7 @@ def get_access_token_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AccessToken", + "200": "AccessPolicyList", "400": None, "401": "str", "404": None, @@ -1949,12 +3632,11 @@ def get_access_token_without_preload_content( response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_access_token_serialize( + def _list_access_policies_serialize( self, project_id, region_id, instance_id, - t_id, _request_auth, _content_type, _headers, @@ -1979,8 +3661,6 @@ def _get_access_token_serialize( _path_params["regionId"] = region_id if instance_id is not None: _path_params["instanceId"] = instance_id - if t_id is not None: - _path_params["tId"] = t_id # process the query parameters # process the header parameters # process the form parameters @@ -1995,7 +3675,7 @@ def _get_access_token_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens/{tId}", + resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-policies", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2009,7 +3689,7 @@ def _get_access_token_serialize( ) @validate_call - def get_logs_instance( + def list_access_tokens( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], @@ -2023,10 +3703,10 @@ def get_logs_instance( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> LogsInstance: - """Get Logs Instance + ) -> AccessTokenList: + """List Access Tokens - Returns the details for the given Logs instance. + Returns a list of access tokens created for a Logs instance :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -2056,7 +3736,7 @@ def get_logs_instance( :return: Returns the result object. """ # noqa: E501 - _param = self._get_logs_instance_serialize( + _param = self._list_access_tokens_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, @@ -2067,10 +3747,11 @@ def get_logs_instance( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogsInstance", + "200": "AccessTokenList", "400": None, "401": "str", "404": None, + "409": None, "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2081,7 +3762,7 @@ def get_logs_instance( ).data @validate_call - def get_logs_instance_with_http_info( + def list_access_tokens_with_http_info( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], @@ -2095,10 +3776,10 @@ def get_logs_instance_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[LogsInstance]: - """Get Logs Instance + ) -> ApiResponse[AccessTokenList]: + """List Access Tokens - Returns the details for the given Logs instance. + Returns a list of access tokens created for a Logs instance :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -2128,7 +3809,7 @@ def get_logs_instance_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_logs_instance_serialize( + _param = self._list_access_tokens_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, @@ -2139,10 +3820,11 @@ def get_logs_instance_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogsInstance", + "200": "AccessTokenList", "400": None, "401": "str", "404": None, + "409": None, "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2153,7 +3835,7 @@ def get_logs_instance_with_http_info( ) @validate_call - def get_logs_instance_without_preload_content( + def list_access_tokens_without_preload_content( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], @@ -2168,9 +3850,9 @@ def get_logs_instance_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get Logs Instance + """List Access Tokens - Returns the details for the given Logs instance. + Returns a list of access tokens created for a Logs instance :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID @@ -2200,7 +3882,7 @@ def get_logs_instance_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_logs_instance_serialize( + _param = self._list_access_tokens_serialize( project_id=project_id, region_id=region_id, instance_id=instance_id, @@ -2211,16 +3893,17 @@ def get_logs_instance_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogsInstance", + "200": "AccessTokenList", "400": None, "401": "str", "404": None, + "409": None, "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _get_logs_instance_serialize( + def _list_access_tokens_serialize( self, project_id, region_id, @@ -2263,7 +3946,7 @@ def _get_logs_instance_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}", + resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2277,11 +3960,10 @@ def _get_logs_instance_serialize( ) @validate_call - def list_access_tokens( + def list_logs_instances( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], - instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2291,17 +3973,15 @@ def list_access_tokens( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AccessTokenList: - """List Access Tokens + ) -> LogsInstancesList: + """List Logs instances - Returns a list of access tokens created for a Logs instance + Returns a list of all Logs instances within the project. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID :param region_id: The STACKIT region name the resource is located in. (required) :type region_id: str - :param instance_id: The Logs Instance UUID. (required) - :type instance_id: UUID :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 @@ -2324,10 +4004,9 @@ def list_access_tokens( :return: Returns the result object. """ # noqa: E501 - _param = self._list_access_tokens_serialize( + _param = self._list_logs_instances_serialize( project_id=project_id, region_id=region_id, - instance_id=instance_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2335,11 +4014,9 @@ def list_access_tokens( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AccessTokenList", + "200": "LogsInstancesList", "400": None, "401": "str", - "404": None, - "409": None, "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2350,11 +4027,10 @@ def list_access_tokens( ).data @validate_call - def list_access_tokens_with_http_info( + def list_logs_instances_with_http_info( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], - instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2364,17 +4040,15 @@ def list_access_tokens_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[AccessTokenList]: - """List Access Tokens + ) -> ApiResponse[LogsInstancesList]: + """List Logs instances - Returns a list of access tokens created for a Logs instance + Returns a list of all Logs instances within the project. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID :param region_id: The STACKIT region name the resource is located in. (required) :type region_id: str - :param instance_id: The Logs Instance UUID. (required) - :type instance_id: UUID :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 @@ -2397,10 +4071,9 @@ def list_access_tokens_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_access_tokens_serialize( + _param = self._list_logs_instances_serialize( project_id=project_id, region_id=region_id, - instance_id=instance_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2408,11 +4081,9 @@ def list_access_tokens_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AccessTokenList", + "200": "LogsInstancesList", "400": None, "401": "str", - "404": None, - "409": None, "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2423,11 +4094,10 @@ def list_access_tokens_with_http_info( ) @validate_call - def list_access_tokens_without_preload_content( + def list_logs_instances_without_preload_content( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], - instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2438,16 +4108,14 @@ def list_access_tokens_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Access Tokens + """List Logs instances - Returns a list of access tokens created for a Logs instance + Returns a list of all Logs instances within the project. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID :param region_id: The STACKIT region name the resource is located in. (required) :type region_id: str - :param instance_id: The Logs Instance UUID. (required) - :type instance_id: UUID :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 @@ -2470,10 +4138,9 @@ def list_access_tokens_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_access_tokens_serialize( + _param = self._list_logs_instances_serialize( project_id=project_id, region_id=region_id, - instance_id=instance_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2481,21 +4148,18 @@ def list_access_tokens_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "AccessTokenList", + "200": "LogsInstancesList", "400": None, "401": "str", - "404": None, - "409": None, "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_access_tokens_serialize( + def _list_logs_instances_serialize( self, project_id, region_id, - instance_id, _request_auth, _content_type, _headers, @@ -2518,8 +4182,6 @@ def _list_access_tokens_serialize( _path_params["projectId"] = project_id if region_id is not None: _path_params["regionId"] = region_id - if instance_id is not None: - _path_params["instanceId"] = instance_id # process the query parameters # process the header parameters # process the form parameters @@ -2534,7 +4196,7 @@ def _list_access_tokens_serialize( return self.api_client.param_serialize( method="GET", - resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens", + resource_path="/v1/projects/{projectId}/regions/{regionId}/instances", path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2548,10 +4210,13 @@ def _list_access_tokens_serialize( ) @validate_call - def list_logs_instances( + def update_access_policy( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + p_id: Annotated[UUID, Field(description="The access policy unique id.")], + update_access_policy_payload: UpdateAccessPolicyPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2561,15 +4226,21 @@ def list_logs_instances( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> LogsInstancesList: - """List Logs instances + ) -> AccessPolicy: + """Update Access Policy - Returns a list of all Logs instances within the project. + Updates the given access policy. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID :param region_id: The STACKIT region name the resource is located in. (required) :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param p_id: The access policy unique id. (required) + :type p_id: UUID + :param update_access_policy_payload: (required) + :type update_access_policy_payload: UpdateAccessPolicyPayload :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 @@ -2592,9 +4263,12 @@ def list_logs_instances( :return: Returns the result object. """ # noqa: E501 - _param = self._list_logs_instances_serialize( + _param = self._update_access_policy_serialize( project_id=project_id, region_id=region_id, + instance_id=instance_id, + p_id=p_id, + update_access_policy_payload=update_access_policy_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2602,9 +4276,11 @@ def list_logs_instances( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogsInstancesList", + "200": "AccessPolicy", "400": None, "401": "str", + "404": None, + "409": None, "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2615,10 +4291,13 @@ def list_logs_instances( ).data @validate_call - def list_logs_instances_with_http_info( + def update_access_policy_with_http_info( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + p_id: Annotated[UUID, Field(description="The access policy unique id.")], + update_access_policy_payload: UpdateAccessPolicyPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2628,15 +4307,21 @@ def list_logs_instances_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[LogsInstancesList]: - """List Logs instances + ) -> ApiResponse[AccessPolicy]: + """Update Access Policy - Returns a list of all Logs instances within the project. + Updates the given access policy. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID :param region_id: The STACKIT region name the resource is located in. (required) :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param p_id: The access policy unique id. (required) + :type p_id: UUID + :param update_access_policy_payload: (required) + :type update_access_policy_payload: UpdateAccessPolicyPayload :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 @@ -2659,9 +4344,12 @@ def list_logs_instances_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_logs_instances_serialize( + _param = self._update_access_policy_serialize( project_id=project_id, region_id=region_id, + instance_id=instance_id, + p_id=p_id, + update_access_policy_payload=update_access_policy_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2669,9 +4357,11 @@ def list_logs_instances_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogsInstancesList", + "200": "AccessPolicy", "400": None, "401": "str", + "404": None, + "409": None, "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) @@ -2682,10 +4372,13 @@ def list_logs_instances_with_http_info( ) @validate_call - def list_logs_instances_without_preload_content( + def update_access_policy_without_preload_content( self, project_id: Annotated[UUID, Field(description="The STACKIT portal project UUID the resource is located in.")], region_id: Annotated[StrictStr, Field(description="The STACKIT region name the resource is located in.")], + instance_id: Annotated[UUID, Field(description="The Logs Instance UUID.")], + p_id: Annotated[UUID, Field(description="The access policy unique id.")], + update_access_policy_payload: UpdateAccessPolicyPayload, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2696,14 +4389,20 @@ def list_logs_instances_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List Logs instances + """Update Access Policy - Returns a list of all Logs instances within the project. + Updates the given access policy. :param project_id: The STACKIT portal project UUID the resource is located in. (required) :type project_id: UUID :param region_id: The STACKIT region name the resource is located in. (required) :type region_id: str + :param instance_id: The Logs Instance UUID. (required) + :type instance_id: UUID + :param p_id: The access policy unique id. (required) + :type p_id: UUID + :param update_access_policy_payload: (required) + :type update_access_policy_payload: UpdateAccessPolicyPayload :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 @@ -2726,9 +4425,12 @@ def list_logs_instances_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_logs_instances_serialize( + _param = self._update_access_policy_serialize( project_id=project_id, region_id=region_id, + instance_id=instance_id, + p_id=p_id, + update_access_policy_payload=update_access_policy_payload, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2736,18 +4438,23 @@ def list_logs_instances_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - "200": "LogsInstancesList", + "200": "AccessPolicy", "400": None, "401": "str", + "404": None, + "409": None, "500": None, } response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) return response_data.response - def _list_logs_instances_serialize( + def _update_access_policy_serialize( self, project_id, region_id, + instance_id, + p_id, + update_access_policy_payload, _request_auth, _content_type, _headers, @@ -2770,21 +4477,35 @@ def _list_logs_instances_serialize( _path_params["projectId"] = project_id if region_id is not None: _path_params["regionId"] = region_id + if instance_id is not None: + _path_params["instanceId"] = instance_id + if p_id is not None: + _path_params["pId"] = p_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if update_access_policy_payload is not None: + _body_params = update_access_policy_payload # set the HTTP header `Accept` if "Accept" not in _header_params: _header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/plain"]) + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + # authentication setting _auth_settings: List[str] = [] return self.api_client.param_serialize( - method="GET", - resource_path="/v1/projects/{projectId}/regions/{regionId}/instances", + method="PATCH", + resource_path="/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-policies/{pId}", path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/services/logs/src/stackit/logs/api_client.py b/services/logs/src/stackit/logs/api_client.py index 5881fb803..037b726e1 100644 --- a/services/logs/src/stackit/logs/api_client.py +++ b/services/logs/src/stackit/logs/api_client.py @@ -5,7 +5,7 @@ This API provides endpoints for managing STACKIT Logs. -The version of the OpenAPI document: 1.0.0 +The version of the OpenAPI document: 1.1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/logs/src/stackit/logs/configuration.py b/services/logs/src/stackit/logs/configuration.py index a80b09e43..ff4316867 100644 --- a/services/logs/src/stackit/logs/configuration.py +++ b/services/logs/src/stackit/logs/configuration.py @@ -5,7 +5,7 @@ This API provides endpoints for managing STACKIT Logs. -The version of the OpenAPI document: 1.0.0 +The version of the OpenAPI document: 1.1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/logs/src/stackit/logs/exceptions.py b/services/logs/src/stackit/logs/exceptions.py index 897058c69..517a05743 100644 --- a/services/logs/src/stackit/logs/exceptions.py +++ b/services/logs/src/stackit/logs/exceptions.py @@ -5,7 +5,7 @@ This API provides endpoints for managing STACKIT Logs. -The version of the OpenAPI document: 1.0.0 +The version of the OpenAPI document: 1.1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/logs/src/stackit/logs/models/__init__.py b/services/logs/src/stackit/logs/models/__init__.py index 44f22b3c3..f7a09cc48 100644 --- a/services/logs/src/stackit/logs/models/__init__.py +++ b/services/logs/src/stackit/logs/models/__init__.py @@ -6,18 +6,22 @@ This API provides endpoints for managing STACKIT Logs. -The version of the OpenAPI document: 1.0.0 +The version of the OpenAPI document: 1.1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 # import models into model package +from stackit.logs.models.access_policy import AccessPolicy +from stackit.logs.models.access_policy_list import AccessPolicyList from stackit.logs.models.access_token import AccessToken from stackit.logs.models.access_token_list import AccessTokenList +from stackit.logs.models.create_access_policy_payload import CreateAccessPolicyPayload from stackit.logs.models.create_access_token_payload import CreateAccessTokenPayload from stackit.logs.models.create_logs_instance_payload import CreateLogsInstancePayload from stackit.logs.models.logs_instance import LogsInstance from stackit.logs.models.logs_instances_list import LogsInstancesList +from stackit.logs.models.update_access_policy_payload import UpdateAccessPolicyPayload from stackit.logs.models.update_access_token_payload import UpdateAccessTokenPayload from stackit.logs.models.update_logs_instance_payload import UpdateLogsInstancePayload diff --git a/services/logs/src/stackit/logs/models/access_policy.py b/services/logs/src/stackit/logs/models/access_policy.py new file mode 100644 index 000000000..d705a1070 --- /dev/null +++ b/services/logs/src/stackit/logs/models/access_policy.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" +STACKIT Logs API + +This API provides endpoints for managing STACKIT Logs. + +The version of the OpenAPI document: 1.1.0 +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 uuid import UUID + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + + +class AccessPolicy(BaseModel): + """ + AccessPolicy + """ # noqa: E501 + + description: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field( + default=None, description="The description of the access policy." + ) + email: Annotated[str, Field(min_length=3, strict=True, max_length=254)] = Field( + description="The email address of the STACKIT IAM subject (user, group, or service account)." + ) + id: UUID = Field(description="An auto generated unique id which identifies the access policy.") + permissions: List[StrictStr] = Field( + description="The access permissions granted to the access token or access policy." + ) + __properties: ClassVar[List[str]] = ["description", "email", "id", "permissions"] + + @field_validator("permissions") + def permissions_validate_enum(cls, value): + """Validates the enum""" + for i in value: + if i not in set(["read", "write"]): + raise ValueError("each list item must be one of ('read', 'write')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccessPolicy 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 AccessPolicy from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "description": obj.get("description"), + "email": obj.get("email"), + "id": obj.get("id"), + "permissions": obj.get("permissions"), + } + ) + return _obj diff --git a/services/logs/src/stackit/logs/models/access_policy_list.py b/services/logs/src/stackit/logs/models/access_policy_list.py new file mode 100644 index 000000000..4fcfc3d7c --- /dev/null +++ b/services/logs/src/stackit/logs/models/access_policy_list.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" +STACKIT Logs API + +This API provides endpoints for managing STACKIT Logs. + +The version of the OpenAPI document: 1.1.0 +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 pydantic_core import to_jsonable_python +from typing_extensions import Self + +from stackit.logs.models.access_policy import AccessPolicy + + +class AccessPolicyList(BaseModel): + """ + AccessPolicyList + """ # noqa: E501 + + policies: List[AccessPolicy] + __properties: ClassVar[List[str]] = ["policies"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AccessPolicyList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in policies (list) + _items = [] + if self.policies: + for _item_policies in self.policies: + if _item_policies: + _items.append(_item_policies.to_dict()) + _dict["policies"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AccessPolicyList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + { + "policies": ( + [AccessPolicy.from_dict(_item) for _item in obj["policies"]] + if obj.get("policies") is not None + else None + ) + } + ) + return _obj diff --git a/services/logs/src/stackit/logs/models/access_token.py b/services/logs/src/stackit/logs/models/access_token.py index 602cdf03a..d1893c9e2 100644 --- a/services/logs/src/stackit/logs/models/access_token.py +++ b/services/logs/src/stackit/logs/models/access_token.py @@ -5,7 +5,7 @@ This API provides endpoints for managing STACKIT Logs. -The version of the OpenAPI document: 1.0.0 +The version of the OpenAPI document: 1.1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -49,7 +49,9 @@ class AccessToken(BaseModel): ) expires: StrictBool = Field(description="Indicates if the access token can expire.") id: UUID = Field(description="An auto generated unique id which identifies the access token.") - permissions: List[StrictStr] = Field(description="The access permissions granted to the access token.") + permissions: List[StrictStr] = Field( + description="The access permissions granted to the access token or access policy." + ) status: StrictStr valid_until: Optional[datetime] = Field( default=None, diff --git a/services/logs/src/stackit/logs/models/access_token_list.py b/services/logs/src/stackit/logs/models/access_token_list.py index 7bc673fa7..7e2bd036d 100644 --- a/services/logs/src/stackit/logs/models/access_token_list.py +++ b/services/logs/src/stackit/logs/models/access_token_list.py @@ -5,7 +5,7 @@ This API provides endpoints for managing STACKIT Logs. -The version of the OpenAPI document: 1.0.0 +The version of the OpenAPI document: 1.1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/logs/src/stackit/logs/models/create_access_policy_payload.py b/services/logs/src/stackit/logs/models/create_access_policy_payload.py new file mode 100644 index 000000000..b895e0ef7 --- /dev/null +++ b/services/logs/src/stackit/logs/models/create_access_policy_payload.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" +STACKIT Logs API + +This API provides endpoints for managing STACKIT Logs. + +The version of the OpenAPI document: 1.1.0 +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, field_validator +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + + +class CreateAccessPolicyPayload(BaseModel): + """ + CreateAccessPolicyPayload + """ # noqa: E501 + + description: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field( + default=None, description="The description of the access policy." + ) + email: Annotated[str, Field(min_length=3, strict=True, max_length=254)] = Field( + description="The email address of the STACKIT IAM subject (user, group, or service account)." + ) + permissions: List[StrictStr] = Field( + description="The access permissions granted to the access token or access policy." + ) + __properties: ClassVar[List[str]] = ["description", "email", "permissions"] + + @field_validator("permissions") + def permissions_validate_enum(cls, value): + """Validates the enum""" + for i in value: + if i not in set(["read", "write"]): + raise ValueError("each list item must be one of ('read', 'write')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateAccessPolicyPayload 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, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict["description"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateAccessPolicyPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate( + {"description": obj.get("description"), "email": obj.get("email"), "permissions": obj.get("permissions")} + ) + return _obj diff --git a/services/logs/src/stackit/logs/models/create_access_token_payload.py b/services/logs/src/stackit/logs/models/create_access_token_payload.py index ff3172743..dc7c89f59 100644 --- a/services/logs/src/stackit/logs/models/create_access_token_payload.py +++ b/services/logs/src/stackit/logs/models/create_access_token_payload.py @@ -5,7 +5,7 @@ This API provides endpoints for managing STACKIT Logs. -The version of the OpenAPI document: 1.0.0 +The version of the OpenAPI document: 1.1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. @@ -37,7 +37,9 @@ class CreateAccessTokenPayload(BaseModel): lifetime: Optional[Annotated[int, Field(le=180, strict=True, ge=1)]] = Field( default=None, description="A lifetime period for an access token in days. If unset the token will not expire." ) - permissions: List[StrictStr] = Field(description="The access permissions granted to the access token.") + permissions: List[StrictStr] = Field( + description="The access permissions granted to the access token or access policy." + ) __properties: ClassVar[List[str]] = ["description", "displayName", "lifetime", "permissions"] @field_validator("display_name") diff --git a/services/logs/src/stackit/logs/models/create_logs_instance_payload.py b/services/logs/src/stackit/logs/models/create_logs_instance_payload.py index b910a22ee..957c3bd8a 100644 --- a/services/logs/src/stackit/logs/models/create_logs_instance_payload.py +++ b/services/logs/src/stackit/logs/models/create_logs_instance_payload.py @@ -5,7 +5,7 @@ This API provides endpoints for managing STACKIT Logs. -The version of the OpenAPI document: 1.0.0 +The version of the OpenAPI document: 1.1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/logs/src/stackit/logs/models/logs_instance.py b/services/logs/src/stackit/logs/models/logs_instance.py index c8b317c89..c6cab3b5f 100644 --- a/services/logs/src/stackit/logs/models/logs_instance.py +++ b/services/logs/src/stackit/logs/models/logs_instance.py @@ -5,7 +5,7 @@ This API provides endpoints for managing STACKIT Logs. -The version of the OpenAPI document: 1.0.0 +The version of the OpenAPI document: 1.1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/logs/src/stackit/logs/models/logs_instances_list.py b/services/logs/src/stackit/logs/models/logs_instances_list.py index 4eaf7d0f5..4f53886a4 100644 --- a/services/logs/src/stackit/logs/models/logs_instances_list.py +++ b/services/logs/src/stackit/logs/models/logs_instances_list.py @@ -5,7 +5,7 @@ This API provides endpoints for managing STACKIT Logs. -The version of the OpenAPI document: 1.0.0 +The version of the OpenAPI document: 1.1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/logs/src/stackit/logs/models/update_access_policy_payload.py b/services/logs/src/stackit/logs/models/update_access_policy_payload.py new file mode 100644 index 000000000..77cec16c2 --- /dev/null +++ b/services/logs/src/stackit/logs/models/update_access_policy_payload.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" +STACKIT Logs API + +This API provides endpoints for managing STACKIT Logs. + +The version of the OpenAPI document: 1.1.0 +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, field_validator +from pydantic_core import to_jsonable_python +from typing_extensions import Annotated, Self + + +class UpdateAccessPolicyPayload(BaseModel): + """ + UpdateAccessPolicyPayload + """ # noqa: E501 + + description: Optional[Annotated[str, Field(strict=True, max_length=100)]] = Field( + default=None, + description="The updated description of the access policy. If not present will be ignored in update.", + ) + permissions: Optional[List[StrictStr]] = Field( + default=None, description="The access permissions granted to the access token or access policy." + ) + __properties: ClassVar[List[str]] = ["description", "permissions"] + + @field_validator("permissions") + def permissions_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(["read", "write"]): + raise ValueError("each list item must be one of ('read', 'write')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateAccessPolicyPayload 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, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict["description"] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateAccessPolicyPayload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({"description": obj.get("description"), "permissions": obj.get("permissions")}) + return _obj diff --git a/services/logs/src/stackit/logs/models/update_access_token_payload.py b/services/logs/src/stackit/logs/models/update_access_token_payload.py index a31f220a1..0da0b6c59 100644 --- a/services/logs/src/stackit/logs/models/update_access_token_payload.py +++ b/services/logs/src/stackit/logs/models/update_access_token_payload.py @@ -5,7 +5,7 @@ This API provides endpoints for managing STACKIT Logs. -The version of the OpenAPI document: 1.0.0 +The version of the OpenAPI document: 1.1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/logs/src/stackit/logs/models/update_logs_instance_payload.py b/services/logs/src/stackit/logs/models/update_logs_instance_payload.py index 6d12cd0dd..fe6ef5315 100644 --- a/services/logs/src/stackit/logs/models/update_logs_instance_payload.py +++ b/services/logs/src/stackit/logs/models/update_logs_instance_payload.py @@ -5,7 +5,7 @@ This API provides endpoints for managing STACKIT Logs. -The version of the OpenAPI document: 1.0.0 +The version of the OpenAPI document: 1.1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. diff --git a/services/logs/src/stackit/logs/rest.py b/services/logs/src/stackit/logs/rest.py index 2164c14be..00750040e 100644 --- a/services/logs/src/stackit/logs/rest.py +++ b/services/logs/src/stackit/logs/rest.py @@ -5,7 +5,7 @@ This API provides endpoints for managing STACKIT Logs. -The version of the OpenAPI document: 1.0.0 +The version of the OpenAPI document: 1.1.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually.