Skip to content

Commit e4f0e12

Browse files
authored
[create-pull-request] automated change (#116)
Co-authored-by: yejiyang <[email protected]>
1 parent 7528ebc commit e4f0e12

18 files changed

+1176
-26
lines changed

field-manager-python-client/field_manager_python_client/api/organizations/create_web_map_service_organizations_organization_id_web_map_services_post.py renamed to field-manager-python-client/field_manager_python_client/api/organizations/create_web_map_service_organization_organizations_organization_id_web_map_services_post.py

File renamed without changes.

field-manager-python-client/field_manager_python_client/api/organizations/delete_web_map_service_organizations_organization_id_web_map_services_web_map_service_id_delete.py renamed to field-manager-python-client/field_manager_python_client/api/organizations/delete_web_map_service_organization_organizations_organization_id_web_map_services_web_map_service_id_delete.py

File renamed without changes.

field-manager-python-client/field_manager_python_client/api/projects/get_project_web_map_services_projects_project_id_web_map_services_get.py renamed to field-manager-python-client/field_manager_python_client/api/organizations/read_web_map_services_project_projects_project_id_web_map_services_get.py

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,32 @@
77
from ...client import AuthenticatedClient, Client
88
from ...models.http_validation_error import HTTPValidationError
99
from ...models.web_map_service import WebMapService
10-
from ...types import Response
10+
from ...models.web_map_service_level import WebMapServiceLevel
11+
from ...types import UNSET, Response, Unset
1112

1213

1314
def _get_kwargs(
1415
project_id: str,
16+
*,
17+
levels: Union[Unset, list[WebMapServiceLevel]] = UNSET,
1518
) -> dict[str, Any]:
19+
params: dict[str, Any] = {}
20+
21+
json_levels: Union[Unset, list[str]] = UNSET
22+
if not isinstance(levels, Unset):
23+
json_levels = []
24+
for levels_item_data in levels:
25+
levels_item = levels_item_data.value
26+
json_levels.append(levels_item)
27+
28+
params["levels"] = json_levels
29+
30+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
31+
1632
_kwargs: dict[str, Any] = {
1733
"method": "get",
1834
"url": f"/projects/{project_id}/web_map_services",
35+
"params": params,
1936
}
2037

2138
return _kwargs
@@ -58,13 +75,18 @@ def sync_detailed(
5875
project_id: str,
5976
*,
6077
client: AuthenticatedClient,
78+
levels: Union[Unset, list[WebMapServiceLevel]] = UNSET,
6179
) -> Response[Union[HTTPValidationError, list["WebMapService"]]]:
6280
"""Get Web Map Services by Project ID
6381
6482
Get Web Map Services by project_id.
6583
84+
You may optionally filter on levels and specify which levels to include.
85+
Not specifying any levels will return all levels you have access to.
86+
6687
Args:
6788
project_id (str):
89+
levels (Union[Unset, list[WebMapServiceLevel]]):
6890
6991
Raises:
7092
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -76,6 +98,7 @@ def sync_detailed(
7698

7799
kwargs = _get_kwargs(
78100
project_id=project_id,
101+
levels=levels,
79102
)
80103

81104
response = client.get_httpx_client().request(
@@ -89,13 +112,18 @@ def sync(
89112
project_id: str,
90113
*,
91114
client: AuthenticatedClient,
115+
levels: Union[Unset, list[WebMapServiceLevel]] = UNSET,
92116
) -> Optional[Union[HTTPValidationError, list["WebMapService"]]]:
93117
"""Get Web Map Services by Project ID
94118
95119
Get Web Map Services by project_id.
96120
121+
You may optionally filter on levels and specify which levels to include.
122+
Not specifying any levels will return all levels you have access to.
123+
97124
Args:
98125
project_id (str):
126+
levels (Union[Unset, list[WebMapServiceLevel]]):
99127
100128
Raises:
101129
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -108,20 +136,26 @@ def sync(
108136
return sync_detailed(
109137
project_id=project_id,
110138
client=client,
139+
levels=levels,
111140
).parsed
112141

113142

114143
async def asyncio_detailed(
115144
project_id: str,
116145
*,
117146
client: AuthenticatedClient,
147+
levels: Union[Unset, list[WebMapServiceLevel]] = UNSET,
118148
) -> Response[Union[HTTPValidationError, list["WebMapService"]]]:
119149
"""Get Web Map Services by Project ID
120150
121151
Get Web Map Services by project_id.
122152
153+
You may optionally filter on levels and specify which levels to include.
154+
Not specifying any levels will return all levels you have access to.
155+
123156
Args:
124157
project_id (str):
158+
levels (Union[Unset, list[WebMapServiceLevel]]):
125159
126160
Raises:
127161
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -133,6 +167,7 @@ async def asyncio_detailed(
133167

134168
kwargs = _get_kwargs(
135169
project_id=project_id,
170+
levels=levels,
136171
)
137172

138173
response = await client.get_async_httpx_client().request(**kwargs)
@@ -144,13 +179,18 @@ async def asyncio(
144179
project_id: str,
145180
*,
146181
client: AuthenticatedClient,
182+
levels: Union[Unset, list[WebMapServiceLevel]] = UNSET,
147183
) -> Optional[Union[HTTPValidationError, list["WebMapService"]]]:
148184
"""Get Web Map Services by Project ID
149185
150186
Get Web Map Services by project_id.
151187
188+
You may optionally filter on levels and specify which levels to include.
189+
Not specifying any levels will return all levels you have access to.
190+
152191
Args:
153192
project_id (str):
193+
levels (Union[Unset, list[WebMapServiceLevel]]):
154194
155195
Raises:
156196
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -164,5 +204,6 @@ async def asyncio(
164204
await asyncio_detailed(
165205
project_id=project_id,
166206
client=client,
207+
levels=levels,
167208
)
168209
).parsed

field-manager-python-client/field_manager_python_client/api/organizations/update_web_map_service_organizations_organization_id_web_map_services_web_map_service_id_put.py renamed to field-manager-python-client/field_manager_python_client/api/organizations/update_web_map_service_organization_organizations_organization_id_web_map_services_web_map_service_id_put.py

File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
from http import HTTPStatus
2+
from typing import Any, Optional, Union
3+
4+
import httpx
5+
6+
from ... import errors
7+
from ...client import AuthenticatedClient, Client
8+
from ...models.http_validation_error import HTTPValidationError
9+
from ...models.web_map_service import WebMapService
10+
from ...models.web_map_service_create import WebMapServiceCreate
11+
from ...types import Response
12+
13+
14+
def _get_kwargs(
15+
project_id: str,
16+
*,
17+
body: WebMapServiceCreate,
18+
) -> dict[str, Any]:
19+
headers: dict[str, Any] = {}
20+
21+
_kwargs: dict[str, Any] = {
22+
"method": "post",
23+
"url": f"/projects/{project_id}/web_map_services",
24+
}
25+
26+
_body = body.to_dict()
27+
28+
_kwargs["json"] = _body
29+
headers["Content-Type"] = "application/json"
30+
31+
_kwargs["headers"] = headers
32+
return _kwargs
33+
34+
35+
def _parse_response(
36+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
37+
) -> Optional[Union[HTTPValidationError, WebMapService]]:
38+
if response.status_code == 201:
39+
response_201 = WebMapService.from_dict(response.json())
40+
41+
return response_201
42+
if response.status_code == 422:
43+
response_422 = HTTPValidationError.from_dict(response.json())
44+
45+
return response_422
46+
if client.raise_on_unexpected_status:
47+
raise errors.UnexpectedStatus(response.status_code, response.content)
48+
else:
49+
return None
50+
51+
52+
def _build_response(
53+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
54+
) -> Response[Union[HTTPValidationError, WebMapService]]:
55+
return Response(
56+
status_code=HTTPStatus(response.status_code),
57+
content=response.content,
58+
headers=response.headers,
59+
parsed=_parse_response(client=client, response=response),
60+
)
61+
62+
63+
def sync_detailed(
64+
project_id: str,
65+
*,
66+
client: AuthenticatedClient,
67+
body: WebMapServiceCreate,
68+
) -> Response[Union[HTTPValidationError, WebMapService]]:
69+
"""Create a Web Map Service for a Project
70+
71+
Create a Web Map Service.
72+
73+
Args:
74+
project_id (str):
75+
body (WebMapServiceCreate):
76+
77+
Raises:
78+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
79+
httpx.TimeoutException: If the request takes longer than Client.timeout.
80+
81+
Returns:
82+
Response[Union[HTTPValidationError, WebMapService]]
83+
"""
84+
85+
kwargs = _get_kwargs(
86+
project_id=project_id,
87+
body=body,
88+
)
89+
90+
response = client.get_httpx_client().request(
91+
**kwargs,
92+
)
93+
94+
return _build_response(client=client, response=response)
95+
96+
97+
def sync(
98+
project_id: str,
99+
*,
100+
client: AuthenticatedClient,
101+
body: WebMapServiceCreate,
102+
) -> Optional[Union[HTTPValidationError, WebMapService]]:
103+
"""Create a Web Map Service for a Project
104+
105+
Create a Web Map Service.
106+
107+
Args:
108+
project_id (str):
109+
body (WebMapServiceCreate):
110+
111+
Raises:
112+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
113+
httpx.TimeoutException: If the request takes longer than Client.timeout.
114+
115+
Returns:
116+
Union[HTTPValidationError, WebMapService]
117+
"""
118+
119+
return sync_detailed(
120+
project_id=project_id,
121+
client=client,
122+
body=body,
123+
).parsed
124+
125+
126+
async def asyncio_detailed(
127+
project_id: str,
128+
*,
129+
client: AuthenticatedClient,
130+
body: WebMapServiceCreate,
131+
) -> Response[Union[HTTPValidationError, WebMapService]]:
132+
"""Create a Web Map Service for a Project
133+
134+
Create a Web Map Service.
135+
136+
Args:
137+
project_id (str):
138+
body (WebMapServiceCreate):
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+
Response[Union[HTTPValidationError, WebMapService]]
146+
"""
147+
148+
kwargs = _get_kwargs(
149+
project_id=project_id,
150+
body=body,
151+
)
152+
153+
response = await client.get_async_httpx_client().request(**kwargs)
154+
155+
return _build_response(client=client, response=response)
156+
157+
158+
async def asyncio(
159+
project_id: str,
160+
*,
161+
client: AuthenticatedClient,
162+
body: WebMapServiceCreate,
163+
) -> Optional[Union[HTTPValidationError, WebMapService]]:
164+
"""Create a Web Map Service for a Project
165+
166+
Create a Web Map Service.
167+
168+
Args:
169+
project_id (str):
170+
body (WebMapServiceCreate):
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+
Union[HTTPValidationError, WebMapService]
178+
"""
179+
180+
return (
181+
await asyncio_detailed(
182+
project_id=project_id,
183+
client=client,
184+
body=body,
185+
)
186+
).parsed

0 commit comments

Comments
 (0)