Skip to content

Commit 0701b94

Browse files
committed
Add missing generated files
1 parent 3462461 commit 0701b94

File tree

2 files changed

+153
-0
lines changed

2 files changed

+153
-0
lines changed

end_to_end_tests/golden-record/my_test_api_client/api/naming/__init__.py

Whitespace-only changes.
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
from http import HTTPStatus
2+
from typing import Any, Dict, Optional, Union
3+
4+
import httpx
5+
6+
from ... import errors
7+
from ...client import AuthenticatedClient, Client
8+
from ...models.post_naming_property_conflict_with_import_json_body import PostNamingPropertyConflictWithImportJsonBody
9+
from ...models.post_naming_property_conflict_with_import_response_200 import (
10+
PostNamingPropertyConflictWithImportResponse200,
11+
)
12+
from ...types import Response
13+
14+
15+
def _get_kwargs(
16+
*,
17+
json_body: PostNamingPropertyConflictWithImportJsonBody,
18+
) -> Dict[str, Any]:
19+
pass
20+
21+
json_json_body = json_body.to_dict()
22+
23+
return {
24+
"method": "post",
25+
"url": "/naming/property-conflict-with-import",
26+
"json": json_json_body,
27+
}
28+
29+
30+
def _parse_response(
31+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
32+
) -> Optional[PostNamingPropertyConflictWithImportResponse200]:
33+
if response.status_code == HTTPStatus.OK:
34+
response_200 = PostNamingPropertyConflictWithImportResponse200.from_dict(response.json())
35+
36+
return response_200
37+
if client.raise_on_unexpected_status:
38+
raise errors.UnexpectedStatus(response.status_code, response.content)
39+
else:
40+
return None
41+
42+
43+
def _build_response(
44+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
45+
) -> Response[PostNamingPropertyConflictWithImportResponse200]:
46+
return Response(
47+
status_code=HTTPStatus(response.status_code),
48+
content=response.content,
49+
headers=response.headers,
50+
parsed=_parse_response(client=client, response=response),
51+
)
52+
53+
54+
def sync_detailed(
55+
*,
56+
client: Union[AuthenticatedClient, Client],
57+
json_body: PostNamingPropertyConflictWithImportJsonBody,
58+
) -> Response[PostNamingPropertyConflictWithImportResponse200]:
59+
"""
60+
Args:
61+
json_body (PostNamingPropertyConflictWithImportJsonBody):
62+
63+
Raises:
64+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
65+
httpx.TimeoutException: If the request takes longer than Client.timeout.
66+
67+
Returns:
68+
Response[PostNamingPropertyConflictWithImportResponse200]
69+
"""
70+
71+
kwargs = _get_kwargs(
72+
json_body=json_body,
73+
)
74+
75+
response = client.get_httpx_client().request(
76+
**kwargs,
77+
)
78+
79+
return _build_response(client=client, response=response)
80+
81+
82+
def sync(
83+
*,
84+
client: Union[AuthenticatedClient, Client],
85+
json_body: PostNamingPropertyConflictWithImportJsonBody,
86+
) -> Optional[PostNamingPropertyConflictWithImportResponse200]:
87+
"""
88+
Args:
89+
json_body (PostNamingPropertyConflictWithImportJsonBody):
90+
91+
Raises:
92+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
93+
httpx.TimeoutException: If the request takes longer than Client.timeout.
94+
95+
Returns:
96+
PostNamingPropertyConflictWithImportResponse200
97+
"""
98+
99+
return sync_detailed(
100+
client=client,
101+
json_body=json_body,
102+
).parsed
103+
104+
105+
async def asyncio_detailed(
106+
*,
107+
client: Union[AuthenticatedClient, Client],
108+
json_body: PostNamingPropertyConflictWithImportJsonBody,
109+
) -> Response[PostNamingPropertyConflictWithImportResponse200]:
110+
"""
111+
Args:
112+
json_body (PostNamingPropertyConflictWithImportJsonBody):
113+
114+
Raises:
115+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
116+
httpx.TimeoutException: If the request takes longer than Client.timeout.
117+
118+
Returns:
119+
Response[PostNamingPropertyConflictWithImportResponse200]
120+
"""
121+
122+
kwargs = _get_kwargs(
123+
json_body=json_body,
124+
)
125+
126+
response = await client.get_async_httpx_client().request(**kwargs)
127+
128+
return _build_response(client=client, response=response)
129+
130+
131+
async def asyncio(
132+
*,
133+
client: Union[AuthenticatedClient, Client],
134+
json_body: PostNamingPropertyConflictWithImportJsonBody,
135+
) -> Optional[PostNamingPropertyConflictWithImportResponse200]:
136+
"""
137+
Args:
138+
json_body (PostNamingPropertyConflictWithImportJsonBody):
139+
140+
Raises:
141+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
142+
httpx.TimeoutException: If the request takes longer than Client.timeout.
143+
144+
Returns:
145+
PostNamingPropertyConflictWithImportResponse200
146+
"""
147+
148+
return (
149+
await asyncio_detailed(
150+
client=client,
151+
json_body=json_body,
152+
)
153+
).parsed

0 commit comments

Comments
 (0)