Skip to content

Commit 24e80f4

Browse files
Update api spec (#435)
* YOYO NEW API SPEC! * I have generated the latest API! --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 1744ab6 commit 24e80f4

16 files changed

+2653
-1097
lines changed

kittycad.py.patch.json

Lines changed: 436 additions & 404 deletions
Large diffs are not rendered by default.

kittycad/api/users/patch_user_crm.py

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
from typing import Any, Dict, Optional
2+
3+
import httpx
4+
5+
from ...client import Client
6+
from ...models.crm_data import CrmData
7+
from ...models.error import Error
8+
from ...types import Response
9+
10+
11+
def _get_kwargs(
12+
body: CrmData,
13+
*,
14+
client: Client,
15+
) -> Dict[str, Any]:
16+
url = "{}/user/crm".format(
17+
client.base_url,
18+
) # noqa: E501
19+
20+
headers: Dict[str, Any] = client.get_headers()
21+
cookies: Dict[str, Any] = client.get_cookies()
22+
23+
return {
24+
"url": url,
25+
"headers": headers,
26+
"cookies": cookies,
27+
"timeout": client.get_timeout(),
28+
"content": body.model_dump_json(),
29+
}
30+
31+
32+
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
33+
return None
34+
if response.status_code == 400:
35+
response_4XX = Error(**response.json())
36+
return response_4XX
37+
if response.status_code == 500:
38+
response_5XX = Error(**response.json())
39+
return response_5XX
40+
return Error(**response.json())
41+
42+
43+
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
44+
return Response(
45+
status_code=response.status_code,
46+
content=response.content,
47+
headers=response.headers,
48+
parsed=_parse_response(response=response),
49+
)
50+
51+
52+
def sync_detailed(
53+
body: CrmData,
54+
*,
55+
client: Client,
56+
) -> Response[Optional[Error]]:
57+
kwargs = _get_kwargs(
58+
body=body,
59+
client=client,
60+
)
61+
62+
response = httpx.patch(
63+
verify=client.verify_ssl,
64+
**kwargs,
65+
)
66+
67+
return _build_response(response=response)
68+
69+
70+
def sync(
71+
body: CrmData,
72+
*,
73+
client: Client,
74+
) -> Optional[Error]:
75+
return sync_detailed(
76+
body=body,
77+
client=client,
78+
).parsed
79+
80+
81+
async def asyncio_detailed(
82+
body: CrmData,
83+
*,
84+
client: Client,
85+
) -> Response[Optional[Error]]:
86+
kwargs = _get_kwargs(
87+
body=body,
88+
client=client,
89+
)
90+
91+
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
92+
response = await _client.patch(**kwargs)
93+
94+
return _build_response(response=response)
95+
96+
97+
async def asyncio(
98+
body: CrmData,
99+
*,
100+
client: Client,
101+
) -> Optional[Error]:
102+
return (
103+
await asyncio_detailed(
104+
body=body,
105+
client=client,
106+
)
107+
).parsed

kittycad/api/users/put_public_form.py

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
from typing import Any, Dict, Optional
2+
3+
import httpx
4+
5+
from ...client import Client
6+
from ...models.error import Error
7+
from ...models.inquiry_form import InquiryForm
8+
from ...types import Response
9+
10+
11+
def _get_kwargs(
12+
body: InquiryForm,
13+
*,
14+
client: Client,
15+
) -> Dict[str, Any]:
16+
url = "{}/website/form".format(
17+
client.base_url,
18+
) # noqa: E501
19+
20+
headers: Dict[str, Any] = client.get_headers()
21+
cookies: Dict[str, Any] = client.get_cookies()
22+
23+
return {
24+
"url": url,
25+
"headers": headers,
26+
"cookies": cookies,
27+
"timeout": client.get_timeout(),
28+
"content": body.model_dump_json(),
29+
}
30+
31+
32+
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
33+
return None
34+
if response.status_code == 400:
35+
response_4XX = Error(**response.json())
36+
return response_4XX
37+
if response.status_code == 500:
38+
response_5XX = Error(**response.json())
39+
return response_5XX
40+
return Error(**response.json())
41+
42+
43+
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
44+
return Response(
45+
status_code=response.status_code,
46+
content=response.content,
47+
headers=response.headers,
48+
parsed=_parse_response(response=response),
49+
)
50+
51+
52+
def sync_detailed(
53+
body: InquiryForm,
54+
*,
55+
client: Client,
56+
) -> Response[Optional[Error]]:
57+
kwargs = _get_kwargs(
58+
body=body,
59+
client=client,
60+
)
61+
62+
response = httpx.put(
63+
verify=client.verify_ssl,
64+
**kwargs,
65+
)
66+
67+
return _build_response(response=response)
68+
69+
70+
def sync(
71+
body: InquiryForm,
72+
*,
73+
client: Client,
74+
) -> Optional[Error]:
75+
"""users and is not authenticated.""" # noqa: E501
76+
77+
return sync_detailed(
78+
body=body,
79+
client=client,
80+
).parsed
81+
82+
83+
async def asyncio_detailed(
84+
body: InquiryForm,
85+
*,
86+
client: Client,
87+
) -> Response[Optional[Error]]:
88+
kwargs = _get_kwargs(
89+
body=body,
90+
client=client,
91+
)
92+
93+
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
94+
response = await _client.put(**kwargs)
95+
96+
return _build_response(response=response)
97+
98+
99+
async def asyncio(
100+
body: InquiryForm,
101+
*,
102+
client: Client,
103+
) -> Optional[Error]:
104+
"""users and is not authenticated.""" # noqa: E501
105+
106+
return (
107+
await asyncio_detailed(
108+
body=body,
109+
client=client,
110+
)
111+
).parsed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
from typing import Any, Dict, Optional
2+
3+
import httpx
4+
5+
from ...client import Client
6+
from ...models.error import Error
7+
from ...models.subscribe import Subscribe
8+
from ...types import Response
9+
10+
11+
def _get_kwargs(
12+
body: Subscribe,
13+
*,
14+
client: Client,
15+
) -> Dict[str, Any]:
16+
url = "{}/website/subscribe".format(
17+
client.base_url,
18+
) # noqa: E501
19+
20+
headers: Dict[str, Any] = client.get_headers()
21+
cookies: Dict[str, Any] = client.get_cookies()
22+
23+
return {
24+
"url": url,
25+
"headers": headers,
26+
"cookies": cookies,
27+
"timeout": client.get_timeout(),
28+
"content": body.model_dump_json(),
29+
}
30+
31+
32+
def _parse_response(*, response: httpx.Response) -> Optional[Error]:
33+
return None
34+
if response.status_code == 400:
35+
response_4XX = Error(**response.json())
36+
return response_4XX
37+
if response.status_code == 500:
38+
response_5XX = Error(**response.json())
39+
return response_5XX
40+
return Error(**response.json())
41+
42+
43+
def _build_response(*, response: httpx.Response) -> Response[Optional[Error]]:
44+
return Response(
45+
status_code=response.status_code,
46+
content=response.content,
47+
headers=response.headers,
48+
parsed=_parse_response(response=response),
49+
)
50+
51+
52+
def sync_detailed(
53+
body: Subscribe,
54+
*,
55+
client: Client,
56+
) -> Response[Optional[Error]]:
57+
kwargs = _get_kwargs(
58+
body=body,
59+
client=client,
60+
)
61+
62+
response = httpx.put(
63+
verify=client.verify_ssl,
64+
**kwargs,
65+
)
66+
67+
return _build_response(response=response)
68+
69+
70+
def sync(
71+
body: Subscribe,
72+
*,
73+
client: Client,
74+
) -> Optional[Error]:
75+
return sync_detailed(
76+
body=body,
77+
client=client,
78+
).parsed
79+
80+
81+
async def asyncio_detailed(
82+
body: Subscribe,
83+
*,
84+
client: Client,
85+
) -> Response[Optional[Error]]:
86+
kwargs = _get_kwargs(
87+
body=body,
88+
client=client,
89+
)
90+
91+
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
92+
response = await _client.put(**kwargs)
93+
94+
return _build_response(response=response)
95+
96+
97+
async def asyncio(
98+
body: Subscribe,
99+
*,
100+
client: Client,
101+
) -> Optional[Error]:
102+
return (
103+
await asyncio_detailed(
104+
body=body,
105+
client=client,
106+
)
107+
).parsed

0 commit comments

Comments
 (0)