Skip to content

Commit

Permalink
✨ Upgrade client to latest openapi-generator version (#164)
Browse files Browse the repository at this point in the history
* 🚚 move autoflake/black/isort for after postprocess complete

* ✨ modify sed commands to match new patterns

* 🎨 update import of

* 🎨 update import of typing.Set

* 🎨 update to_dict method

* 🎨 update from_json method

* 🎨 update from_dict method

* 🎨 update Union[str, Any] to Dict[str, Any]

* 🎨 read key directly

* 🎨

* 🎨 use new in set pattern

* 🎨 read key directly if exists

* 🎨 read key directly if exists

* 🎨 update to_dict method

* 🎨 adds previously ungenerated model field descriptions

* 🎨 add import

* 🎨 use new in set pattern

* 🎨 read key directly if exists

* 🎨 add import

* 🎨 adds previously ungenerated model field descriptions

* 🎨 new format for _response_types_map

* 🎨 new return type: RequestSerialized

* 🎨 optimise imports

* 🎨

* 🎨 add space in query_param checks

* ✨ new script to remove unnecessary validate_call decorators

* 🎨 new format for _response_types_map

* 🎨 new format for _response_types_map

* ➕ Add `aiohttp_retry` dependency

* ✨ new RESTClient has retry config!

* 🎨 refactor exceptions

* 🎨 typing

* 🎨 headers are now a Mapping

* ✨ Update ApiClient to latest; implements deserializing enums; drops our custom handling for booleans ... let's see if it still works 🚧

* version bump

* 🎨

* ⬆️ Upgrade `black` to latest

* ⬆️ Upgrade `pytest-mock` to latest

* 🐛 `disclosures` field can be str or Dict

* 🎨 attempt to reduce code duplication below sonarcloud quality gate threshold ...
  • Loading branch information
ff137 authored Apr 16, 2024
1 parent 964fa8f commit e04efa7
Show file tree
Hide file tree
Showing 324 changed files with 5,448 additions and 15,185 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
python -m pip install --upgrade pip
pip install \
isort~=5.13.2 \
black~=24.3.0
black~=24.4.0
- name: Check import style with isort
run: |
isort . --check --profile black --diff
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
python -m pip install --upgrade pip
pip install \
isort~=5.13.2 \
black~=24.3.0
black~=24.4.0
- name: Check import style with isort
run: |
isort . --check --profile black --diff
Expand Down
402 changes: 71 additions & 331 deletions aries_cloudcontroller/api/action_menu_api.py

Large diffs are not rendered by default.

90 changes: 15 additions & 75 deletions aries_cloudcontroller/api/basicmessage_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,12 @@
Do not edit the class manually.
""" # noqa: E501


from typing import Any, Dict, List, Optional, Tuple, Union

from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call

try:
from typing import Annotated
except ImportError:
from typing_extensions import Annotated

from typing import Any, Dict, Optional, Union

from pydantic import Field, StrictStr
from typing_extensions import Annotated

from aries_cloudcontroller.api_client import ApiClient
from aries_cloudcontroller.api_client import ApiClient, RequestSerialized
from aries_cloudcontroller.api_response import ApiResponse
from aries_cloudcontroller.models.send_message import SendMessage
from aries_cloudcontroller.rest import RESTResponseType
Expand Down Expand Up @@ -68,26 +58,7 @@ async def send_message(
:type conn_id: str
:param body:
:type body: SendMessage
: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

_param = self._send_message_serialize(
Expand All @@ -99,7 +70,9 @@ async def send_message(
_host_index=_host_index,
)

_response_types_map: Dict[str, Optional[str]] = {"200": "object"}
_response_types_map: Dict[str, Optional[str]] = {
"200": "object",
}
response_data = await self.api_client.call_api(
*_param, _request_timeout=_request_timeout
)
Expand Down Expand Up @@ -132,26 +105,7 @@ async def send_message_with_http_info(
:type conn_id: str
:param body:
:type body: SendMessage
: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

_param = self._send_message_serialize(
Expand All @@ -163,7 +117,9 @@ async def send_message_with_http_info(
_host_index=_host_index,
)

_response_types_map: Dict[str, Optional[str]] = {"200": "object"}
_response_types_map: Dict[str, Optional[str]] = {
"200": "object",
}
response_data = await self.api_client.call_api(
*_param, _request_timeout=_request_timeout
)
Expand Down Expand Up @@ -196,26 +152,7 @@ async def send_message_without_preload_content(
:type conn_id: str
:param body:
:type body: SendMessage
: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

_param = self._send_message_serialize(
Expand All @@ -227,7 +164,9 @@ async def send_message_without_preload_content(
_host_index=_host_index,
)

_response_types_map: Dict[str, Optional[str]] = {"200": "object"}
_response_types_map: Dict[str, Optional[str]] = {
"200": "object",
}
response_data = await self.api_client.call_api(
*_param, _request_timeout=_request_timeout
)
Expand All @@ -241,7 +180,8 @@ def _send_message_serialize(
_content_type,
_headers,
_host_index,
) -> Tuple:
) -> RequestSerialized:

_host = None

_collection_formats: Dict[str, str] = {}
Expand Down
Loading

0 comments on commit e04efa7

Please sign in to comment.