Skip to content

Commit

Permalink
[bot] Updated client based on openapi-605e551/clientgen
Browse files Browse the repository at this point in the history
  • Loading branch information
API Engineering committed Mar 19, 2024
1 parent bea00a9 commit 25ed05f
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 33 deletions.
2 changes: 1 addition & 1 deletion DO_OPENAPI_COMMIT_SHA.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2c75905
605e551
58 changes: 44 additions & 14 deletions src/pydo/aio/operations/_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
)
Expand All @@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
)
Expand All @@ -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")
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
66 changes: 48 additions & 18 deletions src/pydo/operations/_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {})

Expand All @@ -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)
Expand All @@ -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 {})

Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
)
Expand All @@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
)
Expand All @@ -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")
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 25ed05f

Please sign in to comment.