diff --git a/DO_OPENAPI_COMMIT_SHA.txt b/DO_OPENAPI_COMMIT_SHA.txt index bc20549..022d0a9 100644 --- a/DO_OPENAPI_COMMIT_SHA.txt +++ b/DO_OPENAPI_COMMIT_SHA.txt @@ -1 +1 @@ -2c75905 +916ed7e diff --git a/src/pydo/aio/operations/_operations.py b/src/pydo/aio/operations/_operations.py index dce8770..d69d5f2 100644 --- a/src/pydo/aio/operations/_operations.py +++ b/src/pydo/aio/operations/_operations.py @@ -118826,7 +118826,7 @@ async def get(self, snapshot_id: JSON, **kwargs: Any) -> JSON: ] } } - # response body for status code(s): 404 + # response body for status code(s): 400, 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would @@ -118865,7 +118865,7 @@ async def get(self, snapshot_id: JSON, **kwargs: Any) -> JSON: response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200, 400, 404]: map_error( status_code=response.status_code, response=response, error_map=error_map ) @@ -118888,6 +118888,22 @@ async def get(self, snapshot_id: JSON, **kwargs: Any) -> JSON: else: deserialized = None + if response.status_code == 400: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + if response.status_code == 404: response_headers["ratelimit-limit"] = self._deserialize( "int", response.headers.get("ratelimit-limit") @@ -118930,7 +118946,7 @@ async def delete(self, snapshot_id: JSON, **kwargs: Any) -> Optional[JSON]: Example: .. code-block:: python - # response body for status code(s): 404 + # response body for status code(s): 400, 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would @@ -118969,7 +118985,7 @@ async def delete(self, snapshot_id: JSON, **kwargs: Any) -> Optional[JSON]: response = pipeline_response.http_response - if response.status_code not in [204, 404]: + if response.status_code not in [204, 400, 404]: map_error( status_code=response.status_code, response=response, error_map=error_map ) @@ -118988,6 +119004,22 @@ async def delete(self, snapshot_id: JSON, **kwargs: Any) -> Optional[JSON]: "int", response.headers.get("ratelimit-reset") ) + if response.status_code == 400: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + if response.status_code == 404: response_headers["ratelimit-limit"] = self._deserialize( "int", response.headers.get("ratelimit-limit") @@ -122465,15 +122497,14 @@ def __init__(self, *args, **kwargs) -> None: ) @distributed_trace_async - async def get_by_id(self, snapshot_id: JSON, **kwargs: Any) -> JSON: + async def get_by_id(self, snapshot_id: str, **kwargs: Any) -> JSON: """Retrieve an Existing Volume Snapshot. To retrieve the details of a snapshot that has been created from a volume, send a GET request - to ``/v2/volumes/snapshots/$SNAPSHOT_ID``. + to ``/v2/volumes/snapshots/$VOLUME_SNAPSHOT_ID``. - :param snapshot_id: Either the ID of an existing snapshot. This will be an integer for a - Droplet snapshot or a string for a volume snapshot. Required. - :type snapshot_id: JSON + :param snapshot_id: The unique identifier for the snapshot. Required. + :type snapshot_id: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -122591,18 +122622,17 @@ async def get_by_id(self, snapshot_id: JSON, **kwargs: Any) -> JSON: return cast(JSON, deserialized) @distributed_trace_async - async def delete_by_id(self, snapshot_id: JSON, **kwargs: Any) -> Optional[JSON]: + async def delete_by_id(self, snapshot_id: str, **kwargs: Any) -> Optional[JSON]: """Delete a Volume Snapshot. To delete a volume snapshot, send a DELETE request to - ``/v2/snapshots/$SNAPSHOT_ID``. + ``/v2/volumes/snapshots/$VOLUME_SNAPSHOT_ID``. A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. - :param snapshot_id: Either the ID of an existing snapshot. This will be an integer for a - Droplet snapshot or a string for a volume snapshot. Required. - :type snapshot_id: JSON + :param snapshot_id: The unique identifier for the snapshot. Required. + :type snapshot_id: str :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: diff --git a/src/pydo/operations/_operations.py b/src/pydo/operations/_operations.py index 7fd8403..0d5978d 100644 --- a/src/pydo/operations/_operations.py +++ b/src/pydo/operations/_operations.py @@ -6779,7 +6779,7 @@ def build_volume_actions_get_request( def build_volume_snapshots_get_by_id_request( - snapshot_id: JSON, **kwargs: Any + snapshot_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -6788,7 +6788,7 @@ def build_volume_snapshots_get_by_id_request( # Construct URL _url = "/v2/volumes/snapshots/{snapshot_id}" path_format_arguments = { - "snapshot_id": _SERIALIZER.url("snapshot_id", snapshot_id, "object"), + "snapshot_id": _SERIALIZER.url("snapshot_id", snapshot_id, "str"), } _url = _format_url_section(_url, **path_format_arguments) @@ -6800,7 +6800,7 @@ def build_volume_snapshots_get_by_id_request( def build_volume_snapshots_delete_by_id_request( - snapshot_id: JSON, **kwargs: Any + snapshot_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -6809,7 +6809,7 @@ def build_volume_snapshots_delete_by_id_request( # Construct URL _url = "/v2/volumes/snapshots/{snapshot_id}" path_format_arguments = { - "snapshot_id": _SERIALIZER.url("snapshot_id", snapshot_id, "object"), + "snapshot_id": _SERIALIZER.url("snapshot_id", snapshot_id, "str"), } _url = _format_url_section(_url, **path_format_arguments) @@ -125762,7 +125762,7 @@ def get(self, snapshot_id: JSON, **kwargs: Any) -> JSON: ] } } - # response body for status code(s): 404 + # response body for status code(s): 400, 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would @@ -125801,7 +125801,7 @@ def get(self, snapshot_id: JSON, **kwargs: Any) -> JSON: response = pipeline_response.http_response - if response.status_code not in [200, 404]: + if response.status_code not in [200, 400, 404]: map_error( status_code=response.status_code, response=response, error_map=error_map ) @@ -125824,6 +125824,22 @@ def get(self, snapshot_id: JSON, **kwargs: Any) -> JSON: else: deserialized = None + if response.status_code == 400: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + if response.status_code == 404: response_headers["ratelimit-limit"] = self._deserialize( "int", response.headers.get("ratelimit-limit") @@ -125866,7 +125882,7 @@ def delete(self, snapshot_id: JSON, **kwargs: Any) -> Optional[JSON]: Example: .. code-block:: python - # response body for status code(s): 404 + # response body for status code(s): 400, 404 response == { "id": "str", # A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would @@ -125905,7 +125921,7 @@ def delete(self, snapshot_id: JSON, **kwargs: Any) -> Optional[JSON]: response = pipeline_response.http_response - if response.status_code not in [204, 404]: + if response.status_code not in [204, 400, 404]: map_error( status_code=response.status_code, response=response, error_map=error_map ) @@ -125924,6 +125940,22 @@ def delete(self, snapshot_id: JSON, **kwargs: Any) -> Optional[JSON]: "int", response.headers.get("ratelimit-reset") ) + if response.status_code == 400: + response_headers["ratelimit-limit"] = self._deserialize( + "int", response.headers.get("ratelimit-limit") + ) + response_headers["ratelimit-remaining"] = self._deserialize( + "int", response.headers.get("ratelimit-remaining") + ) + response_headers["ratelimit-reset"] = self._deserialize( + "int", response.headers.get("ratelimit-reset") + ) + + if response.content: + deserialized = response.json() + else: + deserialized = None + if response.status_code == 404: response_headers["ratelimit-limit"] = self._deserialize( "int", response.headers.get("ratelimit-limit") @@ -129401,15 +129433,14 @@ def __init__(self, *args, **kwargs): ) @distributed_trace - def get_by_id(self, snapshot_id: JSON, **kwargs: Any) -> JSON: + def get_by_id(self, snapshot_id: str, **kwargs: Any) -> JSON: """Retrieve an Existing Volume Snapshot. To retrieve the details of a snapshot that has been created from a volume, send a GET request - to ``/v2/volumes/snapshots/$SNAPSHOT_ID``. + to ``/v2/volumes/snapshots/$VOLUME_SNAPSHOT_ID``. - :param snapshot_id: Either the ID of an existing snapshot. This will be an integer for a - Droplet snapshot or a string for a volume snapshot. Required. - :type snapshot_id: JSON + :param snapshot_id: The unique identifier for the snapshot. Required. + :type snapshot_id: str :return: JSON object :rtype: JSON :raises ~azure.core.exceptions.HttpResponseError: @@ -129527,18 +129558,17 @@ def get_by_id(self, snapshot_id: JSON, **kwargs: Any) -> JSON: return cast(JSON, deserialized) @distributed_trace - def delete_by_id(self, snapshot_id: JSON, **kwargs: Any) -> Optional[JSON]: + def delete_by_id(self, snapshot_id: str, **kwargs: Any) -> Optional[JSON]: """Delete a Volume Snapshot. To delete a volume snapshot, send a DELETE request to - ``/v2/snapshots/$SNAPSHOT_ID``. + ``/v2/volumes/snapshots/$VOLUME_SNAPSHOT_ID``. A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed. - :param snapshot_id: Either the ID of an existing snapshot. This will be an integer for a - Droplet snapshot or a string for a volume snapshot. Required. - :type snapshot_id: JSON + :param snapshot_id: The unique identifier for the snapshot. Required. + :type snapshot_id: str :return: JSON object or None :rtype: JSON or None :raises ~azure.core.exceptions.HttpResponseError: