diff --git a/CHANGELOG.md b/CHANGELOG.md index 75176a73..305d82d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Release (2025-XX-XX) +- `resourcemanager`: [v0.3.0](services/resourcemanager/CHANGELOG.md#v030-2025-02-07) + - **Breaking Change**: Remove the methods `BffGetContainersOfAFolder` and `BffGetContainersOfAnOrganization` - `lbapplication`: [v0.3.0](services/lbapplication/CHANGELOG.md#v030-2025-02-07) - **Bugfix**: Set type from interface to int64 of `HealthyThreshold`, `UnhealthyThreshold`, `MaxLoadBalancers`, `Port`, `MaxConnections`, `Code` and `TargetPort` - `ske`: [v0.3.0](services/ske/CHANGELOG.md#v030-2025-02-06) diff --git a/services/resourcemanager/CHANGELOG.md b/services/resourcemanager/CHANGELOG.md index fe5c0dc1..dde98ef2 100644 --- a/services/resourcemanager/CHANGELOG.md +++ b/services/resourcemanager/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.3.0 (2025-02-07) + +- **Breaking Change**: Remove the methods `BffGetContainersOfAFolder` and `BffGetContainersOfAnOrganization` + ## v0.2.0 (2025-01-13) - **Breaking Change:**: `get_host_from_settings` returns an error if a region is specified for a global URL. diff --git a/services/resourcemanager/pyproject.toml b/services/resourcemanager/pyproject.toml index 55f3f8a4..4ba6ab5e 100644 --- a/services/resourcemanager/pyproject.toml +++ b/services/resourcemanager/pyproject.toml @@ -3,7 +3,7 @@ name = "stackit-resourcemanager" [tool.poetry] name = "stackit-resourcemanager" -version = "v0.2.0" +version = "v0.3.0" authors = [ "STACKIT Developer Tools ", ] diff --git a/services/resourcemanager/src/stackit/resourcemanager/__init__.py b/services/resourcemanager/src/stackit/resourcemanager/__init__.py index be037a82..517d2352 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/__init__.py +++ b/services/resourcemanager/src/stackit/resourcemanager/__init__.py @@ -35,21 +35,8 @@ # import models into sdk package from stackit.resourcemanager.models.create_project_payload import CreateProjectPayload from stackit.resourcemanager.models.error_response import ErrorResponse -from stackit.resourcemanager.models.folder_response import FolderResponse from stackit.resourcemanager.models.get_project_response import GetProjectResponse from stackit.resourcemanager.models.lifecycle_state import LifecycleState -from stackit.resourcemanager.models.list_organization_containers_response import ( - ListOrganizationContainersResponse, -) -from stackit.resourcemanager.models.list_organization_containers_response_items_inner import ( - ListOrganizationContainersResponseItemsInner, -) -from stackit.resourcemanager.models.list_organization_containers_response_items_inner_any_of import ( - ListOrganizationContainersResponseItemsInnerAnyOf, -) -from stackit.resourcemanager.models.list_organization_containers_response_items_inner_any_of1 import ( - ListOrganizationContainersResponseItemsInnerAnyOf1, -) from stackit.resourcemanager.models.list_organizations_response import ( ListOrganizationsResponse, ) diff --git a/services/resourcemanager/src/stackit/resourcemanager/api/default_api.py b/services/resourcemanager/src/stackit/resourcemanager/api/default_api.py index 396b46f2..e3526a49 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/api/default_api.py +++ b/services/resourcemanager/src/stackit/resourcemanager/api/default_api.py @@ -22,9 +22,6 @@ from stackit.resourcemanager.api_response import ApiResponse from stackit.resourcemanager.models.create_project_payload import CreateProjectPayload from stackit.resourcemanager.models.get_project_response import GetProjectResponse -from stackit.resourcemanager.models.list_organization_containers_response import ( - ListOrganizationContainersResponse, -) from stackit.resourcemanager.models.list_organizations_response import ( ListOrganizationsResponse, ) @@ -50,643 +47,6 @@ def __init__(self, configuration: Configuration = None) -> None: self.configuration = configuration self.api_client = ApiClient(self.configuration) - @validate_call - def bff_get_containers_of_a_folder( - self, - id: Annotated[ - StrictStr, - Field(description="Folder identifier - UUID identifier is preferred; containerId is also supported."), - ], - limit: Annotated[ - Optional[ - Union[ - Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)] - ] - ], - Field( - description="The maximum number of projects to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used." - ), - ] = None, - cursor: Annotated[ - Optional[StrictStr], - Field( - description="A pagination cursor is returned on the first call of the pagination process. If given, it will start from the end of the previous position. If not given, a new pagination is started." - ), - ] = None, - _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, - ) -> ListOrganizationContainersResponse: - """Get Containers Of A Folder - - Returns all direct resource container under this folder including their metadata. - Response items will contain all folders first, followed by all projects - If a folder does not have any containers, an empty items list will be returned **Note:** Recursion is not supported - meaning only the next level in hierarchy tree is considered! - - :param id: Folder identifier - UUID identifier is preferred; containerId is also supported. (required) - :type id: str - :param limit: The maximum number of projects to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used. - :type limit: float - :param cursor: A pagination cursor is returned on the first call of the pagination process. If given, it will start from the end of the previous position. If not given, a new pagination is started. - :type cursor: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._bff_get_containers_of_a_folder_serialize( - id=id, - limit=limit, - cursor=cursor, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListOrganizationContainersResponse", - "400": "ErrorResponse", - "401": "ErrorResponse", - } - 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 bff_get_containers_of_a_folder_with_http_info( - self, - id: Annotated[ - StrictStr, - Field(description="Folder identifier - UUID identifier is preferred; containerId is also supported."), - ], - limit: Annotated[ - Optional[ - Union[ - Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)] - ] - ], - Field( - description="The maximum number of projects to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used." - ), - ] = None, - cursor: Annotated[ - Optional[StrictStr], - Field( - description="A pagination cursor is returned on the first call of the pagination process. If given, it will start from the end of the previous position. If not given, a new pagination is started." - ), - ] = None, - _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[ListOrganizationContainersResponse]: - """Get Containers Of A Folder - - Returns all direct resource container under this folder including their metadata. - Response items will contain all folders first, followed by all projects - If a folder does not have any containers, an empty items list will be returned **Note:** Recursion is not supported - meaning only the next level in hierarchy tree is considered! - - :param id: Folder identifier - UUID identifier is preferred; containerId is also supported. (required) - :type id: str - :param limit: The maximum number of projects to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used. - :type limit: float - :param cursor: A pagination cursor is returned on the first call of the pagination process. If given, it will start from the end of the previous position. If not given, a new pagination is started. - :type cursor: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._bff_get_containers_of_a_folder_serialize( - id=id, - limit=limit, - cursor=cursor, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListOrganizationContainersResponse", - "400": "ErrorResponse", - "401": "ErrorResponse", - } - 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 bff_get_containers_of_a_folder_without_preload_content( - self, - id: Annotated[ - StrictStr, - Field(description="Folder identifier - UUID identifier is preferred; containerId is also supported."), - ], - limit: Annotated[ - Optional[ - Union[ - Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)] - ] - ], - Field( - description="The maximum number of projects to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used." - ), - ] = None, - cursor: Annotated[ - Optional[StrictStr], - Field( - description="A pagination cursor is returned on the first call of the pagination process. If given, it will start from the end of the previous position. If not given, a new pagination is started." - ), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get Containers Of A Folder - - Returns all direct resource container under this folder including their metadata. - Response items will contain all folders first, followed by all projects - If a folder does not have any containers, an empty items list will be returned **Note:** Recursion is not supported - meaning only the next level in hierarchy tree is considered! - - :param id: Folder identifier - UUID identifier is preferred; containerId is also supported. (required) - :type id: str - :param limit: The maximum number of projects to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used. - :type limit: float - :param cursor: A pagination cursor is returned on the first call of the pagination process. If given, it will start from the end of the previous position. If not given, a new pagination is started. - :type cursor: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._bff_get_containers_of_a_folder_serialize( - id=id, - limit=limit, - cursor=cursor, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListOrganizationContainersResponse", - "400": "ErrorResponse", - "401": "ErrorResponse", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _bff_get_containers_of_a_folder_serialize( - self, - id, - limit, - cursor, - _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]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if id is not None: - _path_params["id"] = id - # process the query parameters - if limit is not None: - - _query_params.append(("limit", limit)) - - if cursor is not None: - - _query_params.append(("cursor", cursor)) - - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/bff/folders/{id}/containers", - 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 bff_get_containers_of_an_organization( - self, - id: Annotated[ - StrictStr, - Field(description="Organization identifier - UUID identifier is preferred; containerId is also supported."), - ], - limit: Annotated[ - Optional[ - Union[ - Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)] - ] - ], - Field( - description="The maximum number of projects to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used." - ), - ] = None, - cursor: Annotated[ - Optional[StrictStr], - Field( - description="A pagination cursor is returned on the first call of the pagination process. If given, it will start from the end of the previous position. If not given, a new pagination is started." - ), - ] = None, - _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, - ) -> ListOrganizationContainersResponse: - """Get Containers Of An Organization - - Returns all direct resource container under this organization including their metadata. - Response items will contain all folders first, followed by all projects - If organization does not have any containers, an empty items list will be returned - - :param id: Organization identifier - UUID identifier is preferred; containerId is also supported. (required) - :type id: str - :param limit: The maximum number of projects to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used. - :type limit: float - :param cursor: A pagination cursor is returned on the first call of the pagination process. If given, it will start from the end of the previous position. If not given, a new pagination is started. - :type cursor: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._bff_get_containers_of_an_organization_serialize( - id=id, - limit=limit, - cursor=cursor, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListOrganizationContainersResponse", - "400": "ErrorResponse", - "401": "ErrorResponse", - "404": "ErrorResponse", - } - 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 bff_get_containers_of_an_organization_with_http_info( - self, - id: Annotated[ - StrictStr, - Field(description="Organization identifier - UUID identifier is preferred; containerId is also supported."), - ], - limit: Annotated[ - Optional[ - Union[ - Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)] - ] - ], - Field( - description="The maximum number of projects to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used." - ), - ] = None, - cursor: Annotated[ - Optional[StrictStr], - Field( - description="A pagination cursor is returned on the first call of the pagination process. If given, it will start from the end of the previous position. If not given, a new pagination is started." - ), - ] = None, - _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[ListOrganizationContainersResponse]: - """Get Containers Of An Organization - - Returns all direct resource container under this organization including their metadata. - Response items will contain all folders first, followed by all projects - If organization does not have any containers, an empty items list will be returned - - :param id: Organization identifier - UUID identifier is preferred; containerId is also supported. (required) - :type id: str - :param limit: The maximum number of projects to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used. - :type limit: float - :param cursor: A pagination cursor is returned on the first call of the pagination process. If given, it will start from the end of the previous position. If not given, a new pagination is started. - :type cursor: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._bff_get_containers_of_an_organization_serialize( - id=id, - limit=limit, - cursor=cursor, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListOrganizationContainersResponse", - "400": "ErrorResponse", - "401": "ErrorResponse", - "404": "ErrorResponse", - } - 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 bff_get_containers_of_an_organization_without_preload_content( - self, - id: Annotated[ - StrictStr, - Field(description="Organization identifier - UUID identifier is preferred; containerId is also supported."), - ], - limit: Annotated[ - Optional[ - Union[ - Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)] - ] - ], - Field( - description="The maximum number of projects to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used." - ), - ] = None, - cursor: Annotated[ - Optional[StrictStr], - Field( - description="A pagination cursor is returned on the first call of the pagination process. If given, it will start from the end of the previous position. If not given, a new pagination is started." - ), - ] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """Get Containers Of An Organization - - Returns all direct resource container under this organization including their metadata. - Response items will contain all folders first, followed by all projects - If organization does not have any containers, an empty items list will be returned - - :param id: Organization identifier - UUID identifier is preferred; containerId is also supported. (required) - :type id: str - :param limit: The maximum number of projects to return in the response. If not present, an appropriate default will be used. If maximum is exceeded, maximum is used. - :type limit: float - :param cursor: A pagination cursor is returned on the first call of the pagination process. If given, it will start from the end of the previous position. If not given, a new pagination is started. - :type cursor: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 docstring might be too long - - _param = self._bff_get_containers_of_an_organization_serialize( - id=id, - limit=limit, - cursor=cursor, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index, - ) - - _response_types_map: Dict[str, Optional[str]] = { - "200": "ListOrganizationContainersResponse", - "400": "ErrorResponse", - "401": "ErrorResponse", - "404": "ErrorResponse", - } - response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout) - return response_data.response - - def _bff_get_containers_of_an_organization_serialize( - self, - id, - limit, - cursor, - _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]] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if id is not None: - _path_params["id"] = id - # process the query parameters - if limit is not None: - - _query_params.append(("limit", limit)) - - if cursor is not None: - - _query_params.append(("cursor", cursor)) - - # process the header parameters - # process the form parameters - # process the body parameter - - # set the HTTP header `Accept` - if "Accept" not in _header_params: - _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) - - # authentication setting - _auth_settings: List[str] = [] - - return self.api_client.param_serialize( - method="GET", - resource_path="/bff/organizations/{id}/containers", - 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_project( self, diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/__init__.py b/services/resourcemanager/src/stackit/resourcemanager/models/__init__.py index 3314d140..c49d0928 100644 --- a/services/resourcemanager/src/stackit/resourcemanager/models/__init__.py +++ b/services/resourcemanager/src/stackit/resourcemanager/models/__init__.py @@ -16,21 +16,8 @@ # import models into model package from stackit.resourcemanager.models.create_project_payload import CreateProjectPayload from stackit.resourcemanager.models.error_response import ErrorResponse -from stackit.resourcemanager.models.folder_response import FolderResponse from stackit.resourcemanager.models.get_project_response import GetProjectResponse from stackit.resourcemanager.models.lifecycle_state import LifecycleState -from stackit.resourcemanager.models.list_organization_containers_response import ( - ListOrganizationContainersResponse, -) -from stackit.resourcemanager.models.list_organization_containers_response_items_inner import ( - ListOrganizationContainersResponseItemsInner, -) -from stackit.resourcemanager.models.list_organization_containers_response_items_inner_any_of import ( - ListOrganizationContainersResponseItemsInnerAnyOf, -) -from stackit.resourcemanager.models.list_organization_containers_response_items_inner_any_of1 import ( - ListOrganizationContainersResponseItemsInnerAnyOf1, -) from stackit.resourcemanager.models.list_organizations_response import ( ListOrganizationsResponse, ) diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/folder_response.py b/services/resourcemanager/src/stackit/resourcemanager/models/folder_response.py deleted file mode 100644 index 0b9e41f7..00000000 --- a/services/resourcemanager/src/stackit/resourcemanager/models/folder_response.py +++ /dev/null @@ -1,114 +0,0 @@ -# coding: utf-8 - -""" - Resource Manager API - - API v2 to manage resource containers - organizations, folders, projects incl. labels ### Resource Management STACKIT resource management handles the terms _Organization_, _Folder_, _Project_, _Label_, and the hierarchical structure between them. Technically, organizations, folders, and projects are _Resource Containers_ to which a _Label_ can be attached to. The STACKIT _Resource Manager_ provides CRUD endpoints to query and to modify the state. ### Organizations STACKIT organizations are the base element to create and to use cloud-resources. An organization is bound to one customer account. Organizations have a lifecycle. - Organizations are always the root node in resource hierarchy and do not have a parent ### Projects STACKIT projects are needed to use cloud-resources. Projects serve as wrapper for underlying technical structures and processes. Projects have a lifecycle. Projects compared to folders may have different policies. - Projects are optional, but mandatory for cloud-resource usage - A project can be created having either an organization, or a folder as parent - A project must not have a project as parent - Project names under the same parent must not be unique - Root organization cannot be changed ### Label STACKIT labels are key-value pairs including a resource container reference. Labels can be defined and attached freely to resource containers by which resources can be organized and queried. - Policy-based, immutable labels may exists - - The version of the OpenAPI document: 2.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 docstring might be too long - -from __future__ import annotations - -import json -import pprint -from datetime import datetime -from typing import Any, ClassVar, Dict, List, Optional, Set - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Self - -from stackit.resourcemanager.models.parent import Parent - - -class FolderResponse(BaseModel): - """ - FolderResponse - """ - - container_id: StrictStr = Field(description="Globally unique, user-friendly identifier.", alias="containerId") - creation_time: datetime = Field(description="Timestamp at which the folder was created.", alias="creationTime") - folder_id: StrictStr = Field(description="Globally unique folder identifier.", alias="folderId") - labels: Optional[Dict[str, StrictStr]] = Field( - default=None, - description="Labels are key-value string pairs that can be attached to a resource container. Some labels may be enforced via policies. - A label key must match the regex `[A-ZÄÜÖa-zäüöß0-9_-]{1,64}`. - A label value must match the regex `^$|[A-ZÄÜÖa-zäüöß0-9_-]{1,64}`.", - ) - name: StrictStr = Field(description="Folder name.") - parent: Parent - update_time: datetime = Field(description="Timestamp at which the folder was last modified.", alias="updateTime") - __properties: ClassVar[List[str]] = [ - "containerId", - "creationTime", - "folderId", - "labels", - "name", - "parent", - "updateTime", - ] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of FolderResponse 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 parent - if self.parent: - _dict["parent"] = self.parent.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of FolderResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "containerId": obj.get("containerId"), - "creationTime": obj.get("creationTime"), - "folderId": obj.get("folderId"), - "labels": obj.get("labels"), - "name": obj.get("name"), - "parent": Parent.from_dict(obj["parent"]) if obj.get("parent") is not None else None, - "updateTime": obj.get("updateTime"), - } - ) - return _obj diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/list_organization_containers_response.py b/services/resourcemanager/src/stackit/resourcemanager/models/list_organization_containers_response.py deleted file mode 100644 index 9d7ecd8d..00000000 --- a/services/resourcemanager/src/stackit/resourcemanager/models/list_organization_containers_response.py +++ /dev/null @@ -1,110 +0,0 @@ -# coding: utf-8 - -""" - Resource Manager API - - API v2 to manage resource containers - organizations, folders, projects incl. labels ### Resource Management STACKIT resource management handles the terms _Organization_, _Folder_, _Project_, _Label_, and the hierarchical structure between them. Technically, organizations, folders, and projects are _Resource Containers_ to which a _Label_ can be attached to. The STACKIT _Resource Manager_ provides CRUD endpoints to query and to modify the state. ### Organizations STACKIT organizations are the base element to create and to use cloud-resources. An organization is bound to one customer account. Organizations have a lifecycle. - Organizations are always the root node in resource hierarchy and do not have a parent ### Projects STACKIT projects are needed to use cloud-resources. Projects serve as wrapper for underlying technical structures and processes. Projects have a lifecycle. Projects compared to folders may have different policies. - Projects are optional, but mandatory for cloud-resource usage - A project can be created having either an organization, or a folder as parent - A project must not have a project as parent - Project names under the same parent must not be unique - Root organization cannot be changed ### Label STACKIT labels are key-value pairs including a resource container reference. Labels can be defined and attached freely to resource containers by which resources can be organized and queried. - Policy-based, immutable labels may exists - - The version of the OpenAPI document: 2.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 docstring might be too long - -from __future__ import annotations - -import json -import pprint -from typing import Any, ClassVar, Dict, List, Optional, Set, Union - -from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing_extensions import Annotated, Self - -from stackit.resourcemanager.models.list_organization_containers_response_items_inner import ( - ListOrganizationContainersResponseItemsInner, -) - - -class ListOrganizationContainersResponse(BaseModel): - """ - ListOrganizationContainersResponse - """ - - cursor: StrictStr = Field( - description="A pagination cursor is returned on the first call of the pagination process. If given, it will start from the end of the previous position. If not given, a new pagination is started." - ) - items: List[ListOrganizationContainersResponseItemsInner] - limit: Union[ - Annotated[float, Field(le=100, strict=True, ge=0)], Annotated[int, Field(le=100, strict=True, ge=0)] - ] = Field( - description="The maximum number of projects to return in the response. If not present, an appropriate default will be used." - ) - __properties: ClassVar[List[str]] = ["cursor", "items", "limit"] - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ListOrganizationContainersResponse 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 items (list) - _items = [] - if self.items: - for _item in self.items: - if _item: - _items.append(_item.to_dict()) - _dict["items"] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListOrganizationContainersResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "cursor": obj.get("cursor"), - "items": ( - [ListOrganizationContainersResponseItemsInner.from_dict(_item) for _item in obj["items"]] - if obj.get("items") is not None - else None - ), - "limit": obj.get("limit") if obj.get("limit") is not None else 50, - } - ) - return _obj diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/list_organization_containers_response_items_inner.py b/services/resourcemanager/src/stackit/resourcemanager/models/list_organization_containers_response_items_inner.py deleted file mode 100644 index 167dc937..00000000 --- a/services/resourcemanager/src/stackit/resourcemanager/models/list_organization_containers_response_items_inner.py +++ /dev/null @@ -1,164 +0,0 @@ -# coding: utf-8 - -""" - Resource Manager API - - API v2 to manage resource containers - organizations, folders, projects incl. labels ### Resource Management STACKIT resource management handles the terms _Organization_, _Folder_, _Project_, _Label_, and the hierarchical structure between them. Technically, organizations, folders, and projects are _Resource Containers_ to which a _Label_ can be attached to. The STACKIT _Resource Manager_ provides CRUD endpoints to query and to modify the state. ### Organizations STACKIT organizations are the base element to create and to use cloud-resources. An organization is bound to one customer account. Organizations have a lifecycle. - Organizations are always the root node in resource hierarchy and do not have a parent ### Projects STACKIT projects are needed to use cloud-resources. Projects serve as wrapper for underlying technical structures and processes. Projects have a lifecycle. Projects compared to folders may have different policies. - Projects are optional, but mandatory for cloud-resource usage - A project can be created having either an organization, or a folder as parent - A project must not have a project as parent - Project names under the same parent must not be unique - Root organization cannot be changed ### Label STACKIT labels are key-value pairs including a resource container reference. Labels can be defined and attached freely to resource containers by which resources can be organized and queried. - Policy-based, immutable labels may exists - - The version of the OpenAPI document: 2.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 docstring might be too long - -from __future__ import annotations - -import json -import pprint -from typing import TYPE_CHECKING, Any, Dict, Optional, Set, Union - -from pydantic import ( - BaseModel, - ValidationError, - field_validator, -) -from typing_extensions import Self - -from stackit.resourcemanager.models.list_organization_containers_response_items_inner_any_of import ( - ListOrganizationContainersResponseItemsInnerAnyOf, -) -from stackit.resourcemanager.models.list_organization_containers_response_items_inner_any_of1 import ( - ListOrganizationContainersResponseItemsInnerAnyOf1, -) - - -LISTORGANIZATIONCONTAINERSRESPONSEITEMSINNER_ANY_OF_SCHEMAS = [ - "ListOrganizationContainersResponseItemsInnerAnyOf", - "ListOrganizationContainersResponseItemsInnerAnyOf1", -] - - -class ListOrganizationContainersResponseItemsInner(BaseModel): - """ - ListOrganizationContainersResponseItemsInner - """ - - # data type: ListOrganizationContainersResponseItemsInnerAnyOf - anyof_schema_1_validator: Optional[ListOrganizationContainersResponseItemsInnerAnyOf] = None - # data type: ListOrganizationContainersResponseItemsInnerAnyOf1 - anyof_schema_2_validator: Optional[ListOrganizationContainersResponseItemsInnerAnyOf1] = None - if TYPE_CHECKING: - actual_instance: Optional[ - Union[ListOrganizationContainersResponseItemsInnerAnyOf, ListOrganizationContainersResponseItemsInnerAnyOf1] - ] = None - else: - actual_instance: Any = None - any_of_schemas: Set[str] = { - "ListOrganizationContainersResponseItemsInnerAnyOf", - "ListOrganizationContainersResponseItemsInnerAnyOf1", - } - - model_config = { - "validate_assignment": True, - "protected_namespaces": (), - } - - def __init__(self, *args, **kwargs) -> None: - if args: - if len(args) > 1: - raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") - if kwargs: - raise ValueError("If a position argument is used, keyword arguments cannot be used.") - super().__init__(actual_instance=args[0]) - else: - super().__init__(**kwargs) - - @field_validator("actual_instance") - def actual_instance_must_validate_anyof(cls, v): - instance = ListOrganizationContainersResponseItemsInner.model_construct() - error_messages = [] - # validate data type: ListOrganizationContainersResponseItemsInnerAnyOf - if not isinstance(v, ListOrganizationContainersResponseItemsInnerAnyOf): - error_messages.append( - f"Error! Input type `{type(v)}` is not `ListOrganizationContainersResponseItemsInnerAnyOf`" - ) - else: - return v - - # validate data type: ListOrganizationContainersResponseItemsInnerAnyOf1 - if not isinstance(v, ListOrganizationContainersResponseItemsInnerAnyOf1): - error_messages.append( - f"Error! Input type `{type(v)}` is not `ListOrganizationContainersResponseItemsInnerAnyOf1`" - ) - else: - return v - - if error_messages: - # no match - raise ValueError( - "No match found when setting the actual_instance in ListOrganizationContainersResponseItemsInner with anyOf schemas: ListOrganizationContainersResponseItemsInnerAnyOf, ListOrganizationContainersResponseItemsInnerAnyOf1. Details: " - + ", ".join(error_messages) - ) - else: - return v - - @classmethod - def from_dict(cls, obj: Dict[str, Any]) -> Self: - return cls.from_json(json.dumps(obj)) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Returns the object represented by the json string""" - instance = cls.model_construct() - error_messages = [] - try: - instance.actual_instance = ListOrganizationContainersResponseItemsInnerAnyOf.from_json(json_str) - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - try: - instance.actual_instance = ListOrganizationContainersResponseItemsInnerAnyOf1.from_json(json_str) - return instance - except (ValidationError, ValueError) as e: - error_messages.append(str(e)) - - if error_messages: - # no match - raise ValueError( - "No match found when deserializing the JSON string into ListOrganizationContainersResponseItemsInner with anyOf schemas: ListOrganizationContainersResponseItemsInnerAnyOf, ListOrganizationContainersResponseItemsInnerAnyOf1. Details: " - + ", ".join(error_messages) - ) - else: - return instance - - def to_json(self) -> str: - """Returns the JSON representation of the actual instance""" - if self.actual_instance is None: - return "null" - - if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): - return self.actual_instance.to_json() - else: - return json.dumps(self.actual_instance) - - def to_dict( - self, - ) -> Optional[ - Union[ - Dict[str, Any], - ListOrganizationContainersResponseItemsInnerAnyOf, - ListOrganizationContainersResponseItemsInnerAnyOf1, - ] - ]: - """Returns the dict representation of the actual instance""" - if self.actual_instance is None: - return None - - if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): - return self.actual_instance.to_dict() - else: - return self.actual_instance - - def to_str(self) -> str: - """Returns the string representation of the actual instance""" - return pprint.pformat(self.model_dump()) diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/list_organization_containers_response_items_inner_any_of.py b/services/resourcemanager/src/stackit/resourcemanager/models/list_organization_containers_response_items_inner_any_of.py deleted file mode 100644 index 8a53b460..00000000 --- a/services/resourcemanager/src/stackit/resourcemanager/models/list_organization_containers_response_items_inner_any_of.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Resource Manager API - - API v2 to manage resource containers - organizations, folders, projects incl. labels ### Resource Management STACKIT resource management handles the terms _Organization_, _Folder_, _Project_, _Label_, and the hierarchical structure between them. Technically, organizations, folders, and projects are _Resource Containers_ to which a _Label_ can be attached to. The STACKIT _Resource Manager_ provides CRUD endpoints to query and to modify the state. ### Organizations STACKIT organizations are the base element to create and to use cloud-resources. An organization is bound to one customer account. Organizations have a lifecycle. - Organizations are always the root node in resource hierarchy and do not have a parent ### Projects STACKIT projects are needed to use cloud-resources. Projects serve as wrapper for underlying technical structures and processes. Projects have a lifecycle. Projects compared to folders may have different policies. - Projects are optional, but mandatory for cloud-resource usage - A project can be created having either an organization, or a folder as parent - A project must not have a project as parent - Project names under the same parent must not be unique - Root organization cannot be changed ### Label STACKIT labels are key-value pairs including a resource container reference. Labels can be defined and attached freely to resource containers by which resources can be organized and queried. - Policy-based, immutable labels may exists - - The version of the OpenAPI document: 2.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 docstring might be too long - -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 typing_extensions import Self - -from stackit.resourcemanager.models.folder_response import FolderResponse - - -class ListOrganizationContainersResponseItemsInnerAnyOf(BaseModel): - """ - ListOrganizationContainersResponseItemsInnerAnyOf - """ - - item: FolderResponse - type: StrictStr = Field(description="Resource container type.") - __properties: ClassVar[List[str]] = ["item", "type"] - - @field_validator("type") - def type_validate_enum(cls, value): - """Validates the enum""" - if value not in set(["FOLDER"]): - raise ValueError("must be one of enum values ('FOLDER')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ListOrganizationContainersResponseItemsInnerAnyOf 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 item - if self.item: - _dict["item"] = self.item.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListOrganizationContainersResponseItemsInnerAnyOf from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - { - "item": FolderResponse.from_dict(obj["item"]) if obj.get("item") is not None else None, - "type": obj.get("type"), - } - ) - return _obj diff --git a/services/resourcemanager/src/stackit/resourcemanager/models/list_organization_containers_response_items_inner_any_of1.py b/services/resourcemanager/src/stackit/resourcemanager/models/list_organization_containers_response_items_inner_any_of1.py deleted file mode 100644 index f6fb133b..00000000 --- a/services/resourcemanager/src/stackit/resourcemanager/models/list_organization_containers_response_items_inner_any_of1.py +++ /dev/null @@ -1,96 +0,0 @@ -# coding: utf-8 - -""" - Resource Manager API - - API v2 to manage resource containers - organizations, folders, projects incl. labels ### Resource Management STACKIT resource management handles the terms _Organization_, _Folder_, _Project_, _Label_, and the hierarchical structure between them. Technically, organizations, folders, and projects are _Resource Containers_ to which a _Label_ can be attached to. The STACKIT _Resource Manager_ provides CRUD endpoints to query and to modify the state. ### Organizations STACKIT organizations are the base element to create and to use cloud-resources. An organization is bound to one customer account. Organizations have a lifecycle. - Organizations are always the root node in resource hierarchy and do not have a parent ### Projects STACKIT projects are needed to use cloud-resources. Projects serve as wrapper for underlying technical structures and processes. Projects have a lifecycle. Projects compared to folders may have different policies. - Projects are optional, but mandatory for cloud-resource usage - A project can be created having either an organization, or a folder as parent - A project must not have a project as parent - Project names under the same parent must not be unique - Root organization cannot be changed ### Label STACKIT labels are key-value pairs including a resource container reference. Labels can be defined and attached freely to resource containers by which resources can be organized and queried. - Policy-based, immutable labels may exists - - The version of the OpenAPI document: 2.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 docstring might be too long - -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 typing_extensions import Self - -from stackit.resourcemanager.models.project import Project - - -class ListOrganizationContainersResponseItemsInnerAnyOf1(BaseModel): - """ - ListOrganizationContainersResponseItemsInnerAnyOf1 - """ - - item: Project - type: StrictStr = Field(description="Resource container type.") - __properties: ClassVar[List[str]] = ["item", "type"] - - @field_validator("type") - def type_validate_enum(cls, value): - """Validates the enum""" - if value not in set(["PROJECT"]): - raise ValueError("must be one of enum values ('PROJECT')") - return value - - model_config = ConfigDict( - populate_by_name=True, - validate_assignment=True, - protected_namespaces=(), - ) - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ListOrganizationContainersResponseItemsInnerAnyOf1 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 item - if self.item: - _dict["item"] = self.item.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ListOrganizationContainersResponseItemsInnerAnyOf1 from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate( - {"item": Project.from_dict(obj["item"]) if obj.get("item") is not None else None, "type": obj.get("type")} - ) - return _obj