Skip to content

Commit 1b34880

Browse files
authored
Merge branch 'main' into fix-callback-import-refs
2 parents 729c354 + 227bc5e commit 1b34880

File tree

18 files changed

+406
-63
lines changed

18 files changed

+406
-63
lines changed

.github/workflows/release-dry-run.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,8 @@ jobs:
1313
with:
1414
fetch-depth: 0
1515
token: ${{ secrets.PAT }}
16-
- uses: actions-rs/toolchain@v1
17-
with:
18-
profile: minimal
19-
toolchain: stable
20-
- uses: Swatinem/rust-cache@v1
2116
- name: Install Knope
22-
uses: actions-rs/cargo@v1
17+
uses: knope-dev/action@v1
2318
with:
24-
command: install
25-
args: knope
19+
version: 0.4.3
2620
- run: knope release --dry-run

.github/workflows/release.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,10 @@ jobs:
1717
git_user_signingkey: true
1818
git_commit_gpgsign: true
1919
git_push_gpgsign: false
20-
- uses: actions-rs/toolchain@v1
21-
with:
22-
profile: minimal
23-
toolchain: stable
24-
- uses: Swatinem/rust-cache@v1
2520
- name: Install Knope
26-
uses: actions-rs/cargo@v1
21+
uses: knope-dev/action@v1
2722
with:
28-
command: install
29-
args: knope
23+
version: 0.4.3
3024
- name: Bump Version & Create GitHub Release
3125
run: knope release
3226
env:

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
## Creating a Pull Request
3434

35-
Once you've written the code and run the checks, the next step is to create a pull request against the `main` branch of this repository. This repository uses [conventional commits] squashed on each PR, then uses [Dobby] to auto-generate CHANGELOG.md entries for release. So the title of your PR should be in the format of a conventional commit written in plain english as it will end up in the CHANGELOG. Some example PR titles:
35+
Once you've written the code and run the checks, the next step is to create a pull request against the `main` branch of this repository. This repository uses [conventional commits] squashed on each PR, then uses [Knope] to auto-generate CHANGELOG.md entries for release. So the title of your PR should be in the format of a conventional commit written in plain english as it will end up in the CHANGELOG. Some example PR titles:
3636

3737
- feat: Support for `allOf` in OpenAPI documents (closes #123).
3838
- refactor!: Removed support for Python 3.5
@@ -45,4 +45,4 @@ Once your PR is created, a series of automated checks should run. If any of them
4545
As soon as possible, your PR will be reviewed. If there are any changes requested there will likely be a bit of back and forth. Once this process is done, your changes will be merged into main and included in the next release. If you need your changes available on PyPI by a certain time, please mention it in the PR, and we'll do our best to accommodate.
4646

4747
[Conventional Commits]: https://www.conventionalcommits.org/en/v1.0.0/
48-
[Dobby]: https://triaxtec.github.io/dobby/introduction.html
48+
[Knope]: https://knope-dev.github.io/knope/

end_to_end_tests/custom-templates-golden-record/my_test_api_client/api/tests/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
no_response_tests_no_response_get,
1515
octet_stream_tests_octet_stream_get,
1616
post_form_data,
17+
post_form_data_inline,
1718
post_tests_json_body_string,
1819
test_inline_objects,
1920
token_with_cookie_auth_token_with_cookie_get,
@@ -66,6 +67,13 @@ def post_form_data(cls) -> types.ModuleType:
6667
"""
6768
return post_form_data
6869

70+
@classmethod
71+
def post_form_data_inline(cls) -> types.ModuleType:
72+
"""
73+
Post form data (inline schema)
74+
"""
75+
return post_form_data_inline
76+
6977
@classmethod
7078
def upload_file_tests_upload_post(cls) -> types.ModuleType:
7179
"""

end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_header_types.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import httpx
44

55
from ...client import Client
6+
from ...models.get_location_header_types_int_enum_header import GetLocationHeaderTypesIntEnumHeader
7+
from ...models.get_location_header_types_string_enum_header import GetLocationHeaderTypesStringEnumHeader
68
from ...types import UNSET, Response, Unset
79

810

@@ -13,6 +15,8 @@ def _get_kwargs(
1315
string_header: Union[Unset, str] = UNSET,
1416
number_header: Union[Unset, float] = UNSET,
1517
integer_header: Union[Unset, int] = UNSET,
18+
int_enum_header: Union[Unset, GetLocationHeaderTypesIntEnumHeader] = UNSET,
19+
string_enum_header: Union[Unset, GetLocationHeaderTypesStringEnumHeader] = UNSET,
1620
) -> Dict[str, Any]:
1721
url = "{}/location/header/types".format(client.base_url)
1822

@@ -31,6 +35,12 @@ def _get_kwargs(
3135
if not isinstance(integer_header, Unset):
3236
headers["Integer-Header"] = str(integer_header)
3337

38+
if not isinstance(int_enum_header, Unset):
39+
headers["Int-Enum-Header"] = str(int_enum_header)
40+
41+
if not isinstance(string_enum_header, Unset):
42+
headers["String-Enum-Header"] = str(string_enum_header)
43+
3444
return {
3545
"method": "get",
3646
"url": url,
@@ -56,13 +66,17 @@ def sync_detailed(
5666
string_header: Union[Unset, str] = UNSET,
5767
number_header: Union[Unset, float] = UNSET,
5868
integer_header: Union[Unset, int] = UNSET,
69+
int_enum_header: Union[Unset, GetLocationHeaderTypesIntEnumHeader] = UNSET,
70+
string_enum_header: Union[Unset, GetLocationHeaderTypesStringEnumHeader] = UNSET,
5971
) -> Response[Any]:
6072
"""
6173
Args:
6274
boolean_header (Union[Unset, bool]):
6375
string_header (Union[Unset, str]):
6476
number_header (Union[Unset, float]):
6577
integer_header (Union[Unset, int]):
78+
int_enum_header (Union[Unset, GetLocationHeaderTypesIntEnumHeader]):
79+
string_enum_header (Union[Unset, GetLocationHeaderTypesStringEnumHeader]):
6680
6781
Returns:
6882
Response[Any]
@@ -74,6 +88,8 @@ def sync_detailed(
7488
string_header=string_header,
7589
number_header=number_header,
7690
integer_header=integer_header,
91+
int_enum_header=int_enum_header,
92+
string_enum_header=string_enum_header,
7793
)
7894

7995
response = httpx.request(
@@ -91,13 +107,17 @@ async def asyncio_detailed(
91107
string_header: Union[Unset, str] = UNSET,
92108
number_header: Union[Unset, float] = UNSET,
93109
integer_header: Union[Unset, int] = UNSET,
110+
int_enum_header: Union[Unset, GetLocationHeaderTypesIntEnumHeader] = UNSET,
111+
string_enum_header: Union[Unset, GetLocationHeaderTypesStringEnumHeader] = UNSET,
94112
) -> Response[Any]:
95113
"""
96114
Args:
97115
boolean_header (Union[Unset, bool]):
98116
string_header (Union[Unset, str]):
99117
number_header (Union[Unset, float]):
100118
integer_header (Union[Unset, int]):
119+
int_enum_header (Union[Unset, GetLocationHeaderTypesIntEnumHeader]):
120+
string_enum_header (Union[Unset, GetLocationHeaderTypesStringEnumHeader]):
101121
102122
Returns:
103123
Response[Any]
@@ -109,6 +129,8 @@ async def asyncio_detailed(
109129
string_header=string_header,
110130
number_header=number_header,
111131
integer_header=integer_header,
132+
int_enum_header=int_enum_header,
133+
string_enum_header=string_enum_header,
112134
)
113135

114136
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:

end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def sync_detailed(
4141
client: Client,
4242
form_data: AFormData,
4343
) -> Response[Any]:
44-
"""Post from data
44+
"""Post form data
4545
4646
Post form data
4747
@@ -67,7 +67,7 @@ async def asyncio_detailed(
6767
client: Client,
6868
form_data: AFormData,
6969
) -> Response[Any]:
70-
"""Post from data
70+
"""Post form data
7171
7272
Post form data
7373
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
from typing import Any, Dict
2+
3+
import httpx
4+
5+
from ...client import Client
6+
from ...models.post_form_data_inline_data import PostFormDataInlineData
7+
from ...types import Response
8+
9+
10+
def _get_kwargs(
11+
*,
12+
client: Client,
13+
form_data: PostFormDataInlineData,
14+
) -> Dict[str, Any]:
15+
url = "{}/tests/post_form_data_inline".format(client.base_url)
16+
17+
headers: Dict[str, str] = client.get_headers()
18+
cookies: Dict[str, Any] = client.get_cookies()
19+
20+
return {
21+
"method": "post",
22+
"url": url,
23+
"headers": headers,
24+
"cookies": cookies,
25+
"timeout": client.get_timeout(),
26+
"data": form_data.to_dict(),
27+
}
28+
29+
30+
def _build_response(*, response: httpx.Response) -> Response[Any]:
31+
return Response(
32+
status_code=response.status_code,
33+
content=response.content,
34+
headers=response.headers,
35+
parsed=None,
36+
)
37+
38+
39+
def sync_detailed(
40+
*,
41+
client: Client,
42+
form_data: PostFormDataInlineData,
43+
) -> Response[Any]:
44+
"""Post form data (inline schema)
45+
46+
Post form data (inline schema)
47+
48+
Returns:
49+
Response[Any]
50+
"""
51+
52+
kwargs = _get_kwargs(
53+
client=client,
54+
form_data=form_data,
55+
)
56+
57+
response = httpx.request(
58+
verify=client.verify_ssl,
59+
**kwargs,
60+
)
61+
62+
return _build_response(response=response)
63+
64+
65+
async def asyncio_detailed(
66+
*,
67+
client: Client,
68+
form_data: PostFormDataInlineData,
69+
) -> Response[Any]:
70+
"""Post form data (inline schema)
71+
72+
Post form data (inline schema)
73+
74+
Returns:
75+
Response[Any]
76+
"""
77+
78+
kwargs = _get_kwargs(
79+
client=client,
80+
form_data=form_data,
81+
)
82+
83+
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
84+
response = await _client.request(**kwargs)
85+
86+
return _build_response(response=response)

end_to_end_tests/golden-record/my_test_api_client/models/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
from .body_upload_file_tests_upload_post_some_optional_object import BodyUploadFileTestsUploadPostSomeOptionalObject
2020
from .different_enum import DifferentEnum
2121
from .free_form_model import FreeFormModel
22+
from .get_location_header_types_int_enum_header import GetLocationHeaderTypesIntEnumHeader
23+
from .get_location_header_types_string_enum_header import GetLocationHeaderTypesStringEnumHeader
2224
from .http_validation_error import HTTPValidationError
2325
from .import_ import Import
2426
from .model_from_all_of import ModelFromAllOf
@@ -40,6 +42,7 @@
4042
from .model_with_union_property_inlined_fruit_type_0 import ModelWithUnionPropertyInlinedFruitType0
4143
from .model_with_union_property_inlined_fruit_type_1 import ModelWithUnionPropertyInlinedFruitType1
4244
from .none import None_
45+
from .post_form_data_inline_data import PostFormDataInlineData
4346
from .post_responses_unions_simple_before_complex_response_200 import PostResponsesUnionsSimpleBeforeComplexResponse200
4447
from .post_responses_unions_simple_before_complex_response_200a_type_1 import (
4548
PostResponsesUnionsSimpleBeforeComplexResponse200AType1,
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from enum import IntEnum
2+
3+
4+
class GetLocationHeaderTypesIntEnumHeader(IntEnum):
5+
VALUE_1 = 1
6+
VALUE_2 = 2
7+
VALUE_3 = 3
8+
9+
def __str__(self) -> str:
10+
return str(self.value)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from enum import Enum
2+
3+
4+
class GetLocationHeaderTypesStringEnumHeader(str, Enum):
5+
ONE = "one"
6+
TWO = "two"
7+
THREE = "three"
8+
9+
def __str__(self) -> str:
10+
return str(self.value)
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
from typing import Any, Dict, List, Type, TypeVar, Union
2+
3+
import attr
4+
5+
from ..types import UNSET, Unset
6+
7+
T = TypeVar("T", bound="PostFormDataInlineData")
8+
9+
10+
@attr.s(auto_attribs=True)
11+
class PostFormDataInlineData:
12+
"""
13+
Attributes:
14+
a_required_field (str):
15+
an_optional_field (Union[Unset, str]):
16+
"""
17+
18+
a_required_field: str
19+
an_optional_field: Union[Unset, str] = UNSET
20+
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
21+
22+
def to_dict(self) -> Dict[str, Any]:
23+
a_required_field = self.a_required_field
24+
an_optional_field = self.an_optional_field
25+
26+
field_dict: Dict[str, Any] = {}
27+
field_dict.update(self.additional_properties)
28+
field_dict.update(
29+
{
30+
"a_required_field": a_required_field,
31+
}
32+
)
33+
if an_optional_field is not UNSET:
34+
field_dict["an_optional_field"] = an_optional_field
35+
36+
return field_dict
37+
38+
@classmethod
39+
def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
40+
d = src_dict.copy()
41+
a_required_field = d.pop("a_required_field")
42+
43+
an_optional_field = d.pop("an_optional_field", UNSET)
44+
45+
post_form_data_inline_data = cls(
46+
a_required_field=a_required_field,
47+
an_optional_field=an_optional_field,
48+
)
49+
50+
post_form_data_inline_data.additional_properties = d
51+
return post_form_data_inline_data
52+
53+
@property
54+
def additional_keys(self) -> List[str]:
55+
return list(self.additional_properties.keys())
56+
57+
def __getitem__(self, key: str) -> Any:
58+
return self.additional_properties[key]
59+
60+
def __setitem__(self, key: str, value: Any) -> None:
61+
self.additional_properties[key] = value
62+
63+
def __delitem__(self, key: str) -> None:
64+
del self.additional_properties[key]
65+
66+
def __contains__(self, key: str) -> bool:
67+
return key in self.additional_properties

0 commit comments

Comments
 (0)