Skip to content

Commit 7c53528

Browse files
committed
Work on honeydew
1 parent e795375 commit 7c53528

45 files changed

Lines changed: 1322 additions & 300 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
from http import HTTPStatus
2+
from typing import Any
3+
4+
import httpx
5+
6+
from ... import errors
7+
from ...client import AuthenticatedClient, Client
8+
from ...models.error_response import ErrorResponse
9+
from ...models.todo_task_load_public_args import TodoTaskLoadPublicArgs
10+
from ...models.todo_task_load_result import TodoTaskLoadResult
11+
from ...types import UNSET, Response, Unset
12+
13+
14+
def _get_kwargs(
15+
*,
16+
body: TodoTaskLoadPublicArgs | Unset = UNSET,
17+
) -> dict[str, Any]:
18+
headers: dict[str, Any] = {}
19+
20+
_kwargs: dict[str, Any] = {
21+
"method": "post",
22+
"url": "/todo-task-load-public",
23+
}
24+
25+
if not isinstance(body, Unset):
26+
_kwargs["json"] = body.to_dict()
27+
28+
headers["Content-Type"] = "application/json"
29+
30+
_kwargs["headers"] = headers
31+
return _kwargs
32+
33+
34+
def _parse_response(
35+
*, client: AuthenticatedClient | Client, response: httpx.Response
36+
) -> ErrorResponse | TodoTaskLoadResult | None:
37+
if response.status_code == 200:
38+
response_200 = TodoTaskLoadResult.from_dict(response.json())
39+
40+
return response_200
41+
42+
if response.status_code == 400:
43+
response_400 = ErrorResponse.from_dict(response.json())
44+
45+
return response_400
46+
47+
if response.status_code == 401:
48+
response_401 = ErrorResponse.from_dict(response.json())
49+
50+
return response_401
51+
52+
if response.status_code == 404:
53+
response_404 = ErrorResponse.from_dict(response.json())
54+
55+
return response_404
56+
57+
if response.status_code == 406:
58+
response_406 = ErrorResponse.from_dict(response.json())
59+
60+
return response_406
61+
62+
if response.status_code == 409:
63+
response_409 = ErrorResponse.from_dict(response.json())
64+
65+
return response_409
66+
67+
if response.status_code == 410:
68+
response_410 = ErrorResponse.from_dict(response.json())
69+
70+
return response_410
71+
72+
if response.status_code == 422:
73+
response_422 = ErrorResponse.from_dict(response.json())
74+
75+
return response_422
76+
77+
if response.status_code == 426:
78+
response_426 = ErrorResponse.from_dict(response.json())
79+
80+
return response_426
81+
82+
if response.status_code == 429:
83+
response_429 = ErrorResponse.from_dict(response.json())
84+
85+
return response_429
86+
87+
if response.status_code == 502:
88+
response_502 = ErrorResponse.from_dict(response.json())
89+
90+
return response_502
91+
92+
if client.raise_on_unexpected_status:
93+
raise errors.UnexpectedStatus(response.status_code, response.content)
94+
else:
95+
return None
96+
97+
98+
def _build_response(
99+
*, client: AuthenticatedClient | Client, response: httpx.Response
100+
) -> Response[ErrorResponse | TodoTaskLoadResult]:
101+
return Response(
102+
status_code=HTTPStatus(response.status_code),
103+
content=response.content,
104+
headers=response.headers,
105+
parsed=_parse_response(client=client, response=response),
106+
)
107+
108+
109+
def sync_detailed(
110+
*,
111+
client: AuthenticatedClient | Client,
112+
body: TodoTaskLoadPublicArgs | Unset = UNSET,
113+
) -> Response[ErrorResponse | TodoTaskLoadResult]:
114+
"""Load a published todo task and its dependent entities by publish external id.
115+
116+
Args:
117+
body (TodoTaskLoadPublicArgs | Unset): TodoTaskLoadPublic args.
118+
119+
Raises:
120+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
121+
httpx.TimeoutException: If the request takes longer than Client.timeout.
122+
123+
Returns:
124+
Response[ErrorResponse | TodoTaskLoadResult]
125+
"""
126+
127+
kwargs = _get_kwargs(
128+
body=body,
129+
)
130+
131+
response = client.get_httpx_client().request(
132+
**kwargs,
133+
)
134+
135+
return _build_response(client=client, response=response)
136+
137+
138+
def sync(
139+
*,
140+
client: AuthenticatedClient | Client,
141+
body: TodoTaskLoadPublicArgs | Unset = UNSET,
142+
) -> ErrorResponse | TodoTaskLoadResult | None:
143+
"""Load a published todo task and its dependent entities by publish external id.
144+
145+
Args:
146+
body (TodoTaskLoadPublicArgs | Unset): TodoTaskLoadPublic args.
147+
148+
Raises:
149+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
150+
httpx.TimeoutException: If the request takes longer than Client.timeout.
151+
152+
Returns:
153+
ErrorResponse | TodoTaskLoadResult
154+
"""
155+
156+
return sync_detailed(
157+
client=client,
158+
body=body,
159+
).parsed
160+
161+
162+
async def asyncio_detailed(
163+
*,
164+
client: AuthenticatedClient | Client,
165+
body: TodoTaskLoadPublicArgs | Unset = UNSET,
166+
) -> Response[ErrorResponse | TodoTaskLoadResult]:
167+
"""Load a published todo task and its dependent entities by publish external id.
168+
169+
Args:
170+
body (TodoTaskLoadPublicArgs | Unset): TodoTaskLoadPublic args.
171+
172+
Raises:
173+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
174+
httpx.TimeoutException: If the request takes longer than Client.timeout.
175+
176+
Returns:
177+
Response[ErrorResponse | TodoTaskLoadResult]
178+
"""
179+
180+
kwargs = _get_kwargs(
181+
body=body,
182+
)
183+
184+
response = await client.get_async_httpx_client().request(**kwargs)
185+
186+
return _build_response(client=client, response=response)
187+
188+
189+
async def asyncio(
190+
*,
191+
client: AuthenticatedClient | Client,
192+
body: TodoTaskLoadPublicArgs | Unset = UNSET,
193+
) -> ErrorResponse | TodoTaskLoadResult | None:
194+
"""Load a published todo task and its dependent entities by publish external id.
195+
196+
Args:
197+
body (TodoTaskLoadPublicArgs | Unset): TodoTaskLoadPublic args.
198+
199+
Raises:
200+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
201+
httpx.TimeoutException: If the request takes longer than Client.timeout.
202+
203+
Returns:
204+
ErrorResponse | TodoTaskLoadResult
205+
"""
206+
207+
return (
208+
await asyncio_detailed(
209+
client=client,
210+
body=body,
211+
)
212+
).parsed

gen/py/webapi-client/jupiter_webapi_client/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,7 @@
914914
from .todo_task_find_result import TodoTaskFindResult
915915
from .todo_task_find_result_entry import TodoTaskFindResultEntry
916916
from .todo_task_load_args import TodoTaskLoadArgs
917+
from .todo_task_load_public_args import TodoTaskLoadPublicArgs
917918
from .todo_task_load_result import TodoTaskLoadResult
918919
from .todo_task_remove_args import TodoTaskRemoveArgs
919920
from .todo_task_summary import TodoTaskSummary
@@ -1900,6 +1901,7 @@
19001901
"TodoTaskFindResult",
19011902
"TodoTaskFindResultEntry",
19021903
"TodoTaskLoadArgs",
1904+
"TodoTaskLoadPublicArgs",
19031905
"TodoTaskLoadResult",
19041906
"TodoTaskRemoveArgs",
19051907
"TodoTaskSummary",

gen/py/webapi-client/jupiter_webapi_client/models/publish_entity.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ class PublishEntity:
2424
last_modified_time (str): A timestamp in the application.
2525
name (str): The name of a publish entity.
2626
publish_domain_ref_id (str):
27-
entity_type (str):
28-
entity_ref_id (str): A generic entity id.
27+
owner (str): A reference combining an entity kind, a purpose, and an entity id.
2928
external_id (str): A GUID external id for a publish entity.
3029
status (PublishEntityStatus): The status of a publish entity.
3130
archival_reason (None | str | Unset):
@@ -39,8 +38,7 @@ class PublishEntity:
3938
last_modified_time: str
4039
name: str
4140
publish_domain_ref_id: str
42-
entity_type: str
43-
entity_ref_id: str
41+
owner: str
4442
external_id: str
4543
status: PublishEntityStatus
4644
archival_reason: None | str | Unset = UNSET
@@ -62,9 +60,7 @@ def to_dict(self) -> dict[str, Any]:
6260

6361
publish_domain_ref_id = self.publish_domain_ref_id
6462

65-
entity_type = self.entity_type
66-
67-
entity_ref_id = self.entity_ref_id
63+
owner = self.owner
6864

6965
external_id = self.external_id
7066

@@ -93,8 +89,7 @@ def to_dict(self) -> dict[str, Any]:
9389
"last_modified_time": last_modified_time,
9490
"name": name,
9591
"publish_domain_ref_id": publish_domain_ref_id,
96-
"entity_type": entity_type,
97-
"entity_ref_id": entity_ref_id,
92+
"owner": owner,
9893
"external_id": external_id,
9994
"status": status,
10095
}
@@ -123,9 +118,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
123118

124119
publish_domain_ref_id = d.pop("publish_domain_ref_id")
125120

126-
entity_type = d.pop("entity_type")
127-
128-
entity_ref_id = d.pop("entity_ref_id")
121+
owner = d.pop("owner")
129122

130123
external_id = d.pop("external_id")
131124

@@ -157,8 +150,7 @@ def _parse_archived_time(data: object) -> None | str | Unset:
157150
last_modified_time=last_modified_time,
158151
name=name,
159152
publish_domain_ref_id=publish_domain_ref_id,
160-
entity_type=entity_type,
161-
entity_ref_id=entity_ref_id,
153+
owner=owner,
162154
external_id=external_id,
163155
status=status,
164156
archival_reason=archival_reason,

gen/py/webapi-client/jupiter_webapi_client/models/publish_entity_create_args.py

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,20 @@ class PublishEntityCreateArgs:
1414
"""PublishEntityCreate args.
1515
1616
Attributes:
17-
name (str): The name of a publish entity.
18-
entity_type (str):
19-
entity_ref_id (str): A generic entity id.
17+
owner (str): A reference combining an entity kind, a purpose, and an entity id.
2018
"""
2119

22-
name: str
23-
entity_type: str
24-
entity_ref_id: str
20+
owner: str
2521
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
2622

2723
def to_dict(self) -> dict[str, Any]:
28-
name = self.name
29-
30-
entity_type = self.entity_type
31-
32-
entity_ref_id = self.entity_ref_id
24+
owner = self.owner
3325

3426
field_dict: dict[str, Any] = {}
3527
field_dict.update(self.additional_properties)
3628
field_dict.update(
3729
{
38-
"name": name,
39-
"entity_type": entity_type,
40-
"entity_ref_id": entity_ref_id,
30+
"owner": owner,
4131
}
4232
)
4333

@@ -46,16 +36,10 @@ def to_dict(self) -> dict[str, Any]:
4636
@classmethod
4737
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
4838
d = dict(src_dict)
49-
name = d.pop("name")
50-
51-
entity_type = d.pop("entity_type")
52-
53-
entity_ref_id = d.pop("entity_ref_id")
39+
owner = d.pop("owner")
5440

5541
publish_entity_create_args = cls(
56-
name=name,
57-
entity_type=entity_type,
58-
entity_ref_id=entity_ref_id,
42+
owner=owner,
5943
)
6044

6145
publish_entity_create_args.additional_properties = d

0 commit comments

Comments
 (0)