diff --git a/services/authorization/src/stackit/authorization/__init__.py b/services/authorization/src/stackit/authorization/__init__.py index 1b4ae593..61e6d1c5 100644 --- a/services/authorization/src/stackit/authorization/__init__.py +++ b/services/authorization/src/stackit/authorization/__init__.py @@ -11,47 +11,89 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 __version__ = "1.0.0" +# Define package exports +__all__ = [ + "DefaultApi", + "ApiResponse", + "ApiClient", + "HostConfiguration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "AddMembersPayload", + "ErrorResponse", + "ExistingPermission", + "ListMembersResponse", + "ListPermissionsResponse", + "ListUserMembershipsResponse", + "ListUserPermissionsResponse", + "Member", + "MembersResponse", + "Permission", + "RemoveMembersPayload", + "Role", + "RolesResponse", + "UserMembership", + "UserPermission", + "Zookie", +] + # import apis into sdk package -from stackit.authorization.api.default_api import DefaultApi -from stackit.authorization.api_client import ApiClient +from stackit.authorization.api.default_api import DefaultApi as DefaultApi +from stackit.authorization.api_client import ApiClient as ApiClient # import ApiClient -from stackit.authorization.api_response import ApiResponse -from stackit.authorization.configuration import HostConfiguration -from stackit.authorization.exceptions import ( - ApiAttributeError, - ApiException, - ApiKeyError, - ApiTypeError, - ApiValueError, - OpenApiException, -) +from stackit.authorization.api_response import ApiResponse as ApiResponse +from stackit.authorization.configuration import HostConfiguration as HostConfiguration +from stackit.authorization.exceptions import ApiAttributeError as ApiAttributeError +from stackit.authorization.exceptions import ApiException as ApiException +from stackit.authorization.exceptions import ApiKeyError as ApiKeyError +from stackit.authorization.exceptions import ApiTypeError as ApiTypeError +from stackit.authorization.exceptions import ApiValueError as ApiValueError +from stackit.authorization.exceptions import OpenApiException as OpenApiException # import models into sdk package -from stackit.authorization.models.add_members_payload import AddMembersPayload -from stackit.authorization.models.error_response import ErrorResponse -from stackit.authorization.models.existing_permission import ExistingPermission -from stackit.authorization.models.list_members_response import ListMembersResponse +from stackit.authorization.models.add_members_payload import ( + AddMembersPayload as AddMembersPayload, +) +from stackit.authorization.models.error_response import ErrorResponse as ErrorResponse +from stackit.authorization.models.existing_permission import ( + ExistingPermission as ExistingPermission, +) +from stackit.authorization.models.list_members_response import ( + ListMembersResponse as ListMembersResponse, +) from stackit.authorization.models.list_permissions_response import ( - ListPermissionsResponse, + ListPermissionsResponse as ListPermissionsResponse, ) from stackit.authorization.models.list_user_memberships_response import ( - ListUserMembershipsResponse, + ListUserMembershipsResponse as ListUserMembershipsResponse, ) from stackit.authorization.models.list_user_permissions_response import ( - ListUserPermissionsResponse, -) -from stackit.authorization.models.member import Member -from stackit.authorization.models.members_response import MembersResponse -from stackit.authorization.models.permission import Permission -from stackit.authorization.models.remove_members_payload import RemoveMembersPayload -from stackit.authorization.models.role import Role -from stackit.authorization.models.roles_response import RolesResponse -from stackit.authorization.models.user_membership import UserMembership -from stackit.authorization.models.user_permission import UserPermission -from stackit.authorization.models.zookie import Zookie + ListUserPermissionsResponse as ListUserPermissionsResponse, +) +from stackit.authorization.models.member import Member as Member +from stackit.authorization.models.members_response import ( + MembersResponse as MembersResponse, +) +from stackit.authorization.models.permission import Permission as Permission +from stackit.authorization.models.remove_members_payload import ( + RemoveMembersPayload as RemoveMembersPayload, +) +from stackit.authorization.models.role import Role as Role +from stackit.authorization.models.roles_response import RolesResponse as RolesResponse +from stackit.authorization.models.user_membership import ( + UserMembership as UserMembership, +) +from stackit.authorization.models.user_permission import ( + UserPermission as UserPermission, +) +from stackit.authorization.models.zookie import Zookie as Zookie diff --git a/services/authorization/src/stackit/authorization/api/default_api.py b/services/authorization/src/stackit/authorization/api/default_api.py index 5b05c6f2..e1e5fe5e 100644 --- a/services/authorization/src/stackit/authorization/api/default_api.py +++ b/services/authorization/src/stackit/authorization/api/default_api.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Dict, List, Optional, Tuple, Union @@ -92,7 +92,7 @@ def add_members( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._add_members_serialize( resource_id=resource_id, @@ -159,7 +159,7 @@ def add_members_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._add_members_serialize( resource_id=resource_id, @@ -226,7 +226,7 @@ def add_members_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._add_members_serialize( resource_id=resource_id, @@ -264,7 +264,7 @@ def _add_members_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -353,7 +353,7 @@ def list_members( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_members_serialize( resource_type=resource_type, @@ -424,7 +424,7 @@ def list_members_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_members_serialize( resource_type=resource_type, @@ -495,7 +495,7 @@ def list_members_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_members_serialize( resource_type=resource_type, @@ -535,7 +535,7 @@ def _list_members_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -614,7 +614,7 @@ def list_permissions( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_permissions_serialize( resource_type=resource_type, @@ -677,7 +677,7 @@ def list_permissions_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_permissions_serialize( resource_type=resource_type, @@ -740,7 +740,7 @@ def list_permissions_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_permissions_serialize( resource_type=resource_type, @@ -776,7 +776,7 @@ def _list_permissions_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -854,7 +854,7 @@ def list_roles( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_roles_serialize( resource_type=resource_type, @@ -921,7 +921,7 @@ def list_roles_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_roles_serialize( resource_type=resource_type, @@ -988,7 +988,7 @@ def list_roles_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_roles_serialize( resource_type=resource_type, @@ -1026,7 +1026,7 @@ def _list_roles_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1110,7 +1110,7 @@ def list_user_memberships( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_user_memberships_serialize( email=email, @@ -1185,7 +1185,7 @@ def list_user_memberships_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_user_memberships_serialize( email=email, @@ -1260,7 +1260,7 @@ def list_user_memberships_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_user_memberships_serialize( email=email, @@ -1302,7 +1302,7 @@ def _list_user_memberships_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1396,7 +1396,7 @@ def list_user_permissions( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_user_permissions_serialize( email=email, @@ -1471,7 +1471,7 @@ def list_user_permissions_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_user_permissions_serialize( email=email, @@ -1546,7 +1546,7 @@ def list_user_permissions_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._list_user_permissions_serialize( email=email, @@ -1590,7 +1590,7 @@ def _list_user_permissions_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1678,7 +1678,7 @@ def remove_members( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._remove_members_serialize( resource_id=resource_id, @@ -1745,7 +1745,7 @@ def remove_members_with_http_info( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._remove_members_serialize( resource_id=resource_id, @@ -1812,7 +1812,7 @@ def remove_members_without_preload_content( in the spec for a single request. :type _host_index: int, optional :return: Returns the result object. - """ # noqa: E501 docstring might be too long + """ # noqa: E501 _param = self._remove_members_serialize( resource_id=resource_id, @@ -1850,7 +1850,7 @@ def _remove_members_serialize( _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]] = {} + _files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {} _body_params: Optional[bytes] = None # process the path parameters diff --git a/services/authorization/src/stackit/authorization/api_client.py b/services/authorization/src/stackit/authorization/api_client.py index f51d1246..2f7d319d 100644 --- a/services/authorization/src/stackit/authorization/api_client.py +++ b/services/authorization/src/stackit/authorization/api_client.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import datetime import json @@ -331,6 +331,10 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() # noqa: E501 + return self.sanitize_for_serialization(obj_dict) + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): @@ -350,12 +354,12 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif content_type.startswith("application/json"): + elif re.match(r"^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)", content_type, re.IGNORECASE): if response_text == "": data = "" else: data = json.loads(response_text) - elif content_type.startswith("text/plain"): + elif re.match(r"^text\/[a-z.+-]+\s*(;|$)", content_type, re.IGNORECASE): data = response_text else: raise ApiException(status=0, reason="Unsupported content type: {0}".format(content_type)) @@ -457,7 +461,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == "multi": - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == "ssv": delimiter = " " @@ -473,7 +477,10 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files: Dict[str, Union[str, bytes]]): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. @@ -488,6 +495,12 @@ def files_parameters(self, files: Dict[str, Union[str, bytes]]): elif isinstance(v, bytes): filename = k filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue else: raise ValueError("Unsupported file value") mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" diff --git a/services/authorization/src/stackit/authorization/configuration.py b/services/authorization/src/stackit/authorization/configuration.py index 3601d6c4..3a432779 100644 --- a/services/authorization/src/stackit/authorization/configuration.py +++ b/services/authorization/src/stackit/authorization/configuration.py @@ -1,10 +1,5 @@ # coding: utf-8 -import sys - -import os - - """ STACKIT Membership API @@ -14,7 +9,29 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 + +import sys +from typing import Dict, List, Optional, TypedDict + +from typing_extensions import NotRequired + +import os + + +ServerVariablesT = Dict[str, str] + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] class HostConfiguration: @@ -53,7 +70,7 @@ def __init__( """Ignore operation servers """ - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -71,7 +88,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT] = None, + servers: Optional[List[HostSetting]] = None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -111,7 +133,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): and variables.get(variable_name) is not None ): raise ValueError( - "this API does not support setting a region in the the client configuration, " + "this API does not support setting a region in the client configuration, " "please check if the region can be specified as a function parameter" ) used_value = variables.get(variable_name, variable["default_value"]) @@ -130,12 +152,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/services/authorization/src/stackit/authorization/exceptions.py b/services/authorization/src/stackit/authorization/exceptions.py index a30ff635..379d04b5 100644 --- a/services/authorization/src/stackit/authorization/exceptions.py +++ b/services/authorization/src/stackit/authorization/exceptions.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from typing import Any, Optional @@ -151,6 +151,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -187,6 +194,18 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/services/authorization/src/stackit/authorization/models/__init__.py b/services/authorization/src/stackit/authorization/models/__init__.py index 6fbe3d98..5e5cb679 100644 --- a/services/authorization/src/stackit/authorization/models/__init__.py +++ b/services/authorization/src/stackit/authorization/models/__init__.py @@ -10,7 +10,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 # import models into model package diff --git a/services/authorization/src/stackit/authorization/models/add_members_payload.py b/services/authorization/src/stackit/authorization/models/add_members_payload.py index 9e7e60c7..9dcba75f 100644 --- a/services/authorization/src/stackit/authorization/models/add_members_payload.py +++ b/services/authorization/src/stackit/authorization/models/add_members_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -27,7 +27,7 @@ class AddMembersPayload(BaseModel): """ AddMembersPayload - """ + """ # noqa: E501 members: List[Member] resource_type: Annotated[str, Field(strict=True)] = Field(alias="resourceType") diff --git a/services/authorization/src/stackit/authorization/models/error_response.py b/services/authorization/src/stackit/authorization/models/error_response.py index cf20ce52..7476df1b 100644 --- a/services/authorization/src/stackit/authorization/models/error_response.py +++ b/services/authorization/src/stackit/authorization/models/error_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -25,7 +25,7 @@ class ErrorResponse(BaseModel): """ ErrorResponse - """ + """ # noqa: E501 error: StrictStr message: StrictStr diff --git a/services/authorization/src/stackit/authorization/models/existing_permission.py b/services/authorization/src/stackit/authorization/models/existing_permission.py index 5bcdfe05..c46b4a3e 100644 --- a/services/authorization/src/stackit/authorization/models/existing_permission.py +++ b/services/authorization/src/stackit/authorization/models/existing_permission.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -25,7 +25,7 @@ class ExistingPermission(BaseModel): """ ExistingPermission - """ + """ # noqa: E501 description: Annotated[str, Field(strict=True, max_length=255)] name: Annotated[str, Field(strict=True, max_length=255)] diff --git a/services/authorization/src/stackit/authorization/models/list_members_response.py b/services/authorization/src/stackit/authorization/models/list_members_response.py index 031c88d5..6d39bd69 100644 --- a/services/authorization/src/stackit/authorization/models/list_members_response.py +++ b/services/authorization/src/stackit/authorization/models/list_members_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -27,7 +27,7 @@ class ListMembersResponse(BaseModel): """ ListMembersResponse - """ + """ # noqa: E501 members: List[Member] resource_id: Annotated[str, Field(strict=True)] = Field(alias="resourceId") diff --git a/services/authorization/src/stackit/authorization/models/list_permissions_response.py b/services/authorization/src/stackit/authorization/models/list_permissions_response.py index 17e5f5b9..120b03d0 100644 --- a/services/authorization/src/stackit/authorization/models/list_permissions_response.py +++ b/services/authorization/src/stackit/authorization/models/list_permissions_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListPermissionsResponse(BaseModel): """ ListPermissionsResponse - """ + """ # noqa: E501 permissions: List[Permission] __properties: ClassVar[List[str]] = ["permissions"] diff --git a/services/authorization/src/stackit/authorization/models/list_user_memberships_response.py b/services/authorization/src/stackit/authorization/models/list_user_memberships_response.py index b3e03625..d728907a 100644 --- a/services/authorization/src/stackit/authorization/models/list_user_memberships_response.py +++ b/services/authorization/src/stackit/authorization/models/list_user_memberships_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListUserMembershipsResponse(BaseModel): """ ListUserMembershipsResponse - """ + """ # noqa: E501 items: List[UserMembership] __properties: ClassVar[List[str]] = ["items"] diff --git a/services/authorization/src/stackit/authorization/models/list_user_permissions_response.py b/services/authorization/src/stackit/authorization/models/list_user_permissions_response.py index bb9b424d..52b14693 100644 --- a/services/authorization/src/stackit/authorization/models/list_user_permissions_response.py +++ b/services/authorization/src/stackit/authorization/models/list_user_permissions_response.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -26,7 +26,7 @@ class ListUserPermissionsResponse(BaseModel): """ ListUserPermissionsResponse - """ + """ # noqa: E501 items: List[UserPermission] __properties: ClassVar[List[str]] = ["items"] diff --git a/services/authorization/src/stackit/authorization/models/member.py b/services/authorization/src/stackit/authorization/models/member.py index f1c58ece..5f8454a1 100644 --- a/services/authorization/src/stackit/authorization/models/member.py +++ b/services/authorization/src/stackit/authorization/models/member.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -25,7 +25,7 @@ class Member(BaseModel): """ Member - """ + """ # noqa: E501 role: Annotated[str, Field(strict=True)] subject: Annotated[str, Field(min_length=1, strict=True, max_length=255)] diff --git a/services/authorization/src/stackit/authorization/models/members_response.py b/services/authorization/src/stackit/authorization/models/members_response.py index 565fa2f1..da3fed2c 100644 --- a/services/authorization/src/stackit/authorization/models/members_response.py +++ b/services/authorization/src/stackit/authorization/models/members_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -28,7 +28,7 @@ class MembersResponse(BaseModel): """ MembersResponse - """ + """ # noqa: E501 members: List[Member] resource_id: Annotated[str, Field(strict=True)] = Field(alias="resourceId") diff --git a/services/authorization/src/stackit/authorization/models/permission.py b/services/authorization/src/stackit/authorization/models/permission.py index 1ee48273..df24b580 100644 --- a/services/authorization/src/stackit/authorization/models/permission.py +++ b/services/authorization/src/stackit/authorization/models/permission.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -25,7 +25,7 @@ class Permission(BaseModel): """ Permission - """ + """ # noqa: E501 description: Annotated[str, Field(min_length=1, strict=True, max_length=255)] name: Annotated[str, Field(strict=True, max_length=255)] diff --git a/services/authorization/src/stackit/authorization/models/remove_members_payload.py b/services/authorization/src/stackit/authorization/models/remove_members_payload.py index b7bed1ea..49fbc3fa 100644 --- a/services/authorization/src/stackit/authorization/models/remove_members_payload.py +++ b/services/authorization/src/stackit/authorization/models/remove_members_payload.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, StrictBool, field_validator @@ -27,7 +27,7 @@ class RemoveMembersPayload(BaseModel): """ RemoveMembersPayload - """ + """ # noqa: E501 force_remove: Optional[StrictBool] = Field(default=None, alias="forceRemove") members: List[Member] diff --git a/services/authorization/src/stackit/authorization/models/role.py b/services/authorization/src/stackit/authorization/models/role.py index b7baa8f3..17bcdda8 100644 --- a/services/authorization/src/stackit/authorization/models/role.py +++ b/services/authorization/src/stackit/authorization/models/role.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -27,7 +27,7 @@ class Role(BaseModel): """ Role - """ + """ # noqa: E501 description: Annotated[str, Field(strict=True, max_length=255)] id: Optional[Annotated[str, Field(strict=True)]] = None diff --git a/services/authorization/src/stackit/authorization/models/roles_response.py b/services/authorization/src/stackit/authorization/models/roles_response.py index 41447724..0d1659d9 100644 --- a/services/authorization/src/stackit/authorization/models/roles_response.py +++ b/services/authorization/src/stackit/authorization/models/roles_response.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -27,7 +27,7 @@ class RolesResponse(BaseModel): """ RolesResponse - """ + """ # noqa: E501 resource_id: Annotated[str, Field(strict=True)] = Field(alias="resourceId") resource_type: Annotated[str, Field(strict=True)] = Field(alias="resourceType") diff --git a/services/authorization/src/stackit/authorization/models/user_membership.py b/services/authorization/src/stackit/authorization/models/user_membership.py index 7b55f7a0..7a547aa0 100644 --- a/services/authorization/src/stackit/authorization/models/user_membership.py +++ b/services/authorization/src/stackit/authorization/models/user_membership.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -25,7 +25,7 @@ class UserMembership(BaseModel): """ UserMembership - """ + """ # noqa: E501 resource_id: Annotated[str, Field(strict=True)] = Field(alias="resourceId") resource_type: Annotated[str, Field(strict=True)] = Field(alias="resourceType") diff --git a/services/authorization/src/stackit/authorization/models/user_permission.py b/services/authorization/src/stackit/authorization/models/user_permission.py index 7bd02648..cc3a5561 100644 --- a/services/authorization/src/stackit/authorization/models/user_permission.py +++ b/services/authorization/src/stackit/authorization/models/user_permission.py @@ -9,13 +9,13 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations import json import pprint -import re +import re # noqa: F401 from typing import Any, ClassVar, Dict, List, Optional, Set from pydantic import BaseModel, ConfigDict, Field, field_validator @@ -27,7 +27,7 @@ class UserPermission(BaseModel): """ UserPermission - """ + """ # noqa: E501 permissions: List[ExistingPermission] resource_id: Annotated[str, Field(strict=True)] = Field(alias="resourceId") diff --git a/services/authorization/src/stackit/authorization/models/zookie.py b/services/authorization/src/stackit/authorization/models/zookie.py index d40a2891..23423fea 100644 --- a/services/authorization/src/stackit/authorization/models/zookie.py +++ b/services/authorization/src/stackit/authorization/models/zookie.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 from __future__ import annotations @@ -24,7 +24,7 @@ class Zookie(BaseModel): """ Zookie - """ + """ # noqa: E501 zookie: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["zookie"] diff --git a/services/authorization/src/stackit/authorization/rest.py b/services/authorization/src/stackit/authorization/rest.py index 37929c05..b39602e9 100644 --- a/services/authorization/src/stackit/authorization/rest.py +++ b/services/authorization/src/stackit/authorization/rest.py @@ -9,7 +9,7 @@ Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. -""" # noqa: E501 docstring might be too long +""" # noqa: E501 import io import json @@ -124,7 +124,7 @@ def request(self, method, url, headers=None, body=None, post_params=None, _reque data=body, headers=headers, ) - elif headers["Content-Type"] == "text/plain" and isinstance(body, bool): + elif headers["Content-Type"].startswith("text/") and isinstance(body, bool): request_body = "true" if body else "false" r = self.session.request(method, url, data=request_body, headers=headers) else: