stackit-cost 0.1.0__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.
- src/stackit/cost/__init__.py +85 -0
- src/stackit/cost/api/__init__.py +4 -0
- src/stackit/cost/api/default_api.py +1285 -0
- src/stackit/cost/api_client.py +652 -0
- src/stackit/cost/api_response.py +23 -0
- src/stackit/cost/configuration.py +163 -0
- src/stackit/cost/exceptions.py +217 -0
- src/stackit/cost/models/__init__.py +30 -0
- src/stackit/cost/models/auth_error_response.py +108 -0
- src/stackit/cost/models/detailed_service_cost.py +143 -0
- src/stackit/cost/models/error_response.py +81 -0
- src/stackit/cost/models/project_cost.py +203 -0
- src/stackit/cost/models/project_cost_with_detailed_services.py +132 -0
- src/stackit/cost/models/project_cost_with_reports.py +133 -0
- src/stackit/cost/models/project_cost_with_summarized_services.py +129 -0
- src/stackit/cost/models/report_data.py +104 -0
- src/stackit/cost/models/report_data_time_period.py +83 -0
- src/stackit/cost/models/summarized_project_cost.py +113 -0
- src/stackit/cost/models/summarized_service_cost.py +113 -0
- src/stackit/cost/py.typed +0 -0
- src/stackit/cost/rest.py +164 -0
- stackit_cost-0.1.0.dist-info/METADATA +46 -0
- stackit_cost-0.1.0.dist-info/RECORD +24 -0
- stackit_cost-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,1285 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
STACKIT Cost API
|
|
5
|
+
|
|
6
|
+
The cost API provides detailed reports on the costs for a customer or project over a certain amount of time
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 3.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
from datetime import date
|
|
15
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
16
|
+
from uuid import UUID
|
|
17
|
+
|
|
18
|
+
from pydantic import (
|
|
19
|
+
Field,
|
|
20
|
+
StrictBool,
|
|
21
|
+
StrictFloat,
|
|
22
|
+
StrictInt,
|
|
23
|
+
StrictStr,
|
|
24
|
+
validate_call,
|
|
25
|
+
)
|
|
26
|
+
from stackit.core.configuration import Configuration
|
|
27
|
+
from typing_extensions import Annotated
|
|
28
|
+
|
|
29
|
+
from stackit.cost.api_client import ApiClient, RequestSerialized
|
|
30
|
+
from stackit.cost.api_response import ApiResponse
|
|
31
|
+
from stackit.cost.models.project_cost import ProjectCost
|
|
32
|
+
from stackit.cost.rest import RESTResponseType
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class DefaultApi:
|
|
36
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
37
|
+
Ref: https://openapi-generator.tech
|
|
38
|
+
|
|
39
|
+
Do not edit the class manually.
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
def __init__(self, configuration: Configuration = None) -> None:
|
|
43
|
+
if configuration is None:
|
|
44
|
+
configuration = Configuration()
|
|
45
|
+
self.configuration = configuration
|
|
46
|
+
self.api_client = ApiClient(self.configuration)
|
|
47
|
+
|
|
48
|
+
@validate_call
|
|
49
|
+
def get_costs_for_project(
|
|
50
|
+
self,
|
|
51
|
+
customer_account_id: Annotated[UUID, Field(description="ID of a customer account")],
|
|
52
|
+
project_id: Annotated[UUID, Field(description="ID of a project")],
|
|
53
|
+
var_from: Annotated[
|
|
54
|
+
date,
|
|
55
|
+
Field(
|
|
56
|
+
description="Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included."
|
|
57
|
+
),
|
|
58
|
+
],
|
|
59
|
+
to: Annotated[
|
|
60
|
+
date,
|
|
61
|
+
Field(
|
|
62
|
+
description="Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included."
|
|
63
|
+
),
|
|
64
|
+
],
|
|
65
|
+
depth: Annotated[
|
|
66
|
+
Optional[StrictStr],
|
|
67
|
+
Field(
|
|
68
|
+
description='Depth of desired cost information. "project" provides costs grouped by project, without services. "service" provides costs separated on service level.'
|
|
69
|
+
),
|
|
70
|
+
] = None,
|
|
71
|
+
granularity: Annotated[
|
|
72
|
+
Optional[StrictStr],
|
|
73
|
+
Field(
|
|
74
|
+
description='Define granularity of costs – Default is "none" which does NOT include detailed report data. If "monthly", "weekly" or "yearly" is requested, the "from" parameter SHOULD be the first day and the "to" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If "daily" is requested, the date range defined by "from" and "to" MUST NOT be longer than 92 days.'
|
|
75
|
+
),
|
|
76
|
+
] = None,
|
|
77
|
+
include_zero_costs: Annotated[
|
|
78
|
+
Optional[StrictBool], Field(description="Whether costs of 0 should be included in the response")
|
|
79
|
+
] = None,
|
|
80
|
+
accept: Annotated[Optional[StrictStr], Field(description="Desired content type")] = None,
|
|
81
|
+
_request_timeout: Union[
|
|
82
|
+
None,
|
|
83
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
84
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
85
|
+
] = None,
|
|
86
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
87
|
+
_content_type: Optional[StrictStr] = None,
|
|
88
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
89
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
90
|
+
) -> ProjectCost:
|
|
91
|
+
"""V3 Costs for a certain project
|
|
92
|
+
|
|
93
|
+
Get costs for a certain project in a customer account
|
|
94
|
+
|
|
95
|
+
:param customer_account_id: ID of a customer account (required)
|
|
96
|
+
:type customer_account_id: UUID
|
|
97
|
+
:param project_id: ID of a project (required)
|
|
98
|
+
:type project_id: UUID
|
|
99
|
+
:param var_from: Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included. (required)
|
|
100
|
+
:type var_from: date
|
|
101
|
+
:param to: Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included. (required)
|
|
102
|
+
:type to: date
|
|
103
|
+
:param depth: Depth of desired cost information. \"project\" provides costs grouped by project, without services. \"service\" provides costs separated on service level.
|
|
104
|
+
:type depth: str
|
|
105
|
+
:param granularity: Define granularity of costs – Default is \"none\" which does NOT include detailed report data. If \"monthly\", \"weekly\" or \"yearly\" is requested, the \"from\" parameter SHOULD be the first day and the \"to\" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If \"daily\" is requested, the date range defined by \"from\" and \"to\" MUST NOT be longer than 92 days.
|
|
106
|
+
:type granularity: str
|
|
107
|
+
:param include_zero_costs: Whether costs of 0 should be included in the response
|
|
108
|
+
:type include_zero_costs: bool
|
|
109
|
+
:param accept: Desired content type
|
|
110
|
+
:type accept: str
|
|
111
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
112
|
+
number provided, it will be total request
|
|
113
|
+
timeout. It can also be a pair (tuple) of
|
|
114
|
+
(connection, read) timeouts.
|
|
115
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
116
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
117
|
+
request; this effectively ignores the
|
|
118
|
+
authentication in the spec for a single request.
|
|
119
|
+
:type _request_auth: dict, optional
|
|
120
|
+
:param _content_type: force content-type for the request.
|
|
121
|
+
:type _content_type: str, Optional
|
|
122
|
+
:param _headers: set to override the headers for a single
|
|
123
|
+
request; this effectively ignores the headers
|
|
124
|
+
in the spec for a single request.
|
|
125
|
+
:type _headers: dict, optional
|
|
126
|
+
:param _host_index: set to override the host_index for a single
|
|
127
|
+
request; this effectively ignores the host_index
|
|
128
|
+
in the spec for a single request.
|
|
129
|
+
:type _host_index: int, optional
|
|
130
|
+
:return: Returns the result object.
|
|
131
|
+
""" # noqa: E501
|
|
132
|
+
|
|
133
|
+
_param = self._get_costs_for_project_serialize(
|
|
134
|
+
customer_account_id=customer_account_id,
|
|
135
|
+
project_id=project_id,
|
|
136
|
+
var_from=var_from,
|
|
137
|
+
to=to,
|
|
138
|
+
depth=depth,
|
|
139
|
+
granularity=granularity,
|
|
140
|
+
include_zero_costs=include_zero_costs,
|
|
141
|
+
accept=accept,
|
|
142
|
+
_request_auth=_request_auth,
|
|
143
|
+
_content_type=_content_type,
|
|
144
|
+
_headers=_headers,
|
|
145
|
+
_host_index=_host_index,
|
|
146
|
+
)
|
|
147
|
+
|
|
148
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
149
|
+
"200": "ProjectCost",
|
|
150
|
+
"400": "ErrorResponse",
|
|
151
|
+
"401": "AuthErrorResponse",
|
|
152
|
+
"403": "AuthErrorResponse",
|
|
153
|
+
"404": "ErrorResponse",
|
|
154
|
+
}
|
|
155
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
156
|
+
response_data.read()
|
|
157
|
+
return self.api_client.response_deserialize(
|
|
158
|
+
response_data=response_data,
|
|
159
|
+
response_types_map=_response_types_map,
|
|
160
|
+
).data
|
|
161
|
+
|
|
162
|
+
@validate_call
|
|
163
|
+
def get_costs_for_project_with_http_info(
|
|
164
|
+
self,
|
|
165
|
+
customer_account_id: Annotated[UUID, Field(description="ID of a customer account")],
|
|
166
|
+
project_id: Annotated[UUID, Field(description="ID of a project")],
|
|
167
|
+
var_from: Annotated[
|
|
168
|
+
date,
|
|
169
|
+
Field(
|
|
170
|
+
description="Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included."
|
|
171
|
+
),
|
|
172
|
+
],
|
|
173
|
+
to: Annotated[
|
|
174
|
+
date,
|
|
175
|
+
Field(
|
|
176
|
+
description="Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included."
|
|
177
|
+
),
|
|
178
|
+
],
|
|
179
|
+
depth: Annotated[
|
|
180
|
+
Optional[StrictStr],
|
|
181
|
+
Field(
|
|
182
|
+
description='Depth of desired cost information. "project" provides costs grouped by project, without services. "service" provides costs separated on service level.'
|
|
183
|
+
),
|
|
184
|
+
] = None,
|
|
185
|
+
granularity: Annotated[
|
|
186
|
+
Optional[StrictStr],
|
|
187
|
+
Field(
|
|
188
|
+
description='Define granularity of costs – Default is "none" which does NOT include detailed report data. If "monthly", "weekly" or "yearly" is requested, the "from" parameter SHOULD be the first day and the "to" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If "daily" is requested, the date range defined by "from" and "to" MUST NOT be longer than 92 days.'
|
|
189
|
+
),
|
|
190
|
+
] = None,
|
|
191
|
+
include_zero_costs: Annotated[
|
|
192
|
+
Optional[StrictBool], Field(description="Whether costs of 0 should be included in the response")
|
|
193
|
+
] = None,
|
|
194
|
+
accept: Annotated[Optional[StrictStr], Field(description="Desired content type")] = None,
|
|
195
|
+
_request_timeout: Union[
|
|
196
|
+
None,
|
|
197
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
198
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
199
|
+
] = None,
|
|
200
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
201
|
+
_content_type: Optional[StrictStr] = None,
|
|
202
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
203
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
204
|
+
) -> ApiResponse[ProjectCost]:
|
|
205
|
+
"""V3 Costs for a certain project
|
|
206
|
+
|
|
207
|
+
Get costs for a certain project in a customer account
|
|
208
|
+
|
|
209
|
+
:param customer_account_id: ID of a customer account (required)
|
|
210
|
+
:type customer_account_id: UUID
|
|
211
|
+
:param project_id: ID of a project (required)
|
|
212
|
+
:type project_id: UUID
|
|
213
|
+
:param var_from: Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included. (required)
|
|
214
|
+
:type var_from: date
|
|
215
|
+
:param to: Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included. (required)
|
|
216
|
+
:type to: date
|
|
217
|
+
:param depth: Depth of desired cost information. \"project\" provides costs grouped by project, without services. \"service\" provides costs separated on service level.
|
|
218
|
+
:type depth: str
|
|
219
|
+
:param granularity: Define granularity of costs – Default is \"none\" which does NOT include detailed report data. If \"monthly\", \"weekly\" or \"yearly\" is requested, the \"from\" parameter SHOULD be the first day and the \"to\" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If \"daily\" is requested, the date range defined by \"from\" and \"to\" MUST NOT be longer than 92 days.
|
|
220
|
+
:type granularity: str
|
|
221
|
+
:param include_zero_costs: Whether costs of 0 should be included in the response
|
|
222
|
+
:type include_zero_costs: bool
|
|
223
|
+
:param accept: Desired content type
|
|
224
|
+
:type accept: str
|
|
225
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
226
|
+
number provided, it will be total request
|
|
227
|
+
timeout. It can also be a pair (tuple) of
|
|
228
|
+
(connection, read) timeouts.
|
|
229
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
230
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
231
|
+
request; this effectively ignores the
|
|
232
|
+
authentication in the spec for a single request.
|
|
233
|
+
:type _request_auth: dict, optional
|
|
234
|
+
:param _content_type: force content-type for the request.
|
|
235
|
+
:type _content_type: str, Optional
|
|
236
|
+
:param _headers: set to override the headers for a single
|
|
237
|
+
request; this effectively ignores the headers
|
|
238
|
+
in the spec for a single request.
|
|
239
|
+
:type _headers: dict, optional
|
|
240
|
+
:param _host_index: set to override the host_index for a single
|
|
241
|
+
request; this effectively ignores the host_index
|
|
242
|
+
in the spec for a single request.
|
|
243
|
+
:type _host_index: int, optional
|
|
244
|
+
:return: Returns the result object.
|
|
245
|
+
""" # noqa: E501
|
|
246
|
+
|
|
247
|
+
_param = self._get_costs_for_project_serialize(
|
|
248
|
+
customer_account_id=customer_account_id,
|
|
249
|
+
project_id=project_id,
|
|
250
|
+
var_from=var_from,
|
|
251
|
+
to=to,
|
|
252
|
+
depth=depth,
|
|
253
|
+
granularity=granularity,
|
|
254
|
+
include_zero_costs=include_zero_costs,
|
|
255
|
+
accept=accept,
|
|
256
|
+
_request_auth=_request_auth,
|
|
257
|
+
_content_type=_content_type,
|
|
258
|
+
_headers=_headers,
|
|
259
|
+
_host_index=_host_index,
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
263
|
+
"200": "ProjectCost",
|
|
264
|
+
"400": "ErrorResponse",
|
|
265
|
+
"401": "AuthErrorResponse",
|
|
266
|
+
"403": "AuthErrorResponse",
|
|
267
|
+
"404": "ErrorResponse",
|
|
268
|
+
}
|
|
269
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
270
|
+
response_data.read()
|
|
271
|
+
return self.api_client.response_deserialize(
|
|
272
|
+
response_data=response_data,
|
|
273
|
+
response_types_map=_response_types_map,
|
|
274
|
+
)
|
|
275
|
+
|
|
276
|
+
@validate_call
|
|
277
|
+
def get_costs_for_project_without_preload_content(
|
|
278
|
+
self,
|
|
279
|
+
customer_account_id: Annotated[UUID, Field(description="ID of a customer account")],
|
|
280
|
+
project_id: Annotated[UUID, Field(description="ID of a project")],
|
|
281
|
+
var_from: Annotated[
|
|
282
|
+
date,
|
|
283
|
+
Field(
|
|
284
|
+
description="Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included."
|
|
285
|
+
),
|
|
286
|
+
],
|
|
287
|
+
to: Annotated[
|
|
288
|
+
date,
|
|
289
|
+
Field(
|
|
290
|
+
description="Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included."
|
|
291
|
+
),
|
|
292
|
+
],
|
|
293
|
+
depth: Annotated[
|
|
294
|
+
Optional[StrictStr],
|
|
295
|
+
Field(
|
|
296
|
+
description='Depth of desired cost information. "project" provides costs grouped by project, without services. "service" provides costs separated on service level.'
|
|
297
|
+
),
|
|
298
|
+
] = None,
|
|
299
|
+
granularity: Annotated[
|
|
300
|
+
Optional[StrictStr],
|
|
301
|
+
Field(
|
|
302
|
+
description='Define granularity of costs – Default is "none" which does NOT include detailed report data. If "monthly", "weekly" or "yearly" is requested, the "from" parameter SHOULD be the first day and the "to" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If "daily" is requested, the date range defined by "from" and "to" MUST NOT be longer than 92 days.'
|
|
303
|
+
),
|
|
304
|
+
] = None,
|
|
305
|
+
include_zero_costs: Annotated[
|
|
306
|
+
Optional[StrictBool], Field(description="Whether costs of 0 should be included in the response")
|
|
307
|
+
] = None,
|
|
308
|
+
accept: Annotated[Optional[StrictStr], Field(description="Desired content type")] = None,
|
|
309
|
+
_request_timeout: Union[
|
|
310
|
+
None,
|
|
311
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
312
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
313
|
+
] = None,
|
|
314
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
315
|
+
_content_type: Optional[StrictStr] = None,
|
|
316
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
317
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
318
|
+
) -> RESTResponseType:
|
|
319
|
+
"""V3 Costs for a certain project
|
|
320
|
+
|
|
321
|
+
Get costs for a certain project in a customer account
|
|
322
|
+
|
|
323
|
+
:param customer_account_id: ID of a customer account (required)
|
|
324
|
+
:type customer_account_id: UUID
|
|
325
|
+
:param project_id: ID of a project (required)
|
|
326
|
+
:type project_id: UUID
|
|
327
|
+
:param var_from: Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included. (required)
|
|
328
|
+
:type var_from: date
|
|
329
|
+
:param to: Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included. (required)
|
|
330
|
+
:type to: date
|
|
331
|
+
:param depth: Depth of desired cost information. \"project\" provides costs grouped by project, without services. \"service\" provides costs separated on service level.
|
|
332
|
+
:type depth: str
|
|
333
|
+
:param granularity: Define granularity of costs – Default is \"none\" which does NOT include detailed report data. If \"monthly\", \"weekly\" or \"yearly\" is requested, the \"from\" parameter SHOULD be the first day and the \"to\" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If \"daily\" is requested, the date range defined by \"from\" and \"to\" MUST NOT be longer than 92 days.
|
|
334
|
+
:type granularity: str
|
|
335
|
+
:param include_zero_costs: Whether costs of 0 should be included in the response
|
|
336
|
+
:type include_zero_costs: bool
|
|
337
|
+
:param accept: Desired content type
|
|
338
|
+
:type accept: str
|
|
339
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
340
|
+
number provided, it will be total request
|
|
341
|
+
timeout. It can also be a pair (tuple) of
|
|
342
|
+
(connection, read) timeouts.
|
|
343
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
344
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
345
|
+
request; this effectively ignores the
|
|
346
|
+
authentication in the spec for a single request.
|
|
347
|
+
:type _request_auth: dict, optional
|
|
348
|
+
:param _content_type: force content-type for the request.
|
|
349
|
+
:type _content_type: str, Optional
|
|
350
|
+
:param _headers: set to override the headers for a single
|
|
351
|
+
request; this effectively ignores the headers
|
|
352
|
+
in the spec for a single request.
|
|
353
|
+
:type _headers: dict, optional
|
|
354
|
+
:param _host_index: set to override the host_index for a single
|
|
355
|
+
request; this effectively ignores the host_index
|
|
356
|
+
in the spec for a single request.
|
|
357
|
+
:type _host_index: int, optional
|
|
358
|
+
:return: Returns the result object.
|
|
359
|
+
""" # noqa: E501
|
|
360
|
+
|
|
361
|
+
_param = self._get_costs_for_project_serialize(
|
|
362
|
+
customer_account_id=customer_account_id,
|
|
363
|
+
project_id=project_id,
|
|
364
|
+
var_from=var_from,
|
|
365
|
+
to=to,
|
|
366
|
+
depth=depth,
|
|
367
|
+
granularity=granularity,
|
|
368
|
+
include_zero_costs=include_zero_costs,
|
|
369
|
+
accept=accept,
|
|
370
|
+
_request_auth=_request_auth,
|
|
371
|
+
_content_type=_content_type,
|
|
372
|
+
_headers=_headers,
|
|
373
|
+
_host_index=_host_index,
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
377
|
+
"200": "ProjectCost",
|
|
378
|
+
"400": "ErrorResponse",
|
|
379
|
+
"401": "AuthErrorResponse",
|
|
380
|
+
"403": "AuthErrorResponse",
|
|
381
|
+
"404": "ErrorResponse",
|
|
382
|
+
}
|
|
383
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
384
|
+
return response_data.response
|
|
385
|
+
|
|
386
|
+
def _get_costs_for_project_serialize(
|
|
387
|
+
self,
|
|
388
|
+
customer_account_id,
|
|
389
|
+
project_id,
|
|
390
|
+
var_from,
|
|
391
|
+
to,
|
|
392
|
+
depth,
|
|
393
|
+
granularity,
|
|
394
|
+
include_zero_costs,
|
|
395
|
+
accept,
|
|
396
|
+
_request_auth,
|
|
397
|
+
_content_type,
|
|
398
|
+
_headers,
|
|
399
|
+
_host_index,
|
|
400
|
+
) -> RequestSerialized:
|
|
401
|
+
|
|
402
|
+
_host = None
|
|
403
|
+
|
|
404
|
+
_collection_formats: Dict[str, str] = {}
|
|
405
|
+
|
|
406
|
+
_path_params: Dict[str, str] = {}
|
|
407
|
+
_query_params: List[Tuple[str, str]] = []
|
|
408
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
409
|
+
_form_params: List[Tuple[str, str]] = []
|
|
410
|
+
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
|
411
|
+
_body_params: Optional[bytes] = None
|
|
412
|
+
|
|
413
|
+
# process the path parameters
|
|
414
|
+
if customer_account_id is not None:
|
|
415
|
+
_path_params["customerAccountId"] = customer_account_id
|
|
416
|
+
if project_id is not None:
|
|
417
|
+
_path_params["projectId"] = project_id
|
|
418
|
+
# process the query parameters
|
|
419
|
+
if var_from is not None:
|
|
420
|
+
if isinstance(var_from, date):
|
|
421
|
+
_query_params.append(("from", var_from.strftime(self.api_client.configuration.date_format)))
|
|
422
|
+
else:
|
|
423
|
+
_query_params.append(("from", var_from))
|
|
424
|
+
|
|
425
|
+
if to is not None:
|
|
426
|
+
if isinstance(to, date):
|
|
427
|
+
_query_params.append(("to", to.strftime(self.api_client.configuration.date_format)))
|
|
428
|
+
else:
|
|
429
|
+
_query_params.append(("to", to))
|
|
430
|
+
|
|
431
|
+
if depth is not None:
|
|
432
|
+
|
|
433
|
+
_query_params.append(("depth", depth))
|
|
434
|
+
|
|
435
|
+
if granularity is not None:
|
|
436
|
+
|
|
437
|
+
_query_params.append(("granularity", granularity))
|
|
438
|
+
|
|
439
|
+
if include_zero_costs is not None:
|
|
440
|
+
|
|
441
|
+
_query_params.append(("includeZeroCosts", include_zero_costs))
|
|
442
|
+
|
|
443
|
+
# process the header parameters
|
|
444
|
+
if accept is not None:
|
|
445
|
+
_header_params["Accept"] = accept
|
|
446
|
+
# process the form parameters
|
|
447
|
+
# process the body parameter
|
|
448
|
+
|
|
449
|
+
# set the HTTP header `Accept`
|
|
450
|
+
if "Accept" not in _header_params:
|
|
451
|
+
_header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/csv"])
|
|
452
|
+
|
|
453
|
+
# authentication setting
|
|
454
|
+
_auth_settings: List[str] = []
|
|
455
|
+
|
|
456
|
+
return self.api_client.param_serialize(
|
|
457
|
+
method="GET",
|
|
458
|
+
resource_path="/v3/costs/{customerAccountId}/projects/{projectId}",
|
|
459
|
+
path_params=_path_params,
|
|
460
|
+
query_params=_query_params,
|
|
461
|
+
header_params=_header_params,
|
|
462
|
+
body=_body_params,
|
|
463
|
+
post_params=_form_params,
|
|
464
|
+
files=_files,
|
|
465
|
+
auth_settings=_auth_settings,
|
|
466
|
+
collection_formats=_collection_formats,
|
|
467
|
+
_host=_host,
|
|
468
|
+
_request_auth=_request_auth,
|
|
469
|
+
)
|
|
470
|
+
|
|
471
|
+
@validate_call
|
|
472
|
+
def list_costs_for_customer(
|
|
473
|
+
self,
|
|
474
|
+
customer_account_id: Annotated[UUID, Field(description="ID of a customer account")],
|
|
475
|
+
var_from: Annotated[
|
|
476
|
+
date,
|
|
477
|
+
Field(
|
|
478
|
+
description="Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included."
|
|
479
|
+
),
|
|
480
|
+
],
|
|
481
|
+
to: Annotated[
|
|
482
|
+
date,
|
|
483
|
+
Field(
|
|
484
|
+
description="Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included."
|
|
485
|
+
),
|
|
486
|
+
],
|
|
487
|
+
depth: Annotated[
|
|
488
|
+
Optional[StrictStr],
|
|
489
|
+
Field(
|
|
490
|
+
description='Depth of desired cost information. "project" provides costs grouped by project, without services. "service" provides costs separated on service level.'
|
|
491
|
+
),
|
|
492
|
+
] = None,
|
|
493
|
+
granularity: Annotated[
|
|
494
|
+
Optional[StrictStr],
|
|
495
|
+
Field(
|
|
496
|
+
description='Define granularity of costs – Default is "none" which does NOT include detailed report data. If "monthly", "weekly" or "yearly" is requested, the "from" parameter SHOULD be the first day and the "to" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If "daily" is requested, the date range defined by "from" and "to" MUST NOT be longer than 92 days.'
|
|
497
|
+
),
|
|
498
|
+
] = None,
|
|
499
|
+
include_zero_costs: Annotated[
|
|
500
|
+
Optional[StrictBool], Field(description="Whether costs of 0 should be included in the response")
|
|
501
|
+
] = None,
|
|
502
|
+
accept: Annotated[Optional[StrictStr], Field(description="Desired content type")] = None,
|
|
503
|
+
_request_timeout: Union[
|
|
504
|
+
None,
|
|
505
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
506
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
507
|
+
] = None,
|
|
508
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
509
|
+
_content_type: Optional[StrictStr] = None,
|
|
510
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
511
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
512
|
+
) -> List[ProjectCost]:
|
|
513
|
+
"""V3 Costs for all projects
|
|
514
|
+
|
|
515
|
+
Get costs for all projects in a customer account
|
|
516
|
+
|
|
517
|
+
:param customer_account_id: ID of a customer account (required)
|
|
518
|
+
:type customer_account_id: UUID
|
|
519
|
+
:param var_from: Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included. (required)
|
|
520
|
+
:type var_from: date
|
|
521
|
+
:param to: Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included. (required)
|
|
522
|
+
:type to: date
|
|
523
|
+
:param depth: Depth of desired cost information. \"project\" provides costs grouped by project, without services. \"service\" provides costs separated on service level.
|
|
524
|
+
:type depth: str
|
|
525
|
+
:param granularity: Define granularity of costs – Default is \"none\" which does NOT include detailed report data. If \"monthly\", \"weekly\" or \"yearly\" is requested, the \"from\" parameter SHOULD be the first day and the \"to\" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If \"daily\" is requested, the date range defined by \"from\" and \"to\" MUST NOT be longer than 92 days.
|
|
526
|
+
:type granularity: str
|
|
527
|
+
:param include_zero_costs: Whether costs of 0 should be included in the response
|
|
528
|
+
:type include_zero_costs: bool
|
|
529
|
+
:param accept: Desired content type
|
|
530
|
+
:type accept: str
|
|
531
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
532
|
+
number provided, it will be total request
|
|
533
|
+
timeout. It can also be a pair (tuple) of
|
|
534
|
+
(connection, read) timeouts.
|
|
535
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
536
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
537
|
+
request; this effectively ignores the
|
|
538
|
+
authentication in the spec for a single request.
|
|
539
|
+
:type _request_auth: dict, optional
|
|
540
|
+
:param _content_type: force content-type for the request.
|
|
541
|
+
:type _content_type: str, Optional
|
|
542
|
+
:param _headers: set to override the headers for a single
|
|
543
|
+
request; this effectively ignores the headers
|
|
544
|
+
in the spec for a single request.
|
|
545
|
+
:type _headers: dict, optional
|
|
546
|
+
:param _host_index: set to override the host_index for a single
|
|
547
|
+
request; this effectively ignores the host_index
|
|
548
|
+
in the spec for a single request.
|
|
549
|
+
:type _host_index: int, optional
|
|
550
|
+
:return: Returns the result object.
|
|
551
|
+
""" # noqa: E501
|
|
552
|
+
|
|
553
|
+
_param = self._list_costs_for_customer_serialize(
|
|
554
|
+
customer_account_id=customer_account_id,
|
|
555
|
+
var_from=var_from,
|
|
556
|
+
to=to,
|
|
557
|
+
depth=depth,
|
|
558
|
+
granularity=granularity,
|
|
559
|
+
include_zero_costs=include_zero_costs,
|
|
560
|
+
accept=accept,
|
|
561
|
+
_request_auth=_request_auth,
|
|
562
|
+
_content_type=_content_type,
|
|
563
|
+
_headers=_headers,
|
|
564
|
+
_host_index=_host_index,
|
|
565
|
+
)
|
|
566
|
+
|
|
567
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
568
|
+
"200": "List[ProjectCost]",
|
|
569
|
+
"400": "ErrorResponse",
|
|
570
|
+
"401": "AuthErrorResponse",
|
|
571
|
+
"403": "AuthErrorResponse",
|
|
572
|
+
"404": "ErrorResponse",
|
|
573
|
+
}
|
|
574
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
575
|
+
response_data.read()
|
|
576
|
+
return self.api_client.response_deserialize(
|
|
577
|
+
response_data=response_data,
|
|
578
|
+
response_types_map=_response_types_map,
|
|
579
|
+
).data
|
|
580
|
+
|
|
581
|
+
@validate_call
|
|
582
|
+
def list_costs_for_customer_with_http_info(
|
|
583
|
+
self,
|
|
584
|
+
customer_account_id: Annotated[UUID, Field(description="ID of a customer account")],
|
|
585
|
+
var_from: Annotated[
|
|
586
|
+
date,
|
|
587
|
+
Field(
|
|
588
|
+
description="Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included."
|
|
589
|
+
),
|
|
590
|
+
],
|
|
591
|
+
to: Annotated[
|
|
592
|
+
date,
|
|
593
|
+
Field(
|
|
594
|
+
description="Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included."
|
|
595
|
+
),
|
|
596
|
+
],
|
|
597
|
+
depth: Annotated[
|
|
598
|
+
Optional[StrictStr],
|
|
599
|
+
Field(
|
|
600
|
+
description='Depth of desired cost information. "project" provides costs grouped by project, without services. "service" provides costs separated on service level.'
|
|
601
|
+
),
|
|
602
|
+
] = None,
|
|
603
|
+
granularity: Annotated[
|
|
604
|
+
Optional[StrictStr],
|
|
605
|
+
Field(
|
|
606
|
+
description='Define granularity of costs – Default is "none" which does NOT include detailed report data. If "monthly", "weekly" or "yearly" is requested, the "from" parameter SHOULD be the first day and the "to" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If "daily" is requested, the date range defined by "from" and "to" MUST NOT be longer than 92 days.'
|
|
607
|
+
),
|
|
608
|
+
] = None,
|
|
609
|
+
include_zero_costs: Annotated[
|
|
610
|
+
Optional[StrictBool], Field(description="Whether costs of 0 should be included in the response")
|
|
611
|
+
] = None,
|
|
612
|
+
accept: Annotated[Optional[StrictStr], Field(description="Desired content type")] = None,
|
|
613
|
+
_request_timeout: Union[
|
|
614
|
+
None,
|
|
615
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
616
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
617
|
+
] = None,
|
|
618
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
619
|
+
_content_type: Optional[StrictStr] = None,
|
|
620
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
621
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
622
|
+
) -> ApiResponse[List[ProjectCost]]:
|
|
623
|
+
"""V3 Costs for all projects
|
|
624
|
+
|
|
625
|
+
Get costs for all projects in a customer account
|
|
626
|
+
|
|
627
|
+
:param customer_account_id: ID of a customer account (required)
|
|
628
|
+
:type customer_account_id: UUID
|
|
629
|
+
:param var_from: Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included. (required)
|
|
630
|
+
:type var_from: date
|
|
631
|
+
:param to: Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included. (required)
|
|
632
|
+
:type to: date
|
|
633
|
+
:param depth: Depth of desired cost information. \"project\" provides costs grouped by project, without services. \"service\" provides costs separated on service level.
|
|
634
|
+
:type depth: str
|
|
635
|
+
:param granularity: Define granularity of costs – Default is \"none\" which does NOT include detailed report data. If \"monthly\", \"weekly\" or \"yearly\" is requested, the \"from\" parameter SHOULD be the first day and the \"to\" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If \"daily\" is requested, the date range defined by \"from\" and \"to\" MUST NOT be longer than 92 days.
|
|
636
|
+
:type granularity: str
|
|
637
|
+
:param include_zero_costs: Whether costs of 0 should be included in the response
|
|
638
|
+
:type include_zero_costs: bool
|
|
639
|
+
:param accept: Desired content type
|
|
640
|
+
:type accept: str
|
|
641
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
642
|
+
number provided, it will be total request
|
|
643
|
+
timeout. It can also be a pair (tuple) of
|
|
644
|
+
(connection, read) timeouts.
|
|
645
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
646
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
647
|
+
request; this effectively ignores the
|
|
648
|
+
authentication in the spec for a single request.
|
|
649
|
+
:type _request_auth: dict, optional
|
|
650
|
+
:param _content_type: force content-type for the request.
|
|
651
|
+
:type _content_type: str, Optional
|
|
652
|
+
:param _headers: set to override the headers for a single
|
|
653
|
+
request; this effectively ignores the headers
|
|
654
|
+
in the spec for a single request.
|
|
655
|
+
:type _headers: dict, optional
|
|
656
|
+
:param _host_index: set to override the host_index for a single
|
|
657
|
+
request; this effectively ignores the host_index
|
|
658
|
+
in the spec for a single request.
|
|
659
|
+
:type _host_index: int, optional
|
|
660
|
+
:return: Returns the result object.
|
|
661
|
+
""" # noqa: E501
|
|
662
|
+
|
|
663
|
+
_param = self._list_costs_for_customer_serialize(
|
|
664
|
+
customer_account_id=customer_account_id,
|
|
665
|
+
var_from=var_from,
|
|
666
|
+
to=to,
|
|
667
|
+
depth=depth,
|
|
668
|
+
granularity=granularity,
|
|
669
|
+
include_zero_costs=include_zero_costs,
|
|
670
|
+
accept=accept,
|
|
671
|
+
_request_auth=_request_auth,
|
|
672
|
+
_content_type=_content_type,
|
|
673
|
+
_headers=_headers,
|
|
674
|
+
_host_index=_host_index,
|
|
675
|
+
)
|
|
676
|
+
|
|
677
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
678
|
+
"200": "List[ProjectCost]",
|
|
679
|
+
"400": "ErrorResponse",
|
|
680
|
+
"401": "AuthErrorResponse",
|
|
681
|
+
"403": "AuthErrorResponse",
|
|
682
|
+
"404": "ErrorResponse",
|
|
683
|
+
}
|
|
684
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
685
|
+
response_data.read()
|
|
686
|
+
return self.api_client.response_deserialize(
|
|
687
|
+
response_data=response_data,
|
|
688
|
+
response_types_map=_response_types_map,
|
|
689
|
+
)
|
|
690
|
+
|
|
691
|
+
@validate_call
|
|
692
|
+
def list_costs_for_customer_without_preload_content(
|
|
693
|
+
self,
|
|
694
|
+
customer_account_id: Annotated[UUID, Field(description="ID of a customer account")],
|
|
695
|
+
var_from: Annotated[
|
|
696
|
+
date,
|
|
697
|
+
Field(
|
|
698
|
+
description="Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included."
|
|
699
|
+
),
|
|
700
|
+
],
|
|
701
|
+
to: Annotated[
|
|
702
|
+
date,
|
|
703
|
+
Field(
|
|
704
|
+
description="Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included."
|
|
705
|
+
),
|
|
706
|
+
],
|
|
707
|
+
depth: Annotated[
|
|
708
|
+
Optional[StrictStr],
|
|
709
|
+
Field(
|
|
710
|
+
description='Depth of desired cost information. "project" provides costs grouped by project, without services. "service" provides costs separated on service level.'
|
|
711
|
+
),
|
|
712
|
+
] = None,
|
|
713
|
+
granularity: Annotated[
|
|
714
|
+
Optional[StrictStr],
|
|
715
|
+
Field(
|
|
716
|
+
description='Define granularity of costs – Default is "none" which does NOT include detailed report data. If "monthly", "weekly" or "yearly" is requested, the "from" parameter SHOULD be the first day and the "to" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If "daily" is requested, the date range defined by "from" and "to" MUST NOT be longer than 92 days.'
|
|
717
|
+
),
|
|
718
|
+
] = None,
|
|
719
|
+
include_zero_costs: Annotated[
|
|
720
|
+
Optional[StrictBool], Field(description="Whether costs of 0 should be included in the response")
|
|
721
|
+
] = None,
|
|
722
|
+
accept: Annotated[Optional[StrictStr], Field(description="Desired content type")] = None,
|
|
723
|
+
_request_timeout: Union[
|
|
724
|
+
None,
|
|
725
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
726
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
727
|
+
] = None,
|
|
728
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
729
|
+
_content_type: Optional[StrictStr] = None,
|
|
730
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
731
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
732
|
+
) -> RESTResponseType:
|
|
733
|
+
"""V3 Costs for all projects
|
|
734
|
+
|
|
735
|
+
Get costs for all projects in a customer account
|
|
736
|
+
|
|
737
|
+
:param customer_account_id: ID of a customer account (required)
|
|
738
|
+
:type customer_account_id: UUID
|
|
739
|
+
:param var_from: Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included. (required)
|
|
740
|
+
:type var_from: date
|
|
741
|
+
:param to: Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included. (required)
|
|
742
|
+
:type to: date
|
|
743
|
+
:param depth: Depth of desired cost information. \"project\" provides costs grouped by project, without services. \"service\" provides costs separated on service level.
|
|
744
|
+
:type depth: str
|
|
745
|
+
:param granularity: Define granularity of costs – Default is \"none\" which does NOT include detailed report data. If \"monthly\", \"weekly\" or \"yearly\" is requested, the \"from\" parameter SHOULD be the first day and the \"to\" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If \"daily\" is requested, the date range defined by \"from\" and \"to\" MUST NOT be longer than 92 days.
|
|
746
|
+
:type granularity: str
|
|
747
|
+
:param include_zero_costs: Whether costs of 0 should be included in the response
|
|
748
|
+
:type include_zero_costs: bool
|
|
749
|
+
:param accept: Desired content type
|
|
750
|
+
:type accept: str
|
|
751
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
752
|
+
number provided, it will be total request
|
|
753
|
+
timeout. It can also be a pair (tuple) of
|
|
754
|
+
(connection, read) timeouts.
|
|
755
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
756
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
757
|
+
request; this effectively ignores the
|
|
758
|
+
authentication in the spec for a single request.
|
|
759
|
+
:type _request_auth: dict, optional
|
|
760
|
+
:param _content_type: force content-type for the request.
|
|
761
|
+
:type _content_type: str, Optional
|
|
762
|
+
:param _headers: set to override the headers for a single
|
|
763
|
+
request; this effectively ignores the headers
|
|
764
|
+
in the spec for a single request.
|
|
765
|
+
:type _headers: dict, optional
|
|
766
|
+
:param _host_index: set to override the host_index for a single
|
|
767
|
+
request; this effectively ignores the host_index
|
|
768
|
+
in the spec for a single request.
|
|
769
|
+
:type _host_index: int, optional
|
|
770
|
+
:return: Returns the result object.
|
|
771
|
+
""" # noqa: E501
|
|
772
|
+
|
|
773
|
+
_param = self._list_costs_for_customer_serialize(
|
|
774
|
+
customer_account_id=customer_account_id,
|
|
775
|
+
var_from=var_from,
|
|
776
|
+
to=to,
|
|
777
|
+
depth=depth,
|
|
778
|
+
granularity=granularity,
|
|
779
|
+
include_zero_costs=include_zero_costs,
|
|
780
|
+
accept=accept,
|
|
781
|
+
_request_auth=_request_auth,
|
|
782
|
+
_content_type=_content_type,
|
|
783
|
+
_headers=_headers,
|
|
784
|
+
_host_index=_host_index,
|
|
785
|
+
)
|
|
786
|
+
|
|
787
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
788
|
+
"200": "List[ProjectCost]",
|
|
789
|
+
"400": "ErrorResponse",
|
|
790
|
+
"401": "AuthErrorResponse",
|
|
791
|
+
"403": "AuthErrorResponse",
|
|
792
|
+
"404": "ErrorResponse",
|
|
793
|
+
}
|
|
794
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
795
|
+
return response_data.response
|
|
796
|
+
|
|
797
|
+
def _list_costs_for_customer_serialize(
|
|
798
|
+
self,
|
|
799
|
+
customer_account_id,
|
|
800
|
+
var_from,
|
|
801
|
+
to,
|
|
802
|
+
depth,
|
|
803
|
+
granularity,
|
|
804
|
+
include_zero_costs,
|
|
805
|
+
accept,
|
|
806
|
+
_request_auth,
|
|
807
|
+
_content_type,
|
|
808
|
+
_headers,
|
|
809
|
+
_host_index,
|
|
810
|
+
) -> RequestSerialized:
|
|
811
|
+
|
|
812
|
+
_host = None
|
|
813
|
+
|
|
814
|
+
_collection_formats: Dict[str, str] = {}
|
|
815
|
+
|
|
816
|
+
_path_params: Dict[str, str] = {}
|
|
817
|
+
_query_params: List[Tuple[str, str]] = []
|
|
818
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
819
|
+
_form_params: List[Tuple[str, str]] = []
|
|
820
|
+
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
|
821
|
+
_body_params: Optional[bytes] = None
|
|
822
|
+
|
|
823
|
+
# process the path parameters
|
|
824
|
+
if customer_account_id is not None:
|
|
825
|
+
_path_params["customerAccountId"] = customer_account_id
|
|
826
|
+
# process the query parameters
|
|
827
|
+
if var_from is not None:
|
|
828
|
+
if isinstance(var_from, date):
|
|
829
|
+
_query_params.append(("from", var_from.strftime(self.api_client.configuration.date_format)))
|
|
830
|
+
else:
|
|
831
|
+
_query_params.append(("from", var_from))
|
|
832
|
+
|
|
833
|
+
if to is not None:
|
|
834
|
+
if isinstance(to, date):
|
|
835
|
+
_query_params.append(("to", to.strftime(self.api_client.configuration.date_format)))
|
|
836
|
+
else:
|
|
837
|
+
_query_params.append(("to", to))
|
|
838
|
+
|
|
839
|
+
if depth is not None:
|
|
840
|
+
|
|
841
|
+
_query_params.append(("depth", depth))
|
|
842
|
+
|
|
843
|
+
if granularity is not None:
|
|
844
|
+
|
|
845
|
+
_query_params.append(("granularity", granularity))
|
|
846
|
+
|
|
847
|
+
if include_zero_costs is not None:
|
|
848
|
+
|
|
849
|
+
_query_params.append(("includeZeroCosts", include_zero_costs))
|
|
850
|
+
|
|
851
|
+
# process the header parameters
|
|
852
|
+
if accept is not None:
|
|
853
|
+
_header_params["Accept"] = accept
|
|
854
|
+
# process the form parameters
|
|
855
|
+
# process the body parameter
|
|
856
|
+
|
|
857
|
+
# set the HTTP header `Accept`
|
|
858
|
+
if "Accept" not in _header_params:
|
|
859
|
+
_header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/csv"])
|
|
860
|
+
|
|
861
|
+
# authentication setting
|
|
862
|
+
_auth_settings: List[str] = []
|
|
863
|
+
|
|
864
|
+
return self.api_client.param_serialize(
|
|
865
|
+
method="GET",
|
|
866
|
+
resource_path="/v3/costs/{customerAccountId}",
|
|
867
|
+
path_params=_path_params,
|
|
868
|
+
query_params=_query_params,
|
|
869
|
+
header_params=_header_params,
|
|
870
|
+
body=_body_params,
|
|
871
|
+
post_params=_form_params,
|
|
872
|
+
files=_files,
|
|
873
|
+
auth_settings=_auth_settings,
|
|
874
|
+
collection_formats=_collection_formats,
|
|
875
|
+
_host=_host,
|
|
876
|
+
_request_auth=_request_auth,
|
|
877
|
+
)
|
|
878
|
+
|
|
879
|
+
@validate_call
|
|
880
|
+
def list_costs_for_reseller(
|
|
881
|
+
self,
|
|
882
|
+
customer_account_id: Annotated[UUID, Field(description="ID of a customer account")],
|
|
883
|
+
var_from: Annotated[
|
|
884
|
+
date,
|
|
885
|
+
Field(
|
|
886
|
+
description="Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included."
|
|
887
|
+
),
|
|
888
|
+
],
|
|
889
|
+
to: Annotated[
|
|
890
|
+
date,
|
|
891
|
+
Field(
|
|
892
|
+
description="Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included."
|
|
893
|
+
),
|
|
894
|
+
],
|
|
895
|
+
depth: Annotated[
|
|
896
|
+
Optional[StrictStr],
|
|
897
|
+
Field(
|
|
898
|
+
description='Depth of desired cost information. "project" provides costs grouped by project, without services. "service" provides costs separated on service level.'
|
|
899
|
+
),
|
|
900
|
+
] = None,
|
|
901
|
+
granularity: Annotated[
|
|
902
|
+
Optional[StrictStr],
|
|
903
|
+
Field(
|
|
904
|
+
description='Define granularity of costs – Default is "none" which does NOT include detailed report data. If "monthly", "weekly" or "yearly" is requested, the "from" parameter SHOULD be the first day and the "to" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If "daily" is requested, the date range defined by "from" and "to" MUST NOT be longer than 92 days.'
|
|
905
|
+
),
|
|
906
|
+
] = None,
|
|
907
|
+
include_zero_costs: Annotated[
|
|
908
|
+
Optional[StrictBool], Field(description="Whether costs of 0 should be included in the response")
|
|
909
|
+
] = None,
|
|
910
|
+
accept: Annotated[Optional[StrictStr], Field(description="Desired content type")] = None,
|
|
911
|
+
_request_timeout: Union[
|
|
912
|
+
None,
|
|
913
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
914
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
915
|
+
] = None,
|
|
916
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
917
|
+
_content_type: Optional[StrictStr] = None,
|
|
918
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
919
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
920
|
+
) -> List[ProjectCost]:
|
|
921
|
+
"""V3 Costs for all projects of all related sub-customers
|
|
922
|
+
|
|
923
|
+
Get costs for all projects of all related sub-customer accounts
|
|
924
|
+
|
|
925
|
+
:param customer_account_id: ID of a customer account (required)
|
|
926
|
+
:type customer_account_id: UUID
|
|
927
|
+
:param var_from: Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included. (required)
|
|
928
|
+
:type var_from: date
|
|
929
|
+
:param to: Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included. (required)
|
|
930
|
+
:type to: date
|
|
931
|
+
:param depth: Depth of desired cost information. \"project\" provides costs grouped by project, without services. \"service\" provides costs separated on service level.
|
|
932
|
+
:type depth: str
|
|
933
|
+
:param granularity: Define granularity of costs – Default is \"none\" which does NOT include detailed report data. If \"monthly\", \"weekly\" or \"yearly\" is requested, the \"from\" parameter SHOULD be the first day and the \"to\" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If \"daily\" is requested, the date range defined by \"from\" and \"to\" MUST NOT be longer than 92 days.
|
|
934
|
+
:type granularity: str
|
|
935
|
+
:param include_zero_costs: Whether costs of 0 should be included in the response
|
|
936
|
+
:type include_zero_costs: bool
|
|
937
|
+
:param accept: Desired content type
|
|
938
|
+
:type accept: str
|
|
939
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
940
|
+
number provided, it will be total request
|
|
941
|
+
timeout. It can also be a pair (tuple) of
|
|
942
|
+
(connection, read) timeouts.
|
|
943
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
944
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
945
|
+
request; this effectively ignores the
|
|
946
|
+
authentication in the spec for a single request.
|
|
947
|
+
:type _request_auth: dict, optional
|
|
948
|
+
:param _content_type: force content-type for the request.
|
|
949
|
+
:type _content_type: str, Optional
|
|
950
|
+
:param _headers: set to override the headers for a single
|
|
951
|
+
request; this effectively ignores the headers
|
|
952
|
+
in the spec for a single request.
|
|
953
|
+
:type _headers: dict, optional
|
|
954
|
+
:param _host_index: set to override the host_index for a single
|
|
955
|
+
request; this effectively ignores the host_index
|
|
956
|
+
in the spec for a single request.
|
|
957
|
+
:type _host_index: int, optional
|
|
958
|
+
:return: Returns the result object.
|
|
959
|
+
""" # noqa: E501
|
|
960
|
+
|
|
961
|
+
_param = self._list_costs_for_reseller_serialize(
|
|
962
|
+
customer_account_id=customer_account_id,
|
|
963
|
+
var_from=var_from,
|
|
964
|
+
to=to,
|
|
965
|
+
depth=depth,
|
|
966
|
+
granularity=granularity,
|
|
967
|
+
include_zero_costs=include_zero_costs,
|
|
968
|
+
accept=accept,
|
|
969
|
+
_request_auth=_request_auth,
|
|
970
|
+
_content_type=_content_type,
|
|
971
|
+
_headers=_headers,
|
|
972
|
+
_host_index=_host_index,
|
|
973
|
+
)
|
|
974
|
+
|
|
975
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
976
|
+
"200": "List[ProjectCost]",
|
|
977
|
+
"400": "ErrorResponse",
|
|
978
|
+
"401": "AuthErrorResponse",
|
|
979
|
+
"403": "AuthErrorResponse",
|
|
980
|
+
"404": "ErrorResponse",
|
|
981
|
+
}
|
|
982
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
983
|
+
response_data.read()
|
|
984
|
+
return self.api_client.response_deserialize(
|
|
985
|
+
response_data=response_data,
|
|
986
|
+
response_types_map=_response_types_map,
|
|
987
|
+
).data
|
|
988
|
+
|
|
989
|
+
@validate_call
|
|
990
|
+
def list_costs_for_reseller_with_http_info(
|
|
991
|
+
self,
|
|
992
|
+
customer_account_id: Annotated[UUID, Field(description="ID of a customer account")],
|
|
993
|
+
var_from: Annotated[
|
|
994
|
+
date,
|
|
995
|
+
Field(
|
|
996
|
+
description="Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included."
|
|
997
|
+
),
|
|
998
|
+
],
|
|
999
|
+
to: Annotated[
|
|
1000
|
+
date,
|
|
1001
|
+
Field(
|
|
1002
|
+
description="Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included."
|
|
1003
|
+
),
|
|
1004
|
+
],
|
|
1005
|
+
depth: Annotated[
|
|
1006
|
+
Optional[StrictStr],
|
|
1007
|
+
Field(
|
|
1008
|
+
description='Depth of desired cost information. "project" provides costs grouped by project, without services. "service" provides costs separated on service level.'
|
|
1009
|
+
),
|
|
1010
|
+
] = None,
|
|
1011
|
+
granularity: Annotated[
|
|
1012
|
+
Optional[StrictStr],
|
|
1013
|
+
Field(
|
|
1014
|
+
description='Define granularity of costs – Default is "none" which does NOT include detailed report data. If "monthly", "weekly" or "yearly" is requested, the "from" parameter SHOULD be the first day and the "to" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If "daily" is requested, the date range defined by "from" and "to" MUST NOT be longer than 92 days.'
|
|
1015
|
+
),
|
|
1016
|
+
] = None,
|
|
1017
|
+
include_zero_costs: Annotated[
|
|
1018
|
+
Optional[StrictBool], Field(description="Whether costs of 0 should be included in the response")
|
|
1019
|
+
] = None,
|
|
1020
|
+
accept: Annotated[Optional[StrictStr], Field(description="Desired content type")] = None,
|
|
1021
|
+
_request_timeout: Union[
|
|
1022
|
+
None,
|
|
1023
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1024
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
1025
|
+
] = None,
|
|
1026
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1027
|
+
_content_type: Optional[StrictStr] = None,
|
|
1028
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1029
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1030
|
+
) -> ApiResponse[List[ProjectCost]]:
|
|
1031
|
+
"""V3 Costs for all projects of all related sub-customers
|
|
1032
|
+
|
|
1033
|
+
Get costs for all projects of all related sub-customer accounts
|
|
1034
|
+
|
|
1035
|
+
:param customer_account_id: ID of a customer account (required)
|
|
1036
|
+
:type customer_account_id: UUID
|
|
1037
|
+
:param var_from: Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included. (required)
|
|
1038
|
+
:type var_from: date
|
|
1039
|
+
:param to: Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included. (required)
|
|
1040
|
+
:type to: date
|
|
1041
|
+
:param depth: Depth of desired cost information. \"project\" provides costs grouped by project, without services. \"service\" provides costs separated on service level.
|
|
1042
|
+
:type depth: str
|
|
1043
|
+
:param granularity: Define granularity of costs – Default is \"none\" which does NOT include detailed report data. If \"monthly\", \"weekly\" or \"yearly\" is requested, the \"from\" parameter SHOULD be the first day and the \"to\" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If \"daily\" is requested, the date range defined by \"from\" and \"to\" MUST NOT be longer than 92 days.
|
|
1044
|
+
:type granularity: str
|
|
1045
|
+
:param include_zero_costs: Whether costs of 0 should be included in the response
|
|
1046
|
+
:type include_zero_costs: bool
|
|
1047
|
+
:param accept: Desired content type
|
|
1048
|
+
:type accept: str
|
|
1049
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1050
|
+
number provided, it will be total request
|
|
1051
|
+
timeout. It can also be a pair (tuple) of
|
|
1052
|
+
(connection, read) timeouts.
|
|
1053
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1054
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1055
|
+
request; this effectively ignores the
|
|
1056
|
+
authentication in the spec for a single request.
|
|
1057
|
+
:type _request_auth: dict, optional
|
|
1058
|
+
:param _content_type: force content-type for the request.
|
|
1059
|
+
:type _content_type: str, Optional
|
|
1060
|
+
:param _headers: set to override the headers for a single
|
|
1061
|
+
request; this effectively ignores the headers
|
|
1062
|
+
in the spec for a single request.
|
|
1063
|
+
:type _headers: dict, optional
|
|
1064
|
+
:param _host_index: set to override the host_index for a single
|
|
1065
|
+
request; this effectively ignores the host_index
|
|
1066
|
+
in the spec for a single request.
|
|
1067
|
+
:type _host_index: int, optional
|
|
1068
|
+
:return: Returns the result object.
|
|
1069
|
+
""" # noqa: E501
|
|
1070
|
+
|
|
1071
|
+
_param = self._list_costs_for_reseller_serialize(
|
|
1072
|
+
customer_account_id=customer_account_id,
|
|
1073
|
+
var_from=var_from,
|
|
1074
|
+
to=to,
|
|
1075
|
+
depth=depth,
|
|
1076
|
+
granularity=granularity,
|
|
1077
|
+
include_zero_costs=include_zero_costs,
|
|
1078
|
+
accept=accept,
|
|
1079
|
+
_request_auth=_request_auth,
|
|
1080
|
+
_content_type=_content_type,
|
|
1081
|
+
_headers=_headers,
|
|
1082
|
+
_host_index=_host_index,
|
|
1083
|
+
)
|
|
1084
|
+
|
|
1085
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1086
|
+
"200": "List[ProjectCost]",
|
|
1087
|
+
"400": "ErrorResponse",
|
|
1088
|
+
"401": "AuthErrorResponse",
|
|
1089
|
+
"403": "AuthErrorResponse",
|
|
1090
|
+
"404": "ErrorResponse",
|
|
1091
|
+
}
|
|
1092
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
1093
|
+
response_data.read()
|
|
1094
|
+
return self.api_client.response_deserialize(
|
|
1095
|
+
response_data=response_data,
|
|
1096
|
+
response_types_map=_response_types_map,
|
|
1097
|
+
)
|
|
1098
|
+
|
|
1099
|
+
@validate_call
|
|
1100
|
+
def list_costs_for_reseller_without_preload_content(
|
|
1101
|
+
self,
|
|
1102
|
+
customer_account_id: Annotated[UUID, Field(description="ID of a customer account")],
|
|
1103
|
+
var_from: Annotated[
|
|
1104
|
+
date,
|
|
1105
|
+
Field(
|
|
1106
|
+
description="Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included."
|
|
1107
|
+
),
|
|
1108
|
+
],
|
|
1109
|
+
to: Annotated[
|
|
1110
|
+
date,
|
|
1111
|
+
Field(
|
|
1112
|
+
description="Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included."
|
|
1113
|
+
),
|
|
1114
|
+
],
|
|
1115
|
+
depth: Annotated[
|
|
1116
|
+
Optional[StrictStr],
|
|
1117
|
+
Field(
|
|
1118
|
+
description='Depth of desired cost information. "project" provides costs grouped by project, without services. "service" provides costs separated on service level.'
|
|
1119
|
+
),
|
|
1120
|
+
] = None,
|
|
1121
|
+
granularity: Annotated[
|
|
1122
|
+
Optional[StrictStr],
|
|
1123
|
+
Field(
|
|
1124
|
+
description='Define granularity of costs – Default is "none" which does NOT include detailed report data. If "monthly", "weekly" or "yearly" is requested, the "from" parameter SHOULD be the first day and the "to" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If "daily" is requested, the date range defined by "from" and "to" MUST NOT be longer than 92 days.'
|
|
1125
|
+
),
|
|
1126
|
+
] = None,
|
|
1127
|
+
include_zero_costs: Annotated[
|
|
1128
|
+
Optional[StrictBool], Field(description="Whether costs of 0 should be included in the response")
|
|
1129
|
+
] = None,
|
|
1130
|
+
accept: Annotated[Optional[StrictStr], Field(description="Desired content type")] = None,
|
|
1131
|
+
_request_timeout: Union[
|
|
1132
|
+
None,
|
|
1133
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1134
|
+
Tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
|
|
1135
|
+
] = None,
|
|
1136
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1137
|
+
_content_type: Optional[StrictStr] = None,
|
|
1138
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1139
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1140
|
+
) -> RESTResponseType:
|
|
1141
|
+
"""V3 Costs for all projects of all related sub-customers
|
|
1142
|
+
|
|
1143
|
+
Get costs for all projects of all related sub-customer accounts
|
|
1144
|
+
|
|
1145
|
+
:param customer_account_id: ID of a customer account (required)
|
|
1146
|
+
:type customer_account_id: UUID
|
|
1147
|
+
:param var_from: Inclusive start date of the selection range. Internally, usages are recorded in UTC. This means all usages starting on and after 00:00:00 UTC on the specified date are included. (required)
|
|
1148
|
+
:type var_from: date
|
|
1149
|
+
:param to: Inclusive end date of the selection range. Internally, usages are recorded in UTC. This means all usages starting up to and including 23:59:59 UTC on the specified date are included. (required)
|
|
1150
|
+
:type to: date
|
|
1151
|
+
:param depth: Depth of desired cost information. \"project\" provides costs grouped by project, without services. \"service\" provides costs separated on service level.
|
|
1152
|
+
:type depth: str
|
|
1153
|
+
:param granularity: Define granularity of costs – Default is \"none\" which does NOT include detailed report data. If \"monthly\", \"weekly\" or \"yearly\" is requested, the \"from\" parameter SHOULD be the first day and the \"to\" parameter SHOULD be the last day of that time period. If not, they are normalized accordingly. If \"daily\" is requested, the date range defined by \"from\" and \"to\" MUST NOT be longer than 92 days.
|
|
1154
|
+
:type granularity: str
|
|
1155
|
+
:param include_zero_costs: Whether costs of 0 should be included in the response
|
|
1156
|
+
:type include_zero_costs: bool
|
|
1157
|
+
:param accept: Desired content type
|
|
1158
|
+
:type accept: str
|
|
1159
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1160
|
+
number provided, it will be total request
|
|
1161
|
+
timeout. It can also be a pair (tuple) of
|
|
1162
|
+
(connection, read) timeouts.
|
|
1163
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1164
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1165
|
+
request; this effectively ignores the
|
|
1166
|
+
authentication in the spec for a single request.
|
|
1167
|
+
:type _request_auth: dict, optional
|
|
1168
|
+
:param _content_type: force content-type for the request.
|
|
1169
|
+
:type _content_type: str, Optional
|
|
1170
|
+
:param _headers: set to override the headers for a single
|
|
1171
|
+
request; this effectively ignores the headers
|
|
1172
|
+
in the spec for a single request.
|
|
1173
|
+
:type _headers: dict, optional
|
|
1174
|
+
:param _host_index: set to override the host_index for a single
|
|
1175
|
+
request; this effectively ignores the host_index
|
|
1176
|
+
in the spec for a single request.
|
|
1177
|
+
:type _host_index: int, optional
|
|
1178
|
+
:return: Returns the result object.
|
|
1179
|
+
""" # noqa: E501
|
|
1180
|
+
|
|
1181
|
+
_param = self._list_costs_for_reseller_serialize(
|
|
1182
|
+
customer_account_id=customer_account_id,
|
|
1183
|
+
var_from=var_from,
|
|
1184
|
+
to=to,
|
|
1185
|
+
depth=depth,
|
|
1186
|
+
granularity=granularity,
|
|
1187
|
+
include_zero_costs=include_zero_costs,
|
|
1188
|
+
accept=accept,
|
|
1189
|
+
_request_auth=_request_auth,
|
|
1190
|
+
_content_type=_content_type,
|
|
1191
|
+
_headers=_headers,
|
|
1192
|
+
_host_index=_host_index,
|
|
1193
|
+
)
|
|
1194
|
+
|
|
1195
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1196
|
+
"200": "List[ProjectCost]",
|
|
1197
|
+
"400": "ErrorResponse",
|
|
1198
|
+
"401": "AuthErrorResponse",
|
|
1199
|
+
"403": "AuthErrorResponse",
|
|
1200
|
+
"404": "ErrorResponse",
|
|
1201
|
+
}
|
|
1202
|
+
response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
|
|
1203
|
+
return response_data.response
|
|
1204
|
+
|
|
1205
|
+
def _list_costs_for_reseller_serialize(
|
|
1206
|
+
self,
|
|
1207
|
+
customer_account_id,
|
|
1208
|
+
var_from,
|
|
1209
|
+
to,
|
|
1210
|
+
depth,
|
|
1211
|
+
granularity,
|
|
1212
|
+
include_zero_costs,
|
|
1213
|
+
accept,
|
|
1214
|
+
_request_auth,
|
|
1215
|
+
_content_type,
|
|
1216
|
+
_headers,
|
|
1217
|
+
_host_index,
|
|
1218
|
+
) -> RequestSerialized:
|
|
1219
|
+
|
|
1220
|
+
_host = None
|
|
1221
|
+
|
|
1222
|
+
_collection_formats: Dict[str, str] = {}
|
|
1223
|
+
|
|
1224
|
+
_path_params: Dict[str, str] = {}
|
|
1225
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1226
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1227
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1228
|
+
_files: Dict[str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]] = {}
|
|
1229
|
+
_body_params: Optional[bytes] = None
|
|
1230
|
+
|
|
1231
|
+
# process the path parameters
|
|
1232
|
+
if customer_account_id is not None:
|
|
1233
|
+
_path_params["customerAccountId"] = customer_account_id
|
|
1234
|
+
# process the query parameters
|
|
1235
|
+
if var_from is not None:
|
|
1236
|
+
if isinstance(var_from, date):
|
|
1237
|
+
_query_params.append(("from", var_from.strftime(self.api_client.configuration.date_format)))
|
|
1238
|
+
else:
|
|
1239
|
+
_query_params.append(("from", var_from))
|
|
1240
|
+
|
|
1241
|
+
if to is not None:
|
|
1242
|
+
if isinstance(to, date):
|
|
1243
|
+
_query_params.append(("to", to.strftime(self.api_client.configuration.date_format)))
|
|
1244
|
+
else:
|
|
1245
|
+
_query_params.append(("to", to))
|
|
1246
|
+
|
|
1247
|
+
if depth is not None:
|
|
1248
|
+
|
|
1249
|
+
_query_params.append(("depth", depth))
|
|
1250
|
+
|
|
1251
|
+
if granularity is not None:
|
|
1252
|
+
|
|
1253
|
+
_query_params.append(("granularity", granularity))
|
|
1254
|
+
|
|
1255
|
+
if include_zero_costs is not None:
|
|
1256
|
+
|
|
1257
|
+
_query_params.append(("includeZeroCosts", include_zero_costs))
|
|
1258
|
+
|
|
1259
|
+
# process the header parameters
|
|
1260
|
+
if accept is not None:
|
|
1261
|
+
_header_params["Accept"] = accept
|
|
1262
|
+
# process the form parameters
|
|
1263
|
+
# process the body parameter
|
|
1264
|
+
|
|
1265
|
+
# set the HTTP header `Accept`
|
|
1266
|
+
if "Accept" not in _header_params:
|
|
1267
|
+
_header_params["Accept"] = self.api_client.select_header_accept(["application/json", "text/csv"])
|
|
1268
|
+
|
|
1269
|
+
# authentication setting
|
|
1270
|
+
_auth_settings: List[str] = []
|
|
1271
|
+
|
|
1272
|
+
return self.api_client.param_serialize(
|
|
1273
|
+
method="GET",
|
|
1274
|
+
resource_path="/v3/costs/{customerAccountId}/customers",
|
|
1275
|
+
path_params=_path_params,
|
|
1276
|
+
query_params=_query_params,
|
|
1277
|
+
header_params=_header_params,
|
|
1278
|
+
body=_body_params,
|
|
1279
|
+
post_params=_form_params,
|
|
1280
|
+
files=_files,
|
|
1281
|
+
auth_settings=_auth_settings,
|
|
1282
|
+
collection_formats=_collection_formats,
|
|
1283
|
+
_host=_host,
|
|
1284
|
+
_request_auth=_request_auth,
|
|
1285
|
+
)
|