waldur-api-client 8.0.8.dev182__py3-none-any.whl → 8.0.8.dev184__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- waldur_api_client/api/openportal_accounting_summary/__init__.py +1 -0
- waldur_api_client/api/openportal_accounting_summary/openportal_accounting_summary_count.py +226 -0
- waldur_api_client/api/openportal_accounting_summary/openportal_accounting_summary_list.py +384 -0
- waldur_api_client/api/openportal_accounting_summary/openportal_accounting_summary_retrieve.py +146 -0
- waldur_api_client/api/openportal_managed_projects/openportal_managed_projects_count.py +30 -0
- waldur_api_client/api/openportal_managed_projects/openportal_managed_projects_list.py +42 -0
- waldur_api_client/api/openportal_project_storage_reports/__init__.py +1 -0
- waldur_api_client/api/openportal_project_storage_reports/openportal_project_storage_reports_count.py +253 -0
- waldur_api_client/api/openportal_project_storage_reports/openportal_project_storage_reports_list.py +423 -0
- waldur_api_client/api/openportal_project_storage_reports/openportal_project_storage_reports_retrieve.py +145 -0
- waldur_api_client/api/openportal_project_usage_reports/__init__.py +1 -0
- waldur_api_client/api/openportal_project_usage_reports/openportal_project_usage_reports_count.py +268 -0
- waldur_api_client/api/openportal_project_usage_reports/openportal_project_usage_reports_list.py +444 -0
- waldur_api_client/api/openportal_project_usage_reports/openportal_project_usage_reports_retrieve.py +145 -0
- waldur_api_client/api-map.md +23 -2
- waldur_api_client/llms-full.txt +92 -3
- waldur_api_client/llms.txt +4 -1
- waldur_api_client/models/__init__.py +12 -2
- waldur_api_client/models/basic_customer_request.py +59 -0
- waldur_api_client/models/basic_project.py +76 -0
- waldur_api_client/models/cached_project_storage_report.py +99 -0
- waldur_api_client/models/cached_project_usage_report.py +110 -0
- waldur_api_client/models/managed_project.py +5 -5
- waldur_api_client/models/project_accounting_summary.py +160 -0
- waldur_api_client/models/project_template.py +13 -13
- waldur_api_client/models/resource_offering_request.py +59 -0
- {waldur_api_client-8.0.8.dev182.dist-info → waldur_api_client-8.0.8.dev184.dist-info}/METADATA +1 -1
- {waldur_api_client-8.0.8.dev182.dist-info → waldur_api_client-8.0.8.dev184.dist-info}/RECORD +30 -13
- waldur_api_client/models/provider_offering_details_request.py +0 -455
- {waldur_api_client-8.0.8.dev182.dist-info → waldur_api_client-8.0.8.dev184.dist-info}/WHEEL +0 -0
- {waldur_api_client-8.0.8.dev182.dist-info → waldur_api_client-8.0.8.dev184.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Union
|
|
3
|
+
from uuid import UUID
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...types import UNSET, Response, Unset
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_kwargs(
|
|
13
|
+
*,
|
|
14
|
+
customer_uuid: Union[Unset, UUID] = UNSET,
|
|
15
|
+
is_active: Union[Unset, bool] = UNSET,
|
|
16
|
+
page: Union[Unset, int] = UNSET,
|
|
17
|
+
page_size: Union[Unset, int] = UNSET,
|
|
18
|
+
project_uuid: Union[Unset, UUID] = UNSET,
|
|
19
|
+
) -> dict[str, Any]:
|
|
20
|
+
params: dict[str, Any] = {}
|
|
21
|
+
|
|
22
|
+
json_customer_uuid: Union[Unset, str] = UNSET
|
|
23
|
+
if not isinstance(customer_uuid, Unset):
|
|
24
|
+
json_customer_uuid = str(customer_uuid)
|
|
25
|
+
params["customer_uuid"] = json_customer_uuid
|
|
26
|
+
|
|
27
|
+
params["is_active"] = is_active
|
|
28
|
+
|
|
29
|
+
params["page"] = page
|
|
30
|
+
|
|
31
|
+
params["page_size"] = page_size
|
|
32
|
+
|
|
33
|
+
json_project_uuid: Union[Unset, str] = UNSET
|
|
34
|
+
if not isinstance(project_uuid, Unset):
|
|
35
|
+
json_project_uuid = str(project_uuid)
|
|
36
|
+
params["project_uuid"] = json_project_uuid
|
|
37
|
+
|
|
38
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
39
|
+
|
|
40
|
+
_kwargs: dict[str, Any] = {
|
|
41
|
+
"method": "head",
|
|
42
|
+
"url": "/api/openportal-accounting-summary/",
|
|
43
|
+
"params": params,
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return _kwargs
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> int:
|
|
50
|
+
if response.status_code == HTTPStatus.OK:
|
|
51
|
+
try:
|
|
52
|
+
return int(response.headers["x-result-count"])
|
|
53
|
+
except KeyError:
|
|
54
|
+
raise errors.UnexpectedStatus(
|
|
55
|
+
response.status_code,
|
|
56
|
+
b"Expected 'X-Result-Count' header for HEAD request, but it was not found.",
|
|
57
|
+
response.url,
|
|
58
|
+
)
|
|
59
|
+
except ValueError:
|
|
60
|
+
count_val = response.headers.get("x-result-count")
|
|
61
|
+
msg = f"Expected 'X-Result-Count' header to be an integer, but got '{count_val}'."
|
|
62
|
+
raise errors.UnexpectedStatus(response.status_code, msg.encode(), response.url)
|
|
63
|
+
raise errors.UnexpectedStatus(response.status_code, response.content, response.url)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[int]:
|
|
67
|
+
return Response(
|
|
68
|
+
status_code=HTTPStatus(response.status_code),
|
|
69
|
+
content=response.content,
|
|
70
|
+
headers=response.headers,
|
|
71
|
+
parsed=_parse_response(client=client, response=response),
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def sync_detailed(
|
|
76
|
+
*,
|
|
77
|
+
client: AuthenticatedClient,
|
|
78
|
+
customer_uuid: Union[Unset, UUID] = UNSET,
|
|
79
|
+
is_active: Union[Unset, bool] = UNSET,
|
|
80
|
+
page: Union[Unset, int] = UNSET,
|
|
81
|
+
page_size: Union[Unset, int] = UNSET,
|
|
82
|
+
project_uuid: Union[Unset, UUID] = UNSET,
|
|
83
|
+
) -> Response[int]:
|
|
84
|
+
"""Get number of items in the collection matching the request parameters.
|
|
85
|
+
|
|
86
|
+
Args:
|
|
87
|
+
customer_uuid (Union[Unset, UUID]):
|
|
88
|
+
is_active (Union[Unset, bool]):
|
|
89
|
+
page (Union[Unset, int]):
|
|
90
|
+
page_size (Union[Unset, int]):
|
|
91
|
+
project_uuid (Union[Unset, UUID]):
|
|
92
|
+
|
|
93
|
+
Raises:
|
|
94
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
95
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
96
|
+
|
|
97
|
+
Returns:
|
|
98
|
+
Response[int]
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
kwargs = _get_kwargs(
|
|
102
|
+
customer_uuid=customer_uuid,
|
|
103
|
+
is_active=is_active,
|
|
104
|
+
page=page,
|
|
105
|
+
page_size=page_size,
|
|
106
|
+
project_uuid=project_uuid,
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
response = client.get_httpx_client().request(
|
|
110
|
+
**kwargs,
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
return _build_response(client=client, response=response)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def sync(
|
|
117
|
+
*,
|
|
118
|
+
client: AuthenticatedClient,
|
|
119
|
+
customer_uuid: Union[Unset, UUID] = UNSET,
|
|
120
|
+
is_active: Union[Unset, bool] = UNSET,
|
|
121
|
+
page: Union[Unset, int] = UNSET,
|
|
122
|
+
page_size: Union[Unset, int] = UNSET,
|
|
123
|
+
project_uuid: Union[Unset, UUID] = UNSET,
|
|
124
|
+
) -> int:
|
|
125
|
+
"""Get number of items in the collection matching the request parameters.
|
|
126
|
+
|
|
127
|
+
Args:
|
|
128
|
+
customer_uuid (Union[Unset, UUID]):
|
|
129
|
+
is_active (Union[Unset, bool]):
|
|
130
|
+
page (Union[Unset, int]):
|
|
131
|
+
page_size (Union[Unset, int]):
|
|
132
|
+
project_uuid (Union[Unset, UUID]):
|
|
133
|
+
|
|
134
|
+
Raises:
|
|
135
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
136
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
137
|
+
|
|
138
|
+
Returns:
|
|
139
|
+
int
|
|
140
|
+
"""
|
|
141
|
+
|
|
142
|
+
return sync_detailed(
|
|
143
|
+
client=client,
|
|
144
|
+
customer_uuid=customer_uuid,
|
|
145
|
+
is_active=is_active,
|
|
146
|
+
page=page,
|
|
147
|
+
page_size=page_size,
|
|
148
|
+
project_uuid=project_uuid,
|
|
149
|
+
).parsed
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
async def asyncio_detailed(
|
|
153
|
+
*,
|
|
154
|
+
client: AuthenticatedClient,
|
|
155
|
+
customer_uuid: Union[Unset, UUID] = UNSET,
|
|
156
|
+
is_active: Union[Unset, bool] = UNSET,
|
|
157
|
+
page: Union[Unset, int] = UNSET,
|
|
158
|
+
page_size: Union[Unset, int] = UNSET,
|
|
159
|
+
project_uuid: Union[Unset, UUID] = UNSET,
|
|
160
|
+
) -> Response[int]:
|
|
161
|
+
"""Get number of items in the collection matching the request parameters.
|
|
162
|
+
|
|
163
|
+
Args:
|
|
164
|
+
customer_uuid (Union[Unset, UUID]):
|
|
165
|
+
is_active (Union[Unset, bool]):
|
|
166
|
+
page (Union[Unset, int]):
|
|
167
|
+
page_size (Union[Unset, int]):
|
|
168
|
+
project_uuid (Union[Unset, UUID]):
|
|
169
|
+
|
|
170
|
+
Raises:
|
|
171
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
172
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
173
|
+
|
|
174
|
+
Returns:
|
|
175
|
+
Response[int]
|
|
176
|
+
"""
|
|
177
|
+
|
|
178
|
+
kwargs = _get_kwargs(
|
|
179
|
+
customer_uuid=customer_uuid,
|
|
180
|
+
is_active=is_active,
|
|
181
|
+
page=page,
|
|
182
|
+
page_size=page_size,
|
|
183
|
+
project_uuid=project_uuid,
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
187
|
+
|
|
188
|
+
return _build_response(client=client, response=response)
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
async def asyncio(
|
|
192
|
+
*,
|
|
193
|
+
client: AuthenticatedClient,
|
|
194
|
+
customer_uuid: Union[Unset, UUID] = UNSET,
|
|
195
|
+
is_active: Union[Unset, bool] = UNSET,
|
|
196
|
+
page: Union[Unset, int] = UNSET,
|
|
197
|
+
page_size: Union[Unset, int] = UNSET,
|
|
198
|
+
project_uuid: Union[Unset, UUID] = UNSET,
|
|
199
|
+
) -> int:
|
|
200
|
+
"""Get number of items in the collection matching the request parameters.
|
|
201
|
+
|
|
202
|
+
Args:
|
|
203
|
+
customer_uuid (Union[Unset, UUID]):
|
|
204
|
+
is_active (Union[Unset, bool]):
|
|
205
|
+
page (Union[Unset, int]):
|
|
206
|
+
page_size (Union[Unset, int]):
|
|
207
|
+
project_uuid (Union[Unset, UUID]):
|
|
208
|
+
|
|
209
|
+
Raises:
|
|
210
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
211
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
212
|
+
|
|
213
|
+
Returns:
|
|
214
|
+
int
|
|
215
|
+
"""
|
|
216
|
+
|
|
217
|
+
return (
|
|
218
|
+
await asyncio_detailed(
|
|
219
|
+
client=client,
|
|
220
|
+
customer_uuid=customer_uuid,
|
|
221
|
+
is_active=is_active,
|
|
222
|
+
page=page,
|
|
223
|
+
page_size=page_size,
|
|
224
|
+
project_uuid=project_uuid,
|
|
225
|
+
)
|
|
226
|
+
).parsed
|
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Union
|
|
3
|
+
from uuid import UUID
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.project_accounting_summary import ProjectAccountingSummary
|
|
10
|
+
from ...types import UNSET, Response, Unset
|
|
11
|
+
from ...utils import parse_link_header
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
*,
|
|
16
|
+
customer_uuid: Union[Unset, UUID] = UNSET,
|
|
17
|
+
is_active: Union[Unset, bool] = UNSET,
|
|
18
|
+
page: Union[Unset, int] = UNSET,
|
|
19
|
+
page_size: Union[Unset, int] = UNSET,
|
|
20
|
+
project_uuid: Union[Unset, UUID] = UNSET,
|
|
21
|
+
) -> dict[str, Any]:
|
|
22
|
+
params: dict[str, Any] = {}
|
|
23
|
+
|
|
24
|
+
json_customer_uuid: Union[Unset, str] = UNSET
|
|
25
|
+
if not isinstance(customer_uuid, Unset):
|
|
26
|
+
json_customer_uuid = str(customer_uuid)
|
|
27
|
+
params["customer_uuid"] = json_customer_uuid
|
|
28
|
+
|
|
29
|
+
params["is_active"] = is_active
|
|
30
|
+
|
|
31
|
+
params["page"] = page
|
|
32
|
+
|
|
33
|
+
params["page_size"] = page_size
|
|
34
|
+
|
|
35
|
+
json_project_uuid: Union[Unset, str] = UNSET
|
|
36
|
+
if not isinstance(project_uuid, Unset):
|
|
37
|
+
json_project_uuid = str(project_uuid)
|
|
38
|
+
params["project_uuid"] = json_project_uuid
|
|
39
|
+
|
|
40
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
41
|
+
|
|
42
|
+
_kwargs: dict[str, Any] = {
|
|
43
|
+
"method": "get",
|
|
44
|
+
"url": "/api/openportal-accounting-summary/",
|
|
45
|
+
"params": params,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return _kwargs
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _parse_response(
|
|
52
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
53
|
+
) -> list["ProjectAccountingSummary"]:
|
|
54
|
+
if response.status_code == 404:
|
|
55
|
+
raise errors.UnexpectedStatus(response.status_code, response.content, response.url)
|
|
56
|
+
if response.status_code == 200:
|
|
57
|
+
response_200 = []
|
|
58
|
+
_response_200 = response.json()
|
|
59
|
+
for response_200_item_data in _response_200:
|
|
60
|
+
response_200_item = ProjectAccountingSummary.from_dict(response_200_item_data)
|
|
61
|
+
|
|
62
|
+
response_200.append(response_200_item)
|
|
63
|
+
|
|
64
|
+
return response_200
|
|
65
|
+
raise errors.UnexpectedStatus(response.status_code, response.content, response.url)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _build_response(
|
|
69
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
70
|
+
) -> Response[list["ProjectAccountingSummary"]]:
|
|
71
|
+
return Response(
|
|
72
|
+
status_code=HTTPStatus(response.status_code),
|
|
73
|
+
content=response.content,
|
|
74
|
+
headers=response.headers,
|
|
75
|
+
parsed=_parse_response(client=client, response=response),
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def sync_detailed(
|
|
80
|
+
*,
|
|
81
|
+
client: AuthenticatedClient,
|
|
82
|
+
customer_uuid: Union[Unset, UUID] = UNSET,
|
|
83
|
+
is_active: Union[Unset, bool] = UNSET,
|
|
84
|
+
page: Union[Unset, int] = UNSET,
|
|
85
|
+
page_size: Union[Unset, int] = UNSET,
|
|
86
|
+
project_uuid: Union[Unset, UUID] = UNSET,
|
|
87
|
+
) -> Response[list["ProjectAccountingSummary"]]:
|
|
88
|
+
"""
|
|
89
|
+
Args:
|
|
90
|
+
customer_uuid (Union[Unset, UUID]):
|
|
91
|
+
is_active (Union[Unset, bool]):
|
|
92
|
+
page (Union[Unset, int]):
|
|
93
|
+
page_size (Union[Unset, int]):
|
|
94
|
+
project_uuid (Union[Unset, UUID]):
|
|
95
|
+
|
|
96
|
+
Raises:
|
|
97
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
98
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
99
|
+
|
|
100
|
+
Returns:
|
|
101
|
+
Response[list['ProjectAccountingSummary']]
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
kwargs = _get_kwargs(
|
|
105
|
+
customer_uuid=customer_uuid,
|
|
106
|
+
is_active=is_active,
|
|
107
|
+
page=page,
|
|
108
|
+
page_size=page_size,
|
|
109
|
+
project_uuid=project_uuid,
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
response = client.get_httpx_client().request(
|
|
113
|
+
**kwargs,
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
return _build_response(client=client, response=response)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def sync(
|
|
120
|
+
*,
|
|
121
|
+
client: AuthenticatedClient,
|
|
122
|
+
customer_uuid: Union[Unset, UUID] = UNSET,
|
|
123
|
+
is_active: Union[Unset, bool] = UNSET,
|
|
124
|
+
page: Union[Unset, int] = UNSET,
|
|
125
|
+
page_size: Union[Unset, int] = UNSET,
|
|
126
|
+
project_uuid: Union[Unset, UUID] = UNSET,
|
|
127
|
+
) -> list["ProjectAccountingSummary"]:
|
|
128
|
+
"""
|
|
129
|
+
Args:
|
|
130
|
+
customer_uuid (Union[Unset, UUID]):
|
|
131
|
+
is_active (Union[Unset, bool]):
|
|
132
|
+
page (Union[Unset, int]):
|
|
133
|
+
page_size (Union[Unset, int]):
|
|
134
|
+
project_uuid (Union[Unset, UUID]):
|
|
135
|
+
|
|
136
|
+
Raises:
|
|
137
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
138
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
139
|
+
|
|
140
|
+
Returns:
|
|
141
|
+
list['ProjectAccountingSummary']
|
|
142
|
+
"""
|
|
143
|
+
|
|
144
|
+
return sync_detailed(
|
|
145
|
+
client=client,
|
|
146
|
+
customer_uuid=customer_uuid,
|
|
147
|
+
is_active=is_active,
|
|
148
|
+
page=page,
|
|
149
|
+
page_size=page_size,
|
|
150
|
+
project_uuid=project_uuid,
|
|
151
|
+
).parsed
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
async def asyncio_detailed(
|
|
155
|
+
*,
|
|
156
|
+
client: AuthenticatedClient,
|
|
157
|
+
customer_uuid: Union[Unset, UUID] = UNSET,
|
|
158
|
+
is_active: Union[Unset, bool] = UNSET,
|
|
159
|
+
page: Union[Unset, int] = UNSET,
|
|
160
|
+
page_size: Union[Unset, int] = UNSET,
|
|
161
|
+
project_uuid: Union[Unset, UUID] = UNSET,
|
|
162
|
+
) -> Response[list["ProjectAccountingSummary"]]:
|
|
163
|
+
"""
|
|
164
|
+
Args:
|
|
165
|
+
customer_uuid (Union[Unset, UUID]):
|
|
166
|
+
is_active (Union[Unset, bool]):
|
|
167
|
+
page (Union[Unset, int]):
|
|
168
|
+
page_size (Union[Unset, int]):
|
|
169
|
+
project_uuid (Union[Unset, UUID]):
|
|
170
|
+
|
|
171
|
+
Raises:
|
|
172
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
173
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
174
|
+
|
|
175
|
+
Returns:
|
|
176
|
+
Response[list['ProjectAccountingSummary']]
|
|
177
|
+
"""
|
|
178
|
+
|
|
179
|
+
kwargs = _get_kwargs(
|
|
180
|
+
customer_uuid=customer_uuid,
|
|
181
|
+
is_active=is_active,
|
|
182
|
+
page=page,
|
|
183
|
+
page_size=page_size,
|
|
184
|
+
project_uuid=project_uuid,
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
188
|
+
|
|
189
|
+
return _build_response(client=client, response=response)
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
async def asyncio(
|
|
193
|
+
*,
|
|
194
|
+
client: AuthenticatedClient,
|
|
195
|
+
customer_uuid: Union[Unset, UUID] = UNSET,
|
|
196
|
+
is_active: Union[Unset, bool] = UNSET,
|
|
197
|
+
page: Union[Unset, int] = UNSET,
|
|
198
|
+
page_size: Union[Unset, int] = UNSET,
|
|
199
|
+
project_uuid: Union[Unset, UUID] = UNSET,
|
|
200
|
+
) -> list["ProjectAccountingSummary"]:
|
|
201
|
+
"""
|
|
202
|
+
Args:
|
|
203
|
+
customer_uuid (Union[Unset, UUID]):
|
|
204
|
+
is_active (Union[Unset, bool]):
|
|
205
|
+
page (Union[Unset, int]):
|
|
206
|
+
page_size (Union[Unset, int]):
|
|
207
|
+
project_uuid (Union[Unset, UUID]):
|
|
208
|
+
|
|
209
|
+
Raises:
|
|
210
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
211
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
212
|
+
|
|
213
|
+
Returns:
|
|
214
|
+
list['ProjectAccountingSummary']
|
|
215
|
+
"""
|
|
216
|
+
|
|
217
|
+
return (
|
|
218
|
+
await asyncio_detailed(
|
|
219
|
+
client=client,
|
|
220
|
+
customer_uuid=customer_uuid,
|
|
221
|
+
is_active=is_active,
|
|
222
|
+
page=page,
|
|
223
|
+
page_size=page_size,
|
|
224
|
+
project_uuid=project_uuid,
|
|
225
|
+
)
|
|
226
|
+
).parsed
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
def sync_all(
|
|
230
|
+
*,
|
|
231
|
+
client: AuthenticatedClient,
|
|
232
|
+
customer_uuid: Union[Unset, UUID] = UNSET,
|
|
233
|
+
is_active: Union[Unset, bool] = UNSET,
|
|
234
|
+
project_uuid: Union[Unset, UUID] = UNSET,
|
|
235
|
+
) -> list["ProjectAccountingSummary"]:
|
|
236
|
+
"""Get All Pages
|
|
237
|
+
|
|
238
|
+
Fetch all pages of paginated results. This function automatically handles pagination
|
|
239
|
+
by following the 'next' link in the Link header until all results are retrieved.
|
|
240
|
+
|
|
241
|
+
Note: page_size will be set to 100 (the maximum allowed) automatically.
|
|
242
|
+
|
|
243
|
+
Args:
|
|
244
|
+
customer_uuid (Union[Unset, UUID]):
|
|
245
|
+
is_active (Union[Unset, bool]):
|
|
246
|
+
project_uuid (Union[Unset, UUID]):
|
|
247
|
+
|
|
248
|
+
Raises:
|
|
249
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
250
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
251
|
+
|
|
252
|
+
Returns:
|
|
253
|
+
list['ProjectAccountingSummary']: Combined results from all pages
|
|
254
|
+
"""
|
|
255
|
+
from urllib.parse import parse_qs, urlparse
|
|
256
|
+
|
|
257
|
+
all_results: list[ProjectAccountingSummary] = []
|
|
258
|
+
|
|
259
|
+
# Get initial request kwargs
|
|
260
|
+
kwargs = _get_kwargs(
|
|
261
|
+
customer_uuid=customer_uuid,
|
|
262
|
+
is_active=is_active,
|
|
263
|
+
project_uuid=project_uuid,
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
# Set page_size to maximum
|
|
267
|
+
if "params" not in kwargs:
|
|
268
|
+
kwargs["params"] = {}
|
|
269
|
+
kwargs["params"]["page_size"] = 100
|
|
270
|
+
|
|
271
|
+
# Make initial request
|
|
272
|
+
response = client.get_httpx_client().request(**kwargs)
|
|
273
|
+
parsed_response = _parse_response(client=client, response=response)
|
|
274
|
+
|
|
275
|
+
if parsed_response:
|
|
276
|
+
all_results.extend(parsed_response)
|
|
277
|
+
|
|
278
|
+
# Follow pagination links
|
|
279
|
+
while True:
|
|
280
|
+
link_header = response.headers.get("Link", "")
|
|
281
|
+
links = parse_link_header(link_header)
|
|
282
|
+
|
|
283
|
+
if "next" not in links:
|
|
284
|
+
break
|
|
285
|
+
|
|
286
|
+
# Extract page number from next URL
|
|
287
|
+
next_url = links["next"]
|
|
288
|
+
parsed_url = urlparse(next_url)
|
|
289
|
+
next_params = parse_qs(parsed_url.query)
|
|
290
|
+
|
|
291
|
+
if "page" not in next_params:
|
|
292
|
+
break
|
|
293
|
+
|
|
294
|
+
# Update only the page parameter, keep all other params
|
|
295
|
+
page_number = next_params["page"][0]
|
|
296
|
+
kwargs["params"]["page"] = page_number
|
|
297
|
+
|
|
298
|
+
# Fetch next page
|
|
299
|
+
response = client.get_httpx_client().request(**kwargs)
|
|
300
|
+
parsed_response = _parse_response(client=client, response=response)
|
|
301
|
+
|
|
302
|
+
if parsed_response:
|
|
303
|
+
all_results.extend(parsed_response)
|
|
304
|
+
|
|
305
|
+
return all_results
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
async def asyncio_all(
|
|
309
|
+
*,
|
|
310
|
+
client: AuthenticatedClient,
|
|
311
|
+
customer_uuid: Union[Unset, UUID] = UNSET,
|
|
312
|
+
is_active: Union[Unset, bool] = UNSET,
|
|
313
|
+
project_uuid: Union[Unset, UUID] = UNSET,
|
|
314
|
+
) -> list["ProjectAccountingSummary"]:
|
|
315
|
+
"""Get All Pages (Async)
|
|
316
|
+
|
|
317
|
+
Fetch all pages of paginated results asynchronously. This function automatically handles pagination
|
|
318
|
+
by following the 'next' link in the Link header until all results are retrieved.
|
|
319
|
+
|
|
320
|
+
Note: page_size will be set to 100 (the maximum allowed) automatically.
|
|
321
|
+
|
|
322
|
+
Args:
|
|
323
|
+
customer_uuid (Union[Unset, UUID]):
|
|
324
|
+
is_active (Union[Unset, bool]):
|
|
325
|
+
project_uuid (Union[Unset, UUID]):
|
|
326
|
+
|
|
327
|
+
Raises:
|
|
328
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code.
|
|
329
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
330
|
+
|
|
331
|
+
Returns:
|
|
332
|
+
list['ProjectAccountingSummary']: Combined results from all pages
|
|
333
|
+
"""
|
|
334
|
+
from urllib.parse import parse_qs, urlparse
|
|
335
|
+
|
|
336
|
+
all_results: list[ProjectAccountingSummary] = []
|
|
337
|
+
|
|
338
|
+
# Get initial request kwargs
|
|
339
|
+
kwargs = _get_kwargs(
|
|
340
|
+
customer_uuid=customer_uuid,
|
|
341
|
+
is_active=is_active,
|
|
342
|
+
project_uuid=project_uuid,
|
|
343
|
+
)
|
|
344
|
+
|
|
345
|
+
# Set page_size to maximum
|
|
346
|
+
if "params" not in kwargs:
|
|
347
|
+
kwargs["params"] = {}
|
|
348
|
+
kwargs["params"]["page_size"] = 100
|
|
349
|
+
|
|
350
|
+
# Make initial request
|
|
351
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
352
|
+
parsed_response = _parse_response(client=client, response=response)
|
|
353
|
+
|
|
354
|
+
if parsed_response:
|
|
355
|
+
all_results.extend(parsed_response)
|
|
356
|
+
|
|
357
|
+
# Follow pagination links
|
|
358
|
+
while True:
|
|
359
|
+
link_header = response.headers.get("Link", "")
|
|
360
|
+
links = parse_link_header(link_header)
|
|
361
|
+
|
|
362
|
+
if "next" not in links:
|
|
363
|
+
break
|
|
364
|
+
|
|
365
|
+
# Extract page number from next URL
|
|
366
|
+
next_url = links["next"]
|
|
367
|
+
parsed_url = urlparse(next_url)
|
|
368
|
+
next_params = parse_qs(parsed_url.query)
|
|
369
|
+
|
|
370
|
+
if "page" not in next_params:
|
|
371
|
+
break
|
|
372
|
+
|
|
373
|
+
# Update only the page parameter, keep all other params
|
|
374
|
+
page_number = next_params["page"][0]
|
|
375
|
+
kwargs["params"]["page"] = page_number
|
|
376
|
+
|
|
377
|
+
# Fetch next page
|
|
378
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
379
|
+
parsed_response = _parse_response(client=client, response=response)
|
|
380
|
+
|
|
381
|
+
if parsed_response:
|
|
382
|
+
all_results.extend(parsed_response)
|
|
383
|
+
|
|
384
|
+
return all_results
|