|
1 | 1 | from http import HTTPStatus |
2 | | -from typing import Any, Dict, Optional |
| 2 | +from typing import Any, Dict, Optional, Union |
3 | 3 |
|
4 | 4 | import httpx |
5 | 5 |
|
6 | 6 | from ... import errors |
7 | 7 | from ...client import Client |
8 | | -from ...types import UNSET, Response |
| 8 | +from ...types import UNSET, Response, Unset |
9 | 9 |
|
10 | 10 |
|
11 | 11 | def _get_kwargs( |
12 | 12 | path_param: str, |
13 | 13 | *, |
14 | 14 | client: Client, |
15 | | - string_param: str, |
16 | | - integer_param: int = 0, |
17 | | - header_param: str, |
18 | | - cookie_param: str, |
| 15 | + string_param: Union[Unset, None, str] = UNSET, |
| 16 | + integer_param: Union[Unset, None, int] = 0, |
| 17 | + header_param: Union[Unset, str] = UNSET, |
| 18 | + cookie_param: Union[Unset, str] = UNSET, |
19 | 19 | ) -> Dict[str, Any]: |
20 | 20 | url = "{}/parameter-references/{path_param}".format(client.base_url, path_param=path_param) |
21 | 21 |
|
22 | 22 | headers: Dict[str, str] = client.get_headers() |
23 | 23 | cookies: Dict[str, Any] = client.get_cookies() |
24 | 24 |
|
25 | | - headers["header param"] = header_param |
| 25 | + if not isinstance(header_param, Unset): |
| 26 | + headers["header param"] = header_param |
26 | 27 |
|
27 | | - cookies["cookie param"] = cookie_param |
| 28 | + if cookie_param is not UNSET: |
| 29 | + cookies["cookie param"] = cookie_param |
28 | 30 |
|
29 | 31 | params: Dict[str, Any] = {} |
30 | 32 | params["string param"] = string_param |
@@ -65,19 +67,19 @@ def sync_detailed( |
65 | 67 | path_param: str, |
66 | 68 | *, |
67 | 69 | client: Client, |
68 | | - string_param: str, |
69 | | - integer_param: int = 0, |
70 | | - header_param: str, |
71 | | - cookie_param: str, |
| 70 | + string_param: Union[Unset, None, str] = UNSET, |
| 71 | + integer_param: Union[Unset, None, int] = 0, |
| 72 | + header_param: Union[Unset, str] = UNSET, |
| 73 | + cookie_param: Union[Unset, str] = UNSET, |
72 | 74 | ) -> Response[Any]: |
73 | 75 | """Test different types of parameter references |
74 | 76 |
|
75 | 77 | Args: |
76 | 78 | path_param (str): |
77 | | - string_param (str): |
78 | | - integer_param (int): |
79 | | - header_param (str): |
80 | | - cookie_param (str): |
| 79 | + string_param (Union[Unset, None, str]): |
| 80 | + integer_param (Union[Unset, None, int]): |
| 81 | + header_param (Union[Unset, str]): |
| 82 | + cookie_param (Union[Unset, str]): |
81 | 83 |
|
82 | 84 | Raises: |
83 | 85 | errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
@@ -108,19 +110,19 @@ async def asyncio_detailed( |
108 | 110 | path_param: str, |
109 | 111 | *, |
110 | 112 | client: Client, |
111 | | - string_param: str, |
112 | | - integer_param: int = 0, |
113 | | - header_param: str, |
114 | | - cookie_param: str, |
| 113 | + string_param: Union[Unset, None, str] = UNSET, |
| 114 | + integer_param: Union[Unset, None, int] = 0, |
| 115 | + header_param: Union[Unset, str] = UNSET, |
| 116 | + cookie_param: Union[Unset, str] = UNSET, |
115 | 117 | ) -> Response[Any]: |
116 | 118 | """Test different types of parameter references |
117 | 119 |
|
118 | 120 | Args: |
119 | 121 | path_param (str): |
120 | | - string_param (str): |
121 | | - integer_param (int): |
122 | | - header_param (str): |
123 | | - cookie_param (str): |
| 122 | + string_param (Union[Unset, None, str]): |
| 123 | + integer_param (Union[Unset, None, int]): |
| 124 | + header_param (Union[Unset, str]): |
| 125 | + cookie_param (Union[Unset, str]): |
124 | 126 |
|
125 | 127 | Raises: |
126 | 128 | errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. |
|
0 commit comments