-
Notifications
You must be signed in to change notification settings - Fork 2
Generator: Update SDK /services/* #2198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4db2864
Generate iaasalpha
stackit-pipeline 0a1e113
Generate intake
stackit-pipeline 19b5dbb
Generate kms
stackit-pipeline f256a02
Generate mongodbflex
stackit-pipeline 2b62ca0
Generate observability
stackit-pipeline 8e773ad
Generate serviceaccount
stackit-pipeline 2a953e1
update changelogs and version
Benjosh95 84d5db9
Merge branch 'mongo' into combined-update-sdk
Benjosh95 36dea80
update changelogs and version
Benjosh95 22739db
Merge branch 'observability' into combined-update-sdk
Benjosh95 a8432b0
update changelogs and version
Benjosh95 b347fd8
Merge branch 'serviceaccount' into combined-update-sdk
Benjosh95 d4195c1
update changelogs and version
Benjosh95 710a7c2
Merge branch 'intake' into combined-update-sdk
Benjosh95 9b3a5d0
Merge branch 'alpha' into combined-update-sdk
Benjosh95 21b142e
fix kms changelog
Benjosh95 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
34,929 changes: 1,517 additions & 33,412 deletions
34,929
services/iaasalpha/src/stackit/iaasalpha/api/default_api.py
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,12 +5,12 @@ | |
|
|
||
| This API allows you to create and modify IaaS resources. | ||
|
|
||
| The version of the OpenAPI document: 1alpha1 | ||
| The version of the OpenAPI document: 2alpha1 | ||
| Contact: [email protected] | ||
| 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 | ||
|
|
@@ -332,6 +332,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]): | ||
|
|
@@ -351,12 +355,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)) | ||
|
|
@@ -458,7 +462,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 = " " | ||
|
|
@@ -474,7 +478,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. | ||
|
|
@@ -489,6 +496,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" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,38 @@ | ||
| # coding: utf-8 | ||
|
|
||
| import sys | ||
|
|
||
| import os | ||
|
|
||
|
|
||
| """ | ||
| IaaS-API | ||
| This API allows you to create and modify IaaS resources. | ||
| The version of the OpenAPI document: 1alpha1 | ||
| The version of the OpenAPI document: 2alpha1 | ||
| Contact: [email protected] | ||
| 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: | ||
|
|
@@ -37,7 +54,7 @@ def __init__( | |
| ) | ||
| """Constructor | ||
| """ | ||
| self._base_path = "https://iaas.api.eu01.stackit.cloud" | ||
| self._base_path = "https://iaas.api.stackit.cloud" | ||
| """Default Base url | ||
| """ | ||
| self.server_index = 0 if server_index is None else server_index | ||
|
|
@@ -54,26 +71,30 @@ 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 | ||
| """ | ||
| return [ | ||
| { | ||
| "url": "https://iaas.api.{region}stackit.cloud", | ||
| "url": "https://iaas.api.stackit.cloud", | ||
| "description": "No description provided", | ||
| "variables": { | ||
| "region": { | ||
| "description": "No description provided", | ||
| "default_value": "eu01.", | ||
| "enum_values": ["eu01."], | ||
| "default_value": "global", | ||
| } | ||
| }, | ||
| } | ||
| ] | ||
|
|
||
| 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 | ||
|
|
@@ -113,7 +134,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"]) | ||
|
|
@@ -132,12 +153,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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,12 +5,12 @@ | |
|
|
||
| This API allows you to create and modify IaaS resources. | ||
|
|
||
| The version of the OpenAPI document: 1alpha1 | ||
| The version of the OpenAPI document: 2alpha1 | ||
| Contact: [email protected] | ||
| 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 | ||
|
|
||
|
|
@@ -152,6 +152,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) | ||
|
|
@@ -188,6 +195,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 = "" | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.