Skip to content

Commit 08c985f

Browse files
asfaltboydbanty
andauthored
feat!: Change the Response.status_code type to the HTTPStatus enum [#665]
Co-authored-by: Dylan Anthony <[email protected]>
1 parent e2cb382 commit 08c985f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+124
-76
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## Setting up a Dev Environment
1010

1111
1. Make sure you have [Poetry](https://python-poetry.org/) installed and up to date.
12-
2. Make sure you have a supported Python version (e.g. 3.8) installed and accessible to Poetry (e.g. with [pyenv](https://github.com/pyenv/pyenv).
12+
2. Make sure you have a supported Python version (e.g. 3.8) installed and accessible to Poetry (e.g. with [pyenv](https://github.com/pyenv/pyenv)).
1313
3. Use `poetry install` in the project directory to create a virtual environment with the relevant dependencies.
1414
4. Enter a `poetry shell` to make running commands easier.
1515

end_to_end_tests/golden-record/my_test_api_client/api/default/get_common_parameters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from http import HTTPStatus
12
from typing import Any, Dict, Union
23

34
import httpx
@@ -33,7 +34,7 @@ def _get_kwargs(
3334

3435
def _build_response(*, response: httpx.Response) -> Response[Any]:
3536
return Response(
36-
status_code=response.status_code,
37+
status_code=HTTPStatus(response.status_code),
3738
content=response.content,
3839
headers=response.headers,
3940
parsed=None,

end_to_end_tests/golden-record/my_test_api_client/api/default/post_common_parameters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from http import HTTPStatus
12
from typing import Any, Dict, Union
23

34
import httpx
@@ -33,7 +34,7 @@ def _get_kwargs(
3334

3435
def _build_response(*, response: httpx.Response) -> Response[Any]:
3536
return Response(
36-
status_code=response.status_code,
37+
status_code=HTTPStatus(response.status_code),
3738
content=response.content,
3839
headers=response.headers,
3940
parsed=None,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from http import HTTPStatus
12
from typing import Any, Dict, Union
23

34
import httpx
@@ -52,7 +53,7 @@ def _get_kwargs(
5253

5354
def _build_response(*, response: httpx.Response) -> Response[Any]:
5455
return Response(
55-
status_code=response.status_code,
56+
status_code=HTTPStatus(response.status_code),
5657
content=response.content,
5758
headers=response.headers,
5859
parsed=None,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import datetime
2+
from http import HTTPStatus
23
from typing import Any, Dict, Union
34

45
import httpx
@@ -57,7 +58,7 @@ def _get_kwargs(
5758

5859
def _build_response(*, response: httpx.Response) -> Response[Any]:
5960
return Response(
60-
status_code=response.status_code,
61+
status_code=HTTPStatus(response.status_code),
6162
content=response.content,
6263
headers=response.headers,
6364
parsed=None,

end_to_end_tests/golden-record/my_test_api_client/api/parameter_references/get_parameter_references_path_param.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from http import HTTPStatus
12
from typing import Any, Dict
23

34
import httpx
@@ -43,7 +44,7 @@ def _get_kwargs(
4344

4445
def _build_response(*, response: httpx.Response) -> Response[Any]:
4546
return Response(
46-
status_code=response.status_code,
47+
status_code=HTTPStatus(response.status_code),
4748
content=response.content,
4849
headers=response.headers,
4950
parsed=None,

end_to_end_tests/golden-record/my_test_api_client/api/parameters/delete_common_parameters_overriding_param.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from http import HTTPStatus
12
from typing import Any, Dict, Union
23

34
import httpx
@@ -34,7 +35,7 @@ def _get_kwargs(
3435

3536
def _build_response(*, response: httpx.Response) -> Response[Any]:
3637
return Response(
37-
status_code=response.status_code,
38+
status_code=HTTPStatus(response.status_code),
3839
content=response.content,
3940
headers=response.headers,
4041
parsed=None,

end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_common_parameters_overriding_param.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from http import HTTPStatus
12
from typing import Any, Dict
23

34
import httpx
@@ -34,7 +35,7 @@ def _get_kwargs(
3435

3536
def _build_response(*, response: httpx.Response) -> Response[Any]:
3637
return Response(
37-
status_code=response.status_code,
38+
status_code=HTTPStatus(response.status_code),
3839
content=response.content,
3940
headers=response.headers,
4041
parsed=None,

end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_same_name_multiple_locations_param.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from http import HTTPStatus
12
from typing import Any, Dict, Union
23

34
import httpx
@@ -42,7 +43,7 @@ def _get_kwargs(
4243

4344
def _build_response(*, response: httpx.Response) -> Response[Any]:
4445
return Response(
45-
status_code=response.status_code,
46+
status_code=HTTPStatus(response.status_code),
4647
content=response.content,
4748
headers=response.headers,
4849
parsed=None,

end_to_end_tests/golden-record/my_test_api_client/api/parameters/multiple_path_parameters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from http import HTTPStatus
12
from typing import Any, Dict
23

34
import httpx
@@ -32,7 +33,7 @@ def _get_kwargs(
3233

3334
def _build_response(*, response: httpx.Response) -> Response[Any]:
3435
return Response(
35-
status_code=response.status_code,
36+
status_code=HTTPStatus(response.status_code),
3637
content=response.content,
3738
headers=response.headers,
3839
parsed=None,

0 commit comments

Comments
 (0)