athena-intelligence 0.1.197__py3-none-any.whl → 0.1.199__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.
- athena/__init__.py +4 -0
- athena/core/client_wrapper.py +2 -2
- athena/tools/__init__.py +2 -2
- athena/tools/client.py +5 -0
- athena/tools/sheets/__init__.py +4 -0
- athena/tools/sheets/client.py +1918 -0
- athena/tools/sheets/raw_client.py +2306 -0
- athena/types/__init__.py +4 -0
- athena/types/create_new_sheet_tab_response.py +37 -0
- athena/types/sheet_operation_response.py +32 -0
- {athena_intelligence-0.1.197.dist-info → athena_intelligence-0.1.199.dist-info}/METADATA +1 -1
- {athena_intelligence-0.1.197.dist-info → athena_intelligence-0.1.199.dist-info}/RECORD +13 -8
- {athena_intelligence-0.1.197.dist-info → athena_intelligence-0.1.199.dist-info}/WHEEL +0 -0
@@ -0,0 +1,2306 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import typing
|
4
|
+
from json.decoder import JSONDecodeError
|
5
|
+
|
6
|
+
from ...core.api_error import ApiError
|
7
|
+
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
8
|
+
from ...core.http_response import AsyncHttpResponse, HttpResponse
|
9
|
+
from ...core.pydantic_utilities import parse_obj_as
|
10
|
+
from ...core.request_options import RequestOptions
|
11
|
+
from ...errors.unprocessable_entity_error import UnprocessableEntityError
|
12
|
+
from ...types.create_new_sheet_tab_response import CreateNewSheetTabResponse
|
13
|
+
from ...types.sheet_operation_response import SheetOperationResponse
|
14
|
+
|
15
|
+
# this is used as the default value for optional parameters
|
16
|
+
OMIT = typing.cast(typing.Any, ...)
|
17
|
+
|
18
|
+
|
19
|
+
class RawSheetsClient:
|
20
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
21
|
+
self._client_wrapper = client_wrapper
|
22
|
+
|
23
|
+
def update_cell(
|
24
|
+
self,
|
25
|
+
*,
|
26
|
+
asset_id: str,
|
27
|
+
column: int,
|
28
|
+
row: int,
|
29
|
+
value: str,
|
30
|
+
sheet_id: typing.Optional[int] = OMIT,
|
31
|
+
request_options: typing.Optional[RequestOptions] = None,
|
32
|
+
) -> HttpResponse[SheetOperationResponse]:
|
33
|
+
"""
|
34
|
+
Update a single cell in an Athena spreadsheet.
|
35
|
+
|
36
|
+
Parameters
|
37
|
+
----------
|
38
|
+
asset_id : str
|
39
|
+
The ID of the spreadsheet asset
|
40
|
+
|
41
|
+
column : int
|
42
|
+
1-based column index (e.g., 1 = column A)
|
43
|
+
|
44
|
+
row : int
|
45
|
+
1-based row index (e.g., 1 = first row)
|
46
|
+
|
47
|
+
value : str
|
48
|
+
Value to set in the cell
|
49
|
+
|
50
|
+
sheet_id : typing.Optional[int]
|
51
|
+
Sheet ID (defaults to 1)
|
52
|
+
|
53
|
+
request_options : typing.Optional[RequestOptions]
|
54
|
+
Request-specific configuration.
|
55
|
+
|
56
|
+
Returns
|
57
|
+
-------
|
58
|
+
HttpResponse[SheetOperationResponse]
|
59
|
+
Successful Response
|
60
|
+
"""
|
61
|
+
_response = self._client_wrapper.httpx_client.request(
|
62
|
+
"api/v0/tools/sheets/cell/update",
|
63
|
+
method="POST",
|
64
|
+
json={
|
65
|
+
"asset_id": asset_id,
|
66
|
+
"column": column,
|
67
|
+
"row": row,
|
68
|
+
"sheet_id": sheet_id,
|
69
|
+
"value": value,
|
70
|
+
},
|
71
|
+
headers={
|
72
|
+
"content-type": "application/json",
|
73
|
+
},
|
74
|
+
request_options=request_options,
|
75
|
+
omit=OMIT,
|
76
|
+
)
|
77
|
+
try:
|
78
|
+
if 200 <= _response.status_code < 300:
|
79
|
+
_data = typing.cast(
|
80
|
+
SheetOperationResponse,
|
81
|
+
parse_obj_as(
|
82
|
+
type_=SheetOperationResponse, # type: ignore
|
83
|
+
object_=_response.json(),
|
84
|
+
),
|
85
|
+
)
|
86
|
+
return HttpResponse(response=_response, data=_data)
|
87
|
+
if _response.status_code == 422:
|
88
|
+
raise UnprocessableEntityError(
|
89
|
+
headers=dict(_response.headers),
|
90
|
+
body=typing.cast(
|
91
|
+
typing.Optional[typing.Any],
|
92
|
+
parse_obj_as(
|
93
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
94
|
+
object_=_response.json(),
|
95
|
+
),
|
96
|
+
),
|
97
|
+
)
|
98
|
+
_response_json = _response.json()
|
99
|
+
except JSONDecodeError:
|
100
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
101
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
102
|
+
|
103
|
+
def delete_cells(
|
104
|
+
self,
|
105
|
+
*,
|
106
|
+
asset_id: str,
|
107
|
+
end_column_index: int,
|
108
|
+
end_row_index: int,
|
109
|
+
start_column_index: int,
|
110
|
+
start_row_index: int,
|
111
|
+
sheet_id: typing.Optional[int] = OMIT,
|
112
|
+
request_options: typing.Optional[RequestOptions] = None,
|
113
|
+
) -> HttpResponse[SheetOperationResponse]:
|
114
|
+
"""
|
115
|
+
Delete cells from an Athena spreadsheet.
|
116
|
+
|
117
|
+
Parameters
|
118
|
+
----------
|
119
|
+
asset_id : str
|
120
|
+
The ID of the spreadsheet asset
|
121
|
+
|
122
|
+
end_column_index : int
|
123
|
+
1-based ending column index
|
124
|
+
|
125
|
+
end_row_index : int
|
126
|
+
1-based ending row index
|
127
|
+
|
128
|
+
start_column_index : int
|
129
|
+
1-based starting column index
|
130
|
+
|
131
|
+
start_row_index : int
|
132
|
+
1-based starting row index
|
133
|
+
|
134
|
+
sheet_id : typing.Optional[int]
|
135
|
+
Sheet ID (defaults to 1)
|
136
|
+
|
137
|
+
request_options : typing.Optional[RequestOptions]
|
138
|
+
Request-specific configuration.
|
139
|
+
|
140
|
+
Returns
|
141
|
+
-------
|
142
|
+
HttpResponse[SheetOperationResponse]
|
143
|
+
Successful Response
|
144
|
+
"""
|
145
|
+
_response = self._client_wrapper.httpx_client.request(
|
146
|
+
"api/v0/tools/sheets/cells/delete",
|
147
|
+
method="POST",
|
148
|
+
json={
|
149
|
+
"asset_id": asset_id,
|
150
|
+
"end_column_index": end_column_index,
|
151
|
+
"end_row_index": end_row_index,
|
152
|
+
"sheet_id": sheet_id,
|
153
|
+
"start_column_index": start_column_index,
|
154
|
+
"start_row_index": start_row_index,
|
155
|
+
},
|
156
|
+
headers={
|
157
|
+
"content-type": "application/json",
|
158
|
+
},
|
159
|
+
request_options=request_options,
|
160
|
+
omit=OMIT,
|
161
|
+
)
|
162
|
+
try:
|
163
|
+
if 200 <= _response.status_code < 300:
|
164
|
+
_data = typing.cast(
|
165
|
+
SheetOperationResponse,
|
166
|
+
parse_obj_as(
|
167
|
+
type_=SheetOperationResponse, # type: ignore
|
168
|
+
object_=_response.json(),
|
169
|
+
),
|
170
|
+
)
|
171
|
+
return HttpResponse(response=_response, data=_data)
|
172
|
+
if _response.status_code == 422:
|
173
|
+
raise UnprocessableEntityError(
|
174
|
+
headers=dict(_response.headers),
|
175
|
+
body=typing.cast(
|
176
|
+
typing.Optional[typing.Any],
|
177
|
+
parse_obj_as(
|
178
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
179
|
+
object_=_response.json(),
|
180
|
+
),
|
181
|
+
),
|
182
|
+
)
|
183
|
+
_response_json = _response.json()
|
184
|
+
except JSONDecodeError:
|
185
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
186
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
187
|
+
|
188
|
+
def delete_column(
|
189
|
+
self,
|
190
|
+
*,
|
191
|
+
asset_id: str,
|
192
|
+
column_indexes: typing.Sequence[int],
|
193
|
+
sheet_id: typing.Optional[int] = OMIT,
|
194
|
+
request_options: typing.Optional[RequestOptions] = None,
|
195
|
+
) -> HttpResponse[SheetOperationResponse]:
|
196
|
+
"""
|
197
|
+
Delete columns from an Athena spreadsheet.
|
198
|
+
|
199
|
+
Parameters
|
200
|
+
----------
|
201
|
+
asset_id : str
|
202
|
+
The ID of the spreadsheet asset
|
203
|
+
|
204
|
+
column_indexes : typing.Sequence[int]
|
205
|
+
List of 1-based column indexes to delete
|
206
|
+
|
207
|
+
sheet_id : typing.Optional[int]
|
208
|
+
Sheet ID (defaults to 1)
|
209
|
+
|
210
|
+
request_options : typing.Optional[RequestOptions]
|
211
|
+
Request-specific configuration.
|
212
|
+
|
213
|
+
Returns
|
214
|
+
-------
|
215
|
+
HttpResponse[SheetOperationResponse]
|
216
|
+
Successful Response
|
217
|
+
"""
|
218
|
+
_response = self._client_wrapper.httpx_client.request(
|
219
|
+
"api/v0/tools/sheets/column/delete",
|
220
|
+
method="POST",
|
221
|
+
json={
|
222
|
+
"asset_id": asset_id,
|
223
|
+
"column_indexes": column_indexes,
|
224
|
+
"sheet_id": sheet_id,
|
225
|
+
},
|
226
|
+
headers={
|
227
|
+
"content-type": "application/json",
|
228
|
+
},
|
229
|
+
request_options=request_options,
|
230
|
+
omit=OMIT,
|
231
|
+
)
|
232
|
+
try:
|
233
|
+
if 200 <= _response.status_code < 300:
|
234
|
+
_data = typing.cast(
|
235
|
+
SheetOperationResponse,
|
236
|
+
parse_obj_as(
|
237
|
+
type_=SheetOperationResponse, # type: ignore
|
238
|
+
object_=_response.json(),
|
239
|
+
),
|
240
|
+
)
|
241
|
+
return HttpResponse(response=_response, data=_data)
|
242
|
+
if _response.status_code == 422:
|
243
|
+
raise UnprocessableEntityError(
|
244
|
+
headers=dict(_response.headers),
|
245
|
+
body=typing.cast(
|
246
|
+
typing.Optional[typing.Any],
|
247
|
+
parse_obj_as(
|
248
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
249
|
+
object_=_response.json(),
|
250
|
+
),
|
251
|
+
),
|
252
|
+
)
|
253
|
+
_response_json = _response.json()
|
254
|
+
except JSONDecodeError:
|
255
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
256
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
257
|
+
|
258
|
+
def insert_column(
|
259
|
+
self,
|
260
|
+
*,
|
261
|
+
asset_id: str,
|
262
|
+
reference_column_index: int,
|
263
|
+
sheet_id: typing.Optional[int] = OMIT,
|
264
|
+
request_options: typing.Optional[RequestOptions] = None,
|
265
|
+
) -> HttpResponse[SheetOperationResponse]:
|
266
|
+
"""
|
267
|
+
Insert a column in an Athena spreadsheet.
|
268
|
+
|
269
|
+
Parameters
|
270
|
+
----------
|
271
|
+
asset_id : str
|
272
|
+
The ID of the spreadsheet asset
|
273
|
+
|
274
|
+
reference_column_index : int
|
275
|
+
1-based reference column index where to insert
|
276
|
+
|
277
|
+
sheet_id : typing.Optional[int]
|
278
|
+
Sheet ID (defaults to 1)
|
279
|
+
|
280
|
+
request_options : typing.Optional[RequestOptions]
|
281
|
+
Request-specific configuration.
|
282
|
+
|
283
|
+
Returns
|
284
|
+
-------
|
285
|
+
HttpResponse[SheetOperationResponse]
|
286
|
+
Successful Response
|
287
|
+
"""
|
288
|
+
_response = self._client_wrapper.httpx_client.request(
|
289
|
+
"api/v0/tools/sheets/column/insert",
|
290
|
+
method="POST",
|
291
|
+
json={
|
292
|
+
"asset_id": asset_id,
|
293
|
+
"reference_column_index": reference_column_index,
|
294
|
+
"sheet_id": sheet_id,
|
295
|
+
},
|
296
|
+
headers={
|
297
|
+
"content-type": "application/json",
|
298
|
+
},
|
299
|
+
request_options=request_options,
|
300
|
+
omit=OMIT,
|
301
|
+
)
|
302
|
+
try:
|
303
|
+
if 200 <= _response.status_code < 300:
|
304
|
+
_data = typing.cast(
|
305
|
+
SheetOperationResponse,
|
306
|
+
parse_obj_as(
|
307
|
+
type_=SheetOperationResponse, # type: ignore
|
308
|
+
object_=_response.json(),
|
309
|
+
),
|
310
|
+
)
|
311
|
+
return HttpResponse(response=_response, data=_data)
|
312
|
+
if _response.status_code == 422:
|
313
|
+
raise UnprocessableEntityError(
|
314
|
+
headers=dict(_response.headers),
|
315
|
+
body=typing.cast(
|
316
|
+
typing.Optional[typing.Any],
|
317
|
+
parse_obj_as(
|
318
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
319
|
+
object_=_response.json(),
|
320
|
+
),
|
321
|
+
),
|
322
|
+
)
|
323
|
+
_response_json = _response.json()
|
324
|
+
except JSONDecodeError:
|
325
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
326
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
327
|
+
|
328
|
+
def clear_formatting(
|
329
|
+
self,
|
330
|
+
*,
|
331
|
+
asset_id: str,
|
332
|
+
end_column_index: int,
|
333
|
+
end_row_index: int,
|
334
|
+
start_column_index: int,
|
335
|
+
start_row_index: int,
|
336
|
+
sheet_id: typing.Optional[int] = OMIT,
|
337
|
+
request_options: typing.Optional[RequestOptions] = None,
|
338
|
+
) -> HttpResponse[SheetOperationResponse]:
|
339
|
+
"""
|
340
|
+
Clear formatting from cells in an Athena spreadsheet.
|
341
|
+
|
342
|
+
Parameters
|
343
|
+
----------
|
344
|
+
asset_id : str
|
345
|
+
The ID of the spreadsheet asset
|
346
|
+
|
347
|
+
end_column_index : int
|
348
|
+
1-based ending column index
|
349
|
+
|
350
|
+
end_row_index : int
|
351
|
+
1-based ending row index
|
352
|
+
|
353
|
+
start_column_index : int
|
354
|
+
1-based starting column index
|
355
|
+
|
356
|
+
start_row_index : int
|
357
|
+
1-based starting row index
|
358
|
+
|
359
|
+
sheet_id : typing.Optional[int]
|
360
|
+
Sheet ID (defaults to 1)
|
361
|
+
|
362
|
+
request_options : typing.Optional[RequestOptions]
|
363
|
+
Request-specific configuration.
|
364
|
+
|
365
|
+
Returns
|
366
|
+
-------
|
367
|
+
HttpResponse[SheetOperationResponse]
|
368
|
+
Successful Response
|
369
|
+
"""
|
370
|
+
_response = self._client_wrapper.httpx_client.request(
|
371
|
+
"api/v0/tools/sheets/formatting/clear",
|
372
|
+
method="POST",
|
373
|
+
json={
|
374
|
+
"asset_id": asset_id,
|
375
|
+
"end_column_index": end_column_index,
|
376
|
+
"end_row_index": end_row_index,
|
377
|
+
"sheet_id": sheet_id,
|
378
|
+
"start_column_index": start_column_index,
|
379
|
+
"start_row_index": start_row_index,
|
380
|
+
},
|
381
|
+
headers={
|
382
|
+
"content-type": "application/json",
|
383
|
+
},
|
384
|
+
request_options=request_options,
|
385
|
+
omit=OMIT,
|
386
|
+
)
|
387
|
+
try:
|
388
|
+
if 200 <= _response.status_code < 300:
|
389
|
+
_data = typing.cast(
|
390
|
+
SheetOperationResponse,
|
391
|
+
parse_obj_as(
|
392
|
+
type_=SheetOperationResponse, # type: ignore
|
393
|
+
object_=_response.json(),
|
394
|
+
),
|
395
|
+
)
|
396
|
+
return HttpResponse(response=_response, data=_data)
|
397
|
+
if _response.status_code == 422:
|
398
|
+
raise UnprocessableEntityError(
|
399
|
+
headers=dict(_response.headers),
|
400
|
+
body=typing.cast(
|
401
|
+
typing.Optional[typing.Any],
|
402
|
+
parse_obj_as(
|
403
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
404
|
+
object_=_response.json(),
|
405
|
+
),
|
406
|
+
),
|
407
|
+
)
|
408
|
+
_response_json = _response.json()
|
409
|
+
except JSONDecodeError:
|
410
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
411
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
412
|
+
|
413
|
+
def clear_range(
|
414
|
+
self,
|
415
|
+
*,
|
416
|
+
asset_id: str,
|
417
|
+
num_columns: int,
|
418
|
+
num_rows: int,
|
419
|
+
start_column: int,
|
420
|
+
start_row: int,
|
421
|
+
sheet_id: typing.Optional[int] = OMIT,
|
422
|
+
request_options: typing.Optional[RequestOptions] = None,
|
423
|
+
) -> HttpResponse[SheetOperationResponse]:
|
424
|
+
"""
|
425
|
+
Clear a range of cells in an Athena spreadsheet.
|
426
|
+
|
427
|
+
Parameters
|
428
|
+
----------
|
429
|
+
asset_id : str
|
430
|
+
The ID of the spreadsheet asset
|
431
|
+
|
432
|
+
num_columns : int
|
433
|
+
Number of columns to clear
|
434
|
+
|
435
|
+
num_rows : int
|
436
|
+
Number of rows to clear
|
437
|
+
|
438
|
+
start_column : int
|
439
|
+
1-based starting column index
|
440
|
+
|
441
|
+
start_row : int
|
442
|
+
1-based starting row index
|
443
|
+
|
444
|
+
sheet_id : typing.Optional[int]
|
445
|
+
Sheet ID (defaults to 1)
|
446
|
+
|
447
|
+
request_options : typing.Optional[RequestOptions]
|
448
|
+
Request-specific configuration.
|
449
|
+
|
450
|
+
Returns
|
451
|
+
-------
|
452
|
+
HttpResponse[SheetOperationResponse]
|
453
|
+
Successful Response
|
454
|
+
"""
|
455
|
+
_response = self._client_wrapper.httpx_client.request(
|
456
|
+
"api/v0/tools/sheets/range/clear",
|
457
|
+
method="POST",
|
458
|
+
json={
|
459
|
+
"asset_id": asset_id,
|
460
|
+
"num_columns": num_columns,
|
461
|
+
"num_rows": num_rows,
|
462
|
+
"sheet_id": sheet_id,
|
463
|
+
"start_column": start_column,
|
464
|
+
"start_row": start_row,
|
465
|
+
},
|
466
|
+
headers={
|
467
|
+
"content-type": "application/json",
|
468
|
+
},
|
469
|
+
request_options=request_options,
|
470
|
+
omit=OMIT,
|
471
|
+
)
|
472
|
+
try:
|
473
|
+
if 200 <= _response.status_code < 300:
|
474
|
+
_data = typing.cast(
|
475
|
+
SheetOperationResponse,
|
476
|
+
parse_obj_as(
|
477
|
+
type_=SheetOperationResponse, # type: ignore
|
478
|
+
object_=_response.json(),
|
479
|
+
),
|
480
|
+
)
|
481
|
+
return HttpResponse(response=_response, data=_data)
|
482
|
+
if _response.status_code == 422:
|
483
|
+
raise UnprocessableEntityError(
|
484
|
+
headers=dict(_response.headers),
|
485
|
+
body=typing.cast(
|
486
|
+
typing.Optional[typing.Any],
|
487
|
+
parse_obj_as(
|
488
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
489
|
+
object_=_response.json(),
|
490
|
+
),
|
491
|
+
),
|
492
|
+
)
|
493
|
+
_response_json = _response.json()
|
494
|
+
except JSONDecodeError:
|
495
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
496
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
497
|
+
|
498
|
+
def format_range(
|
499
|
+
self,
|
500
|
+
*,
|
501
|
+
asset_id: str,
|
502
|
+
end_column: int,
|
503
|
+
end_row: int,
|
504
|
+
start_column: int,
|
505
|
+
start_row: int,
|
506
|
+
type: str,
|
507
|
+
value_json: str,
|
508
|
+
sheet_id: typing.Optional[int] = OMIT,
|
509
|
+
request_options: typing.Optional[RequestOptions] = None,
|
510
|
+
) -> HttpResponse[SheetOperationResponse]:
|
511
|
+
"""
|
512
|
+
Apply formatting to a range of cells in an Athena spreadsheet.
|
513
|
+
|
514
|
+
Parameters
|
515
|
+
----------
|
516
|
+
asset_id : str
|
517
|
+
The ID of the spreadsheet asset
|
518
|
+
|
519
|
+
end_column : int
|
520
|
+
1-based ending column index
|
521
|
+
|
522
|
+
end_row : int
|
523
|
+
1-based ending row index
|
524
|
+
|
525
|
+
start_column : int
|
526
|
+
1-based starting column index
|
527
|
+
|
528
|
+
start_row : int
|
529
|
+
1-based starting row index
|
530
|
+
|
531
|
+
type : str
|
532
|
+
Formatting type (e.g. backgroundColor, textFormat, borders, etc.)
|
533
|
+
|
534
|
+
value_json : str
|
535
|
+
JSON string for value param (e.g. '"#FF0000"' or '{"fontSize":12}')
|
536
|
+
|
537
|
+
sheet_id : typing.Optional[int]
|
538
|
+
Sheet ID (defaults to 1)
|
539
|
+
|
540
|
+
request_options : typing.Optional[RequestOptions]
|
541
|
+
Request-specific configuration.
|
542
|
+
|
543
|
+
Returns
|
544
|
+
-------
|
545
|
+
HttpResponse[SheetOperationResponse]
|
546
|
+
Successful Response
|
547
|
+
"""
|
548
|
+
_response = self._client_wrapper.httpx_client.request(
|
549
|
+
"api/v0/tools/sheets/range/format",
|
550
|
+
method="POST",
|
551
|
+
json={
|
552
|
+
"asset_id": asset_id,
|
553
|
+
"end_column": end_column,
|
554
|
+
"end_row": end_row,
|
555
|
+
"sheet_id": sheet_id,
|
556
|
+
"start_column": start_column,
|
557
|
+
"start_row": start_row,
|
558
|
+
"type": type,
|
559
|
+
"value_json": value_json,
|
560
|
+
},
|
561
|
+
headers={
|
562
|
+
"content-type": "application/json",
|
563
|
+
},
|
564
|
+
request_options=request_options,
|
565
|
+
omit=OMIT,
|
566
|
+
)
|
567
|
+
try:
|
568
|
+
if 200 <= _response.status_code < 300:
|
569
|
+
_data = typing.cast(
|
570
|
+
SheetOperationResponse,
|
571
|
+
parse_obj_as(
|
572
|
+
type_=SheetOperationResponse, # type: ignore
|
573
|
+
object_=_response.json(),
|
574
|
+
),
|
575
|
+
)
|
576
|
+
return HttpResponse(response=_response, data=_data)
|
577
|
+
if _response.status_code == 422:
|
578
|
+
raise UnprocessableEntityError(
|
579
|
+
headers=dict(_response.headers),
|
580
|
+
body=typing.cast(
|
581
|
+
typing.Optional[typing.Any],
|
582
|
+
parse_obj_as(
|
583
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
584
|
+
object_=_response.json(),
|
585
|
+
),
|
586
|
+
),
|
587
|
+
)
|
588
|
+
_response_json = _response.json()
|
589
|
+
except JSONDecodeError:
|
590
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
591
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
592
|
+
|
593
|
+
def update_range(
|
594
|
+
self,
|
595
|
+
*,
|
596
|
+
asset_id: str,
|
597
|
+
start_column: int,
|
598
|
+
start_row: int,
|
599
|
+
values: typing.Sequence[str],
|
600
|
+
sheet_id: typing.Optional[int] = OMIT,
|
601
|
+
request_options: typing.Optional[RequestOptions] = None,
|
602
|
+
) -> HttpResponse[SheetOperationResponse]:
|
603
|
+
"""
|
604
|
+
Update a range of cells in an Athena spreadsheet.
|
605
|
+
|
606
|
+
Parameters
|
607
|
+
----------
|
608
|
+
asset_id : str
|
609
|
+
The ID of the spreadsheet asset
|
610
|
+
|
611
|
+
start_column : int
|
612
|
+
1-based starting column index
|
613
|
+
|
614
|
+
start_row : int
|
615
|
+
1-based starting row index
|
616
|
+
|
617
|
+
values : typing.Sequence[str]
|
618
|
+
List of pipe-separated strings representing rows (e.g. ['A1|B1|C1', 'A2|B2|C2'])
|
619
|
+
|
620
|
+
sheet_id : typing.Optional[int]
|
621
|
+
Sheet ID (defaults to 1)
|
622
|
+
|
623
|
+
request_options : typing.Optional[RequestOptions]
|
624
|
+
Request-specific configuration.
|
625
|
+
|
626
|
+
Returns
|
627
|
+
-------
|
628
|
+
HttpResponse[SheetOperationResponse]
|
629
|
+
Successful Response
|
630
|
+
"""
|
631
|
+
_response = self._client_wrapper.httpx_client.request(
|
632
|
+
"api/v0/tools/sheets/range/update",
|
633
|
+
method="POST",
|
634
|
+
json={
|
635
|
+
"asset_id": asset_id,
|
636
|
+
"sheet_id": sheet_id,
|
637
|
+
"start_column": start_column,
|
638
|
+
"start_row": start_row,
|
639
|
+
"values": values,
|
640
|
+
},
|
641
|
+
headers={
|
642
|
+
"content-type": "application/json",
|
643
|
+
},
|
644
|
+
request_options=request_options,
|
645
|
+
omit=OMIT,
|
646
|
+
)
|
647
|
+
try:
|
648
|
+
if 200 <= _response.status_code < 300:
|
649
|
+
_data = typing.cast(
|
650
|
+
SheetOperationResponse,
|
651
|
+
parse_obj_as(
|
652
|
+
type_=SheetOperationResponse, # type: ignore
|
653
|
+
object_=_response.json(),
|
654
|
+
),
|
655
|
+
)
|
656
|
+
return HttpResponse(response=_response, data=_data)
|
657
|
+
if _response.status_code == 422:
|
658
|
+
raise UnprocessableEntityError(
|
659
|
+
headers=dict(_response.headers),
|
660
|
+
body=typing.cast(
|
661
|
+
typing.Optional[typing.Any],
|
662
|
+
parse_obj_as(
|
663
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
664
|
+
object_=_response.json(),
|
665
|
+
),
|
666
|
+
),
|
667
|
+
)
|
668
|
+
_response_json = _response.json()
|
669
|
+
except JSONDecodeError:
|
670
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
671
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
672
|
+
|
673
|
+
def duplicate_sheet(
|
674
|
+
self,
|
675
|
+
*,
|
676
|
+
asset_id: str,
|
677
|
+
sheet_id: typing.Optional[int] = OMIT,
|
678
|
+
request_options: typing.Optional[RequestOptions] = None,
|
679
|
+
) -> HttpResponse[SheetOperationResponse]:
|
680
|
+
"""
|
681
|
+
Duplicate an existing sheet in an Athena spreadsheet.
|
682
|
+
|
683
|
+
Parameters
|
684
|
+
----------
|
685
|
+
asset_id : str
|
686
|
+
The ID of the spreadsheet asset
|
687
|
+
|
688
|
+
sheet_id : typing.Optional[int]
|
689
|
+
Sheet ID to duplicate
|
690
|
+
|
691
|
+
request_options : typing.Optional[RequestOptions]
|
692
|
+
Request-specific configuration.
|
693
|
+
|
694
|
+
Returns
|
695
|
+
-------
|
696
|
+
HttpResponse[SheetOperationResponse]
|
697
|
+
Successful Response
|
698
|
+
"""
|
699
|
+
_response = self._client_wrapper.httpx_client.request(
|
700
|
+
"api/v0/tools/sheets/sheet/duplicate",
|
701
|
+
method="POST",
|
702
|
+
json={
|
703
|
+
"asset_id": asset_id,
|
704
|
+
"sheet_id": sheet_id,
|
705
|
+
},
|
706
|
+
headers={
|
707
|
+
"content-type": "application/json",
|
708
|
+
},
|
709
|
+
request_options=request_options,
|
710
|
+
omit=OMIT,
|
711
|
+
)
|
712
|
+
try:
|
713
|
+
if 200 <= _response.status_code < 300:
|
714
|
+
_data = typing.cast(
|
715
|
+
SheetOperationResponse,
|
716
|
+
parse_obj_as(
|
717
|
+
type_=SheetOperationResponse, # type: ignore
|
718
|
+
object_=_response.json(),
|
719
|
+
),
|
720
|
+
)
|
721
|
+
return HttpResponse(response=_response, data=_data)
|
722
|
+
if _response.status_code == 422:
|
723
|
+
raise UnprocessableEntityError(
|
724
|
+
headers=dict(_response.headers),
|
725
|
+
body=typing.cast(
|
726
|
+
typing.Optional[typing.Any],
|
727
|
+
parse_obj_as(
|
728
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
729
|
+
object_=_response.json(),
|
730
|
+
),
|
731
|
+
),
|
732
|
+
)
|
733
|
+
_response_json = _response.json()
|
734
|
+
except JSONDecodeError:
|
735
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
736
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
737
|
+
|
738
|
+
def create_tab(
|
739
|
+
self,
|
740
|
+
*,
|
741
|
+
asset_id: str,
|
742
|
+
sheet_id: int,
|
743
|
+
title: str,
|
744
|
+
active_sheet_id: typing.Optional[int] = OMIT,
|
745
|
+
tab_color: typing.Optional[str] = OMIT,
|
746
|
+
request_options: typing.Optional[RequestOptions] = None,
|
747
|
+
) -> HttpResponse[CreateNewSheetTabResponse]:
|
748
|
+
"""
|
749
|
+
Create a new tab in an Athena spreadsheet.
|
750
|
+
|
751
|
+
Parameters
|
752
|
+
----------
|
753
|
+
asset_id : str
|
754
|
+
The ID of the spreadsheet asset
|
755
|
+
|
756
|
+
sheet_id : int
|
757
|
+
Sheet ID of the new tab
|
758
|
+
|
759
|
+
title : str
|
760
|
+
Title of the new tab
|
761
|
+
|
762
|
+
active_sheet_id : typing.Optional[int]
|
763
|
+
Currently active sheet ID
|
764
|
+
|
765
|
+
tab_color : typing.Optional[str]
|
766
|
+
Optional color of the new tab
|
767
|
+
|
768
|
+
request_options : typing.Optional[RequestOptions]
|
769
|
+
Request-specific configuration.
|
770
|
+
|
771
|
+
Returns
|
772
|
+
-------
|
773
|
+
HttpResponse[CreateNewSheetTabResponse]
|
774
|
+
Successful Response
|
775
|
+
"""
|
776
|
+
_response = self._client_wrapper.httpx_client.request(
|
777
|
+
"api/v0/tools/sheets/tab/create",
|
778
|
+
method="POST",
|
779
|
+
json={
|
780
|
+
"active_sheet_id": active_sheet_id,
|
781
|
+
"asset_id": asset_id,
|
782
|
+
"sheet_id": sheet_id,
|
783
|
+
"tab_color": tab_color,
|
784
|
+
"title": title,
|
785
|
+
},
|
786
|
+
headers={
|
787
|
+
"content-type": "application/json",
|
788
|
+
},
|
789
|
+
request_options=request_options,
|
790
|
+
omit=OMIT,
|
791
|
+
)
|
792
|
+
try:
|
793
|
+
if 200 <= _response.status_code < 300:
|
794
|
+
_data = typing.cast(
|
795
|
+
CreateNewSheetTabResponse,
|
796
|
+
parse_obj_as(
|
797
|
+
type_=CreateNewSheetTabResponse, # type: ignore
|
798
|
+
object_=_response.json(),
|
799
|
+
),
|
800
|
+
)
|
801
|
+
return HttpResponse(response=_response, data=_data)
|
802
|
+
if _response.status_code == 422:
|
803
|
+
raise UnprocessableEntityError(
|
804
|
+
headers=dict(_response.headers),
|
805
|
+
body=typing.cast(
|
806
|
+
typing.Optional[typing.Any],
|
807
|
+
parse_obj_as(
|
808
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
809
|
+
object_=_response.json(),
|
810
|
+
),
|
811
|
+
),
|
812
|
+
)
|
813
|
+
_response_json = _response.json()
|
814
|
+
except JSONDecodeError:
|
815
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
816
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
817
|
+
|
818
|
+
def delete_table_column(
|
819
|
+
self,
|
820
|
+
*,
|
821
|
+
asset_id: str,
|
822
|
+
dimension_index: int,
|
823
|
+
table_id: str,
|
824
|
+
sheet_id: typing.Optional[int] = OMIT,
|
825
|
+
request_options: typing.Optional[RequestOptions] = None,
|
826
|
+
) -> HttpResponse[SheetOperationResponse]:
|
827
|
+
"""
|
828
|
+
Delete a column from a table within an Athena spreadsheet.
|
829
|
+
|
830
|
+
Parameters
|
831
|
+
----------
|
832
|
+
asset_id : str
|
833
|
+
The ID of the spreadsheet asset
|
834
|
+
|
835
|
+
dimension_index : int
|
836
|
+
0-based dimension index within the table
|
837
|
+
|
838
|
+
table_id : str
|
839
|
+
Table ID where to delete column
|
840
|
+
|
841
|
+
sheet_id : typing.Optional[int]
|
842
|
+
Sheet ID (defaults to 1)
|
843
|
+
|
844
|
+
request_options : typing.Optional[RequestOptions]
|
845
|
+
Request-specific configuration.
|
846
|
+
|
847
|
+
Returns
|
848
|
+
-------
|
849
|
+
HttpResponse[SheetOperationResponse]
|
850
|
+
Successful Response
|
851
|
+
"""
|
852
|
+
_response = self._client_wrapper.httpx_client.request(
|
853
|
+
"api/v0/tools/sheets/table/column/delete",
|
854
|
+
method="POST",
|
855
|
+
json={
|
856
|
+
"asset_id": asset_id,
|
857
|
+
"dimension_index": dimension_index,
|
858
|
+
"sheet_id": sheet_id,
|
859
|
+
"table_id": table_id,
|
860
|
+
},
|
861
|
+
headers={
|
862
|
+
"content-type": "application/json",
|
863
|
+
},
|
864
|
+
request_options=request_options,
|
865
|
+
omit=OMIT,
|
866
|
+
)
|
867
|
+
try:
|
868
|
+
if 200 <= _response.status_code < 300:
|
869
|
+
_data = typing.cast(
|
870
|
+
SheetOperationResponse,
|
871
|
+
parse_obj_as(
|
872
|
+
type_=SheetOperationResponse, # type: ignore
|
873
|
+
object_=_response.json(),
|
874
|
+
),
|
875
|
+
)
|
876
|
+
return HttpResponse(response=_response, data=_data)
|
877
|
+
if _response.status_code == 422:
|
878
|
+
raise UnprocessableEntityError(
|
879
|
+
headers=dict(_response.headers),
|
880
|
+
body=typing.cast(
|
881
|
+
typing.Optional[typing.Any],
|
882
|
+
parse_obj_as(
|
883
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
884
|
+
object_=_response.json(),
|
885
|
+
),
|
886
|
+
),
|
887
|
+
)
|
888
|
+
_response_json = _response.json()
|
889
|
+
except JSONDecodeError:
|
890
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
891
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
892
|
+
|
893
|
+
def insert_table_column(
|
894
|
+
self,
|
895
|
+
*,
|
896
|
+
asset_id: str,
|
897
|
+
dimension_index: int,
|
898
|
+
direction: str,
|
899
|
+
table_id: str,
|
900
|
+
sheet_id: typing.Optional[int] = OMIT,
|
901
|
+
request_options: typing.Optional[RequestOptions] = None,
|
902
|
+
) -> HttpResponse[SheetOperationResponse]:
|
903
|
+
"""
|
904
|
+
Insert a column in a table within an Athena spreadsheet.
|
905
|
+
|
906
|
+
Parameters
|
907
|
+
----------
|
908
|
+
asset_id : str
|
909
|
+
The ID of the spreadsheet asset
|
910
|
+
|
911
|
+
dimension_index : int
|
912
|
+
0-based dimension index within the table
|
913
|
+
|
914
|
+
direction : str
|
915
|
+
Direction of insertion (left or right)
|
916
|
+
|
917
|
+
table_id : str
|
918
|
+
Table ID where to insert column
|
919
|
+
|
920
|
+
sheet_id : typing.Optional[int]
|
921
|
+
Sheet ID (defaults to 1)
|
922
|
+
|
923
|
+
request_options : typing.Optional[RequestOptions]
|
924
|
+
Request-specific configuration.
|
925
|
+
|
926
|
+
Returns
|
927
|
+
-------
|
928
|
+
HttpResponse[SheetOperationResponse]
|
929
|
+
Successful Response
|
930
|
+
"""
|
931
|
+
_response = self._client_wrapper.httpx_client.request(
|
932
|
+
"api/v0/tools/sheets/table/column/insert",
|
933
|
+
method="POST",
|
934
|
+
json={
|
935
|
+
"asset_id": asset_id,
|
936
|
+
"dimension_index": dimension_index,
|
937
|
+
"direction": direction,
|
938
|
+
"sheet_id": sheet_id,
|
939
|
+
"table_id": table_id,
|
940
|
+
},
|
941
|
+
headers={
|
942
|
+
"content-type": "application/json",
|
943
|
+
},
|
944
|
+
request_options=request_options,
|
945
|
+
omit=OMIT,
|
946
|
+
)
|
947
|
+
try:
|
948
|
+
if 200 <= _response.status_code < 300:
|
949
|
+
_data = typing.cast(
|
950
|
+
SheetOperationResponse,
|
951
|
+
parse_obj_as(
|
952
|
+
type_=SheetOperationResponse, # type: ignore
|
953
|
+
object_=_response.json(),
|
954
|
+
),
|
955
|
+
)
|
956
|
+
return HttpResponse(response=_response, data=_data)
|
957
|
+
if _response.status_code == 422:
|
958
|
+
raise UnprocessableEntityError(
|
959
|
+
headers=dict(_response.headers),
|
960
|
+
body=typing.cast(
|
961
|
+
typing.Optional[typing.Any],
|
962
|
+
parse_obj_as(
|
963
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
964
|
+
object_=_response.json(),
|
965
|
+
),
|
966
|
+
),
|
967
|
+
)
|
968
|
+
_response_json = _response.json()
|
969
|
+
except JSONDecodeError:
|
970
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
971
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
972
|
+
|
973
|
+
def create_table(
|
974
|
+
self,
|
975
|
+
*,
|
976
|
+
asset_id: str,
|
977
|
+
end_column_index: int,
|
978
|
+
end_row_index: int,
|
979
|
+
start_column_index: int,
|
980
|
+
start_row_index: int,
|
981
|
+
table_id: str,
|
982
|
+
table_name: str,
|
983
|
+
sheet_id: typing.Optional[int] = OMIT,
|
984
|
+
request_options: typing.Optional[RequestOptions] = None,
|
985
|
+
) -> HttpResponse[SheetOperationResponse]:
|
986
|
+
"""
|
987
|
+
Create a table in an Athena spreadsheet.
|
988
|
+
|
989
|
+
Parameters
|
990
|
+
----------
|
991
|
+
asset_id : str
|
992
|
+
The ID of the spreadsheet asset
|
993
|
+
|
994
|
+
end_column_index : int
|
995
|
+
1-based ending column index
|
996
|
+
|
997
|
+
end_row_index : int
|
998
|
+
1-based ending row index
|
999
|
+
|
1000
|
+
start_column_index : int
|
1001
|
+
1-based starting column index
|
1002
|
+
|
1003
|
+
start_row_index : int
|
1004
|
+
1-based starting row index
|
1005
|
+
|
1006
|
+
table_id : str
|
1007
|
+
Unique table ID
|
1008
|
+
|
1009
|
+
table_name : str
|
1010
|
+
Name of the table
|
1011
|
+
|
1012
|
+
sheet_id : typing.Optional[int]
|
1013
|
+
Sheet ID (defaults to 1)
|
1014
|
+
|
1015
|
+
request_options : typing.Optional[RequestOptions]
|
1016
|
+
Request-specific configuration.
|
1017
|
+
|
1018
|
+
Returns
|
1019
|
+
-------
|
1020
|
+
HttpResponse[SheetOperationResponse]
|
1021
|
+
Successful Response
|
1022
|
+
"""
|
1023
|
+
_response = self._client_wrapper.httpx_client.request(
|
1024
|
+
"api/v0/tools/sheets/table/create",
|
1025
|
+
method="POST",
|
1026
|
+
json={
|
1027
|
+
"asset_id": asset_id,
|
1028
|
+
"end_column_index": end_column_index,
|
1029
|
+
"end_row_index": end_row_index,
|
1030
|
+
"sheet_id": sheet_id,
|
1031
|
+
"start_column_index": start_column_index,
|
1032
|
+
"start_row_index": start_row_index,
|
1033
|
+
"table_id": table_id,
|
1034
|
+
"table_name": table_name,
|
1035
|
+
},
|
1036
|
+
headers={
|
1037
|
+
"content-type": "application/json",
|
1038
|
+
},
|
1039
|
+
request_options=request_options,
|
1040
|
+
omit=OMIT,
|
1041
|
+
)
|
1042
|
+
try:
|
1043
|
+
if 200 <= _response.status_code < 300:
|
1044
|
+
_data = typing.cast(
|
1045
|
+
SheetOperationResponse,
|
1046
|
+
parse_obj_as(
|
1047
|
+
type_=SheetOperationResponse, # type: ignore
|
1048
|
+
object_=_response.json(),
|
1049
|
+
),
|
1050
|
+
)
|
1051
|
+
return HttpResponse(response=_response, data=_data)
|
1052
|
+
if _response.status_code == 422:
|
1053
|
+
raise UnprocessableEntityError(
|
1054
|
+
headers=dict(_response.headers),
|
1055
|
+
body=typing.cast(
|
1056
|
+
typing.Optional[typing.Any],
|
1057
|
+
parse_obj_as(
|
1058
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1059
|
+
object_=_response.json(),
|
1060
|
+
),
|
1061
|
+
),
|
1062
|
+
)
|
1063
|
+
_response_json = _response.json()
|
1064
|
+
except JSONDecodeError:
|
1065
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1066
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1067
|
+
|
1068
|
+
def update_table(
|
1069
|
+
self,
|
1070
|
+
*,
|
1071
|
+
asset_id: str,
|
1072
|
+
end_column_index: int,
|
1073
|
+
end_row_index: int,
|
1074
|
+
start_column_index: int,
|
1075
|
+
start_row_index: int,
|
1076
|
+
table_id: str,
|
1077
|
+
table_name: str,
|
1078
|
+
sheet_id: typing.Optional[int] = OMIT,
|
1079
|
+
request_options: typing.Optional[RequestOptions] = None,
|
1080
|
+
) -> HttpResponse[SheetOperationResponse]:
|
1081
|
+
"""
|
1082
|
+
Update an existing table in an Athena spreadsheet.
|
1083
|
+
|
1084
|
+
Parameters
|
1085
|
+
----------
|
1086
|
+
asset_id : str
|
1087
|
+
The ID of the spreadsheet asset
|
1088
|
+
|
1089
|
+
end_column_index : int
|
1090
|
+
1-based ending column index
|
1091
|
+
|
1092
|
+
end_row_index : int
|
1093
|
+
1-based ending row index
|
1094
|
+
|
1095
|
+
start_column_index : int
|
1096
|
+
1-based starting column index
|
1097
|
+
|
1098
|
+
start_row_index : int
|
1099
|
+
1-based starting row index
|
1100
|
+
|
1101
|
+
table_id : str
|
1102
|
+
Table ID to update
|
1103
|
+
|
1104
|
+
table_name : str
|
1105
|
+
Name of the table
|
1106
|
+
|
1107
|
+
sheet_id : typing.Optional[int]
|
1108
|
+
Sheet ID (defaults to 1)
|
1109
|
+
|
1110
|
+
request_options : typing.Optional[RequestOptions]
|
1111
|
+
Request-specific configuration.
|
1112
|
+
|
1113
|
+
Returns
|
1114
|
+
-------
|
1115
|
+
HttpResponse[SheetOperationResponse]
|
1116
|
+
Successful Response
|
1117
|
+
"""
|
1118
|
+
_response = self._client_wrapper.httpx_client.request(
|
1119
|
+
"api/v0/tools/sheets/table/update",
|
1120
|
+
method="POST",
|
1121
|
+
json={
|
1122
|
+
"asset_id": asset_id,
|
1123
|
+
"end_column_index": end_column_index,
|
1124
|
+
"end_row_index": end_row_index,
|
1125
|
+
"sheet_id": sheet_id,
|
1126
|
+
"start_column_index": start_column_index,
|
1127
|
+
"start_row_index": start_row_index,
|
1128
|
+
"table_id": table_id,
|
1129
|
+
"table_name": table_name,
|
1130
|
+
},
|
1131
|
+
headers={
|
1132
|
+
"content-type": "application/json",
|
1133
|
+
},
|
1134
|
+
request_options=request_options,
|
1135
|
+
omit=OMIT,
|
1136
|
+
)
|
1137
|
+
try:
|
1138
|
+
if 200 <= _response.status_code < 300:
|
1139
|
+
_data = typing.cast(
|
1140
|
+
SheetOperationResponse,
|
1141
|
+
parse_obj_as(
|
1142
|
+
type_=SheetOperationResponse, # type: ignore
|
1143
|
+
object_=_response.json(),
|
1144
|
+
),
|
1145
|
+
)
|
1146
|
+
return HttpResponse(response=_response, data=_data)
|
1147
|
+
if _response.status_code == 422:
|
1148
|
+
raise UnprocessableEntityError(
|
1149
|
+
headers=dict(_response.headers),
|
1150
|
+
body=typing.cast(
|
1151
|
+
typing.Optional[typing.Any],
|
1152
|
+
parse_obj_as(
|
1153
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1154
|
+
object_=_response.json(),
|
1155
|
+
),
|
1156
|
+
),
|
1157
|
+
)
|
1158
|
+
_response_json = _response.json()
|
1159
|
+
except JSONDecodeError:
|
1160
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1161
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1162
|
+
|
1163
|
+
|
1164
|
+
class AsyncRawSheetsClient:
|
1165
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
1166
|
+
self._client_wrapper = client_wrapper
|
1167
|
+
|
1168
|
+
async def update_cell(
|
1169
|
+
self,
|
1170
|
+
*,
|
1171
|
+
asset_id: str,
|
1172
|
+
column: int,
|
1173
|
+
row: int,
|
1174
|
+
value: str,
|
1175
|
+
sheet_id: typing.Optional[int] = OMIT,
|
1176
|
+
request_options: typing.Optional[RequestOptions] = None,
|
1177
|
+
) -> AsyncHttpResponse[SheetOperationResponse]:
|
1178
|
+
"""
|
1179
|
+
Update a single cell in an Athena spreadsheet.
|
1180
|
+
|
1181
|
+
Parameters
|
1182
|
+
----------
|
1183
|
+
asset_id : str
|
1184
|
+
The ID of the spreadsheet asset
|
1185
|
+
|
1186
|
+
column : int
|
1187
|
+
1-based column index (e.g., 1 = column A)
|
1188
|
+
|
1189
|
+
row : int
|
1190
|
+
1-based row index (e.g., 1 = first row)
|
1191
|
+
|
1192
|
+
value : str
|
1193
|
+
Value to set in the cell
|
1194
|
+
|
1195
|
+
sheet_id : typing.Optional[int]
|
1196
|
+
Sheet ID (defaults to 1)
|
1197
|
+
|
1198
|
+
request_options : typing.Optional[RequestOptions]
|
1199
|
+
Request-specific configuration.
|
1200
|
+
|
1201
|
+
Returns
|
1202
|
+
-------
|
1203
|
+
AsyncHttpResponse[SheetOperationResponse]
|
1204
|
+
Successful Response
|
1205
|
+
"""
|
1206
|
+
_response = await self._client_wrapper.httpx_client.request(
|
1207
|
+
"api/v0/tools/sheets/cell/update",
|
1208
|
+
method="POST",
|
1209
|
+
json={
|
1210
|
+
"asset_id": asset_id,
|
1211
|
+
"column": column,
|
1212
|
+
"row": row,
|
1213
|
+
"sheet_id": sheet_id,
|
1214
|
+
"value": value,
|
1215
|
+
},
|
1216
|
+
headers={
|
1217
|
+
"content-type": "application/json",
|
1218
|
+
},
|
1219
|
+
request_options=request_options,
|
1220
|
+
omit=OMIT,
|
1221
|
+
)
|
1222
|
+
try:
|
1223
|
+
if 200 <= _response.status_code < 300:
|
1224
|
+
_data = typing.cast(
|
1225
|
+
SheetOperationResponse,
|
1226
|
+
parse_obj_as(
|
1227
|
+
type_=SheetOperationResponse, # type: ignore
|
1228
|
+
object_=_response.json(),
|
1229
|
+
),
|
1230
|
+
)
|
1231
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
1232
|
+
if _response.status_code == 422:
|
1233
|
+
raise UnprocessableEntityError(
|
1234
|
+
headers=dict(_response.headers),
|
1235
|
+
body=typing.cast(
|
1236
|
+
typing.Optional[typing.Any],
|
1237
|
+
parse_obj_as(
|
1238
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1239
|
+
object_=_response.json(),
|
1240
|
+
),
|
1241
|
+
),
|
1242
|
+
)
|
1243
|
+
_response_json = _response.json()
|
1244
|
+
except JSONDecodeError:
|
1245
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1246
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1247
|
+
|
1248
|
+
async def delete_cells(
|
1249
|
+
self,
|
1250
|
+
*,
|
1251
|
+
asset_id: str,
|
1252
|
+
end_column_index: int,
|
1253
|
+
end_row_index: int,
|
1254
|
+
start_column_index: int,
|
1255
|
+
start_row_index: int,
|
1256
|
+
sheet_id: typing.Optional[int] = OMIT,
|
1257
|
+
request_options: typing.Optional[RequestOptions] = None,
|
1258
|
+
) -> AsyncHttpResponse[SheetOperationResponse]:
|
1259
|
+
"""
|
1260
|
+
Delete cells from an Athena spreadsheet.
|
1261
|
+
|
1262
|
+
Parameters
|
1263
|
+
----------
|
1264
|
+
asset_id : str
|
1265
|
+
The ID of the spreadsheet asset
|
1266
|
+
|
1267
|
+
end_column_index : int
|
1268
|
+
1-based ending column index
|
1269
|
+
|
1270
|
+
end_row_index : int
|
1271
|
+
1-based ending row index
|
1272
|
+
|
1273
|
+
start_column_index : int
|
1274
|
+
1-based starting column index
|
1275
|
+
|
1276
|
+
start_row_index : int
|
1277
|
+
1-based starting row index
|
1278
|
+
|
1279
|
+
sheet_id : typing.Optional[int]
|
1280
|
+
Sheet ID (defaults to 1)
|
1281
|
+
|
1282
|
+
request_options : typing.Optional[RequestOptions]
|
1283
|
+
Request-specific configuration.
|
1284
|
+
|
1285
|
+
Returns
|
1286
|
+
-------
|
1287
|
+
AsyncHttpResponse[SheetOperationResponse]
|
1288
|
+
Successful Response
|
1289
|
+
"""
|
1290
|
+
_response = await self._client_wrapper.httpx_client.request(
|
1291
|
+
"api/v0/tools/sheets/cells/delete",
|
1292
|
+
method="POST",
|
1293
|
+
json={
|
1294
|
+
"asset_id": asset_id,
|
1295
|
+
"end_column_index": end_column_index,
|
1296
|
+
"end_row_index": end_row_index,
|
1297
|
+
"sheet_id": sheet_id,
|
1298
|
+
"start_column_index": start_column_index,
|
1299
|
+
"start_row_index": start_row_index,
|
1300
|
+
},
|
1301
|
+
headers={
|
1302
|
+
"content-type": "application/json",
|
1303
|
+
},
|
1304
|
+
request_options=request_options,
|
1305
|
+
omit=OMIT,
|
1306
|
+
)
|
1307
|
+
try:
|
1308
|
+
if 200 <= _response.status_code < 300:
|
1309
|
+
_data = typing.cast(
|
1310
|
+
SheetOperationResponse,
|
1311
|
+
parse_obj_as(
|
1312
|
+
type_=SheetOperationResponse, # type: ignore
|
1313
|
+
object_=_response.json(),
|
1314
|
+
),
|
1315
|
+
)
|
1316
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
1317
|
+
if _response.status_code == 422:
|
1318
|
+
raise UnprocessableEntityError(
|
1319
|
+
headers=dict(_response.headers),
|
1320
|
+
body=typing.cast(
|
1321
|
+
typing.Optional[typing.Any],
|
1322
|
+
parse_obj_as(
|
1323
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1324
|
+
object_=_response.json(),
|
1325
|
+
),
|
1326
|
+
),
|
1327
|
+
)
|
1328
|
+
_response_json = _response.json()
|
1329
|
+
except JSONDecodeError:
|
1330
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1331
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1332
|
+
|
1333
|
+
async def delete_column(
|
1334
|
+
self,
|
1335
|
+
*,
|
1336
|
+
asset_id: str,
|
1337
|
+
column_indexes: typing.Sequence[int],
|
1338
|
+
sheet_id: typing.Optional[int] = OMIT,
|
1339
|
+
request_options: typing.Optional[RequestOptions] = None,
|
1340
|
+
) -> AsyncHttpResponse[SheetOperationResponse]:
|
1341
|
+
"""
|
1342
|
+
Delete columns from an Athena spreadsheet.
|
1343
|
+
|
1344
|
+
Parameters
|
1345
|
+
----------
|
1346
|
+
asset_id : str
|
1347
|
+
The ID of the spreadsheet asset
|
1348
|
+
|
1349
|
+
column_indexes : typing.Sequence[int]
|
1350
|
+
List of 1-based column indexes to delete
|
1351
|
+
|
1352
|
+
sheet_id : typing.Optional[int]
|
1353
|
+
Sheet ID (defaults to 1)
|
1354
|
+
|
1355
|
+
request_options : typing.Optional[RequestOptions]
|
1356
|
+
Request-specific configuration.
|
1357
|
+
|
1358
|
+
Returns
|
1359
|
+
-------
|
1360
|
+
AsyncHttpResponse[SheetOperationResponse]
|
1361
|
+
Successful Response
|
1362
|
+
"""
|
1363
|
+
_response = await self._client_wrapper.httpx_client.request(
|
1364
|
+
"api/v0/tools/sheets/column/delete",
|
1365
|
+
method="POST",
|
1366
|
+
json={
|
1367
|
+
"asset_id": asset_id,
|
1368
|
+
"column_indexes": column_indexes,
|
1369
|
+
"sheet_id": sheet_id,
|
1370
|
+
},
|
1371
|
+
headers={
|
1372
|
+
"content-type": "application/json",
|
1373
|
+
},
|
1374
|
+
request_options=request_options,
|
1375
|
+
omit=OMIT,
|
1376
|
+
)
|
1377
|
+
try:
|
1378
|
+
if 200 <= _response.status_code < 300:
|
1379
|
+
_data = typing.cast(
|
1380
|
+
SheetOperationResponse,
|
1381
|
+
parse_obj_as(
|
1382
|
+
type_=SheetOperationResponse, # type: ignore
|
1383
|
+
object_=_response.json(),
|
1384
|
+
),
|
1385
|
+
)
|
1386
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
1387
|
+
if _response.status_code == 422:
|
1388
|
+
raise UnprocessableEntityError(
|
1389
|
+
headers=dict(_response.headers),
|
1390
|
+
body=typing.cast(
|
1391
|
+
typing.Optional[typing.Any],
|
1392
|
+
parse_obj_as(
|
1393
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1394
|
+
object_=_response.json(),
|
1395
|
+
),
|
1396
|
+
),
|
1397
|
+
)
|
1398
|
+
_response_json = _response.json()
|
1399
|
+
except JSONDecodeError:
|
1400
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1401
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1402
|
+
|
1403
|
+
async def insert_column(
|
1404
|
+
self,
|
1405
|
+
*,
|
1406
|
+
asset_id: str,
|
1407
|
+
reference_column_index: int,
|
1408
|
+
sheet_id: typing.Optional[int] = OMIT,
|
1409
|
+
request_options: typing.Optional[RequestOptions] = None,
|
1410
|
+
) -> AsyncHttpResponse[SheetOperationResponse]:
|
1411
|
+
"""
|
1412
|
+
Insert a column in an Athena spreadsheet.
|
1413
|
+
|
1414
|
+
Parameters
|
1415
|
+
----------
|
1416
|
+
asset_id : str
|
1417
|
+
The ID of the spreadsheet asset
|
1418
|
+
|
1419
|
+
reference_column_index : int
|
1420
|
+
1-based reference column index where to insert
|
1421
|
+
|
1422
|
+
sheet_id : typing.Optional[int]
|
1423
|
+
Sheet ID (defaults to 1)
|
1424
|
+
|
1425
|
+
request_options : typing.Optional[RequestOptions]
|
1426
|
+
Request-specific configuration.
|
1427
|
+
|
1428
|
+
Returns
|
1429
|
+
-------
|
1430
|
+
AsyncHttpResponse[SheetOperationResponse]
|
1431
|
+
Successful Response
|
1432
|
+
"""
|
1433
|
+
_response = await self._client_wrapper.httpx_client.request(
|
1434
|
+
"api/v0/tools/sheets/column/insert",
|
1435
|
+
method="POST",
|
1436
|
+
json={
|
1437
|
+
"asset_id": asset_id,
|
1438
|
+
"reference_column_index": reference_column_index,
|
1439
|
+
"sheet_id": sheet_id,
|
1440
|
+
},
|
1441
|
+
headers={
|
1442
|
+
"content-type": "application/json",
|
1443
|
+
},
|
1444
|
+
request_options=request_options,
|
1445
|
+
omit=OMIT,
|
1446
|
+
)
|
1447
|
+
try:
|
1448
|
+
if 200 <= _response.status_code < 300:
|
1449
|
+
_data = typing.cast(
|
1450
|
+
SheetOperationResponse,
|
1451
|
+
parse_obj_as(
|
1452
|
+
type_=SheetOperationResponse, # type: ignore
|
1453
|
+
object_=_response.json(),
|
1454
|
+
),
|
1455
|
+
)
|
1456
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
1457
|
+
if _response.status_code == 422:
|
1458
|
+
raise UnprocessableEntityError(
|
1459
|
+
headers=dict(_response.headers),
|
1460
|
+
body=typing.cast(
|
1461
|
+
typing.Optional[typing.Any],
|
1462
|
+
parse_obj_as(
|
1463
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1464
|
+
object_=_response.json(),
|
1465
|
+
),
|
1466
|
+
),
|
1467
|
+
)
|
1468
|
+
_response_json = _response.json()
|
1469
|
+
except JSONDecodeError:
|
1470
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1471
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1472
|
+
|
1473
|
+
async def clear_formatting(
|
1474
|
+
self,
|
1475
|
+
*,
|
1476
|
+
asset_id: str,
|
1477
|
+
end_column_index: int,
|
1478
|
+
end_row_index: int,
|
1479
|
+
start_column_index: int,
|
1480
|
+
start_row_index: int,
|
1481
|
+
sheet_id: typing.Optional[int] = OMIT,
|
1482
|
+
request_options: typing.Optional[RequestOptions] = None,
|
1483
|
+
) -> AsyncHttpResponse[SheetOperationResponse]:
|
1484
|
+
"""
|
1485
|
+
Clear formatting from cells in an Athena spreadsheet.
|
1486
|
+
|
1487
|
+
Parameters
|
1488
|
+
----------
|
1489
|
+
asset_id : str
|
1490
|
+
The ID of the spreadsheet asset
|
1491
|
+
|
1492
|
+
end_column_index : int
|
1493
|
+
1-based ending column index
|
1494
|
+
|
1495
|
+
end_row_index : int
|
1496
|
+
1-based ending row index
|
1497
|
+
|
1498
|
+
start_column_index : int
|
1499
|
+
1-based starting column index
|
1500
|
+
|
1501
|
+
start_row_index : int
|
1502
|
+
1-based starting row index
|
1503
|
+
|
1504
|
+
sheet_id : typing.Optional[int]
|
1505
|
+
Sheet ID (defaults to 1)
|
1506
|
+
|
1507
|
+
request_options : typing.Optional[RequestOptions]
|
1508
|
+
Request-specific configuration.
|
1509
|
+
|
1510
|
+
Returns
|
1511
|
+
-------
|
1512
|
+
AsyncHttpResponse[SheetOperationResponse]
|
1513
|
+
Successful Response
|
1514
|
+
"""
|
1515
|
+
_response = await self._client_wrapper.httpx_client.request(
|
1516
|
+
"api/v0/tools/sheets/formatting/clear",
|
1517
|
+
method="POST",
|
1518
|
+
json={
|
1519
|
+
"asset_id": asset_id,
|
1520
|
+
"end_column_index": end_column_index,
|
1521
|
+
"end_row_index": end_row_index,
|
1522
|
+
"sheet_id": sheet_id,
|
1523
|
+
"start_column_index": start_column_index,
|
1524
|
+
"start_row_index": start_row_index,
|
1525
|
+
},
|
1526
|
+
headers={
|
1527
|
+
"content-type": "application/json",
|
1528
|
+
},
|
1529
|
+
request_options=request_options,
|
1530
|
+
omit=OMIT,
|
1531
|
+
)
|
1532
|
+
try:
|
1533
|
+
if 200 <= _response.status_code < 300:
|
1534
|
+
_data = typing.cast(
|
1535
|
+
SheetOperationResponse,
|
1536
|
+
parse_obj_as(
|
1537
|
+
type_=SheetOperationResponse, # type: ignore
|
1538
|
+
object_=_response.json(),
|
1539
|
+
),
|
1540
|
+
)
|
1541
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
1542
|
+
if _response.status_code == 422:
|
1543
|
+
raise UnprocessableEntityError(
|
1544
|
+
headers=dict(_response.headers),
|
1545
|
+
body=typing.cast(
|
1546
|
+
typing.Optional[typing.Any],
|
1547
|
+
parse_obj_as(
|
1548
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1549
|
+
object_=_response.json(),
|
1550
|
+
),
|
1551
|
+
),
|
1552
|
+
)
|
1553
|
+
_response_json = _response.json()
|
1554
|
+
except JSONDecodeError:
|
1555
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1556
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1557
|
+
|
1558
|
+
async def clear_range(
|
1559
|
+
self,
|
1560
|
+
*,
|
1561
|
+
asset_id: str,
|
1562
|
+
num_columns: int,
|
1563
|
+
num_rows: int,
|
1564
|
+
start_column: int,
|
1565
|
+
start_row: int,
|
1566
|
+
sheet_id: typing.Optional[int] = OMIT,
|
1567
|
+
request_options: typing.Optional[RequestOptions] = None,
|
1568
|
+
) -> AsyncHttpResponse[SheetOperationResponse]:
|
1569
|
+
"""
|
1570
|
+
Clear a range of cells in an Athena spreadsheet.
|
1571
|
+
|
1572
|
+
Parameters
|
1573
|
+
----------
|
1574
|
+
asset_id : str
|
1575
|
+
The ID of the spreadsheet asset
|
1576
|
+
|
1577
|
+
num_columns : int
|
1578
|
+
Number of columns to clear
|
1579
|
+
|
1580
|
+
num_rows : int
|
1581
|
+
Number of rows to clear
|
1582
|
+
|
1583
|
+
start_column : int
|
1584
|
+
1-based starting column index
|
1585
|
+
|
1586
|
+
start_row : int
|
1587
|
+
1-based starting row index
|
1588
|
+
|
1589
|
+
sheet_id : typing.Optional[int]
|
1590
|
+
Sheet ID (defaults to 1)
|
1591
|
+
|
1592
|
+
request_options : typing.Optional[RequestOptions]
|
1593
|
+
Request-specific configuration.
|
1594
|
+
|
1595
|
+
Returns
|
1596
|
+
-------
|
1597
|
+
AsyncHttpResponse[SheetOperationResponse]
|
1598
|
+
Successful Response
|
1599
|
+
"""
|
1600
|
+
_response = await self._client_wrapper.httpx_client.request(
|
1601
|
+
"api/v0/tools/sheets/range/clear",
|
1602
|
+
method="POST",
|
1603
|
+
json={
|
1604
|
+
"asset_id": asset_id,
|
1605
|
+
"num_columns": num_columns,
|
1606
|
+
"num_rows": num_rows,
|
1607
|
+
"sheet_id": sheet_id,
|
1608
|
+
"start_column": start_column,
|
1609
|
+
"start_row": start_row,
|
1610
|
+
},
|
1611
|
+
headers={
|
1612
|
+
"content-type": "application/json",
|
1613
|
+
},
|
1614
|
+
request_options=request_options,
|
1615
|
+
omit=OMIT,
|
1616
|
+
)
|
1617
|
+
try:
|
1618
|
+
if 200 <= _response.status_code < 300:
|
1619
|
+
_data = typing.cast(
|
1620
|
+
SheetOperationResponse,
|
1621
|
+
parse_obj_as(
|
1622
|
+
type_=SheetOperationResponse, # type: ignore
|
1623
|
+
object_=_response.json(),
|
1624
|
+
),
|
1625
|
+
)
|
1626
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
1627
|
+
if _response.status_code == 422:
|
1628
|
+
raise UnprocessableEntityError(
|
1629
|
+
headers=dict(_response.headers),
|
1630
|
+
body=typing.cast(
|
1631
|
+
typing.Optional[typing.Any],
|
1632
|
+
parse_obj_as(
|
1633
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1634
|
+
object_=_response.json(),
|
1635
|
+
),
|
1636
|
+
),
|
1637
|
+
)
|
1638
|
+
_response_json = _response.json()
|
1639
|
+
except JSONDecodeError:
|
1640
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1641
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1642
|
+
|
1643
|
+
async def format_range(
|
1644
|
+
self,
|
1645
|
+
*,
|
1646
|
+
asset_id: str,
|
1647
|
+
end_column: int,
|
1648
|
+
end_row: int,
|
1649
|
+
start_column: int,
|
1650
|
+
start_row: int,
|
1651
|
+
type: str,
|
1652
|
+
value_json: str,
|
1653
|
+
sheet_id: typing.Optional[int] = OMIT,
|
1654
|
+
request_options: typing.Optional[RequestOptions] = None,
|
1655
|
+
) -> AsyncHttpResponse[SheetOperationResponse]:
|
1656
|
+
"""
|
1657
|
+
Apply formatting to a range of cells in an Athena spreadsheet.
|
1658
|
+
|
1659
|
+
Parameters
|
1660
|
+
----------
|
1661
|
+
asset_id : str
|
1662
|
+
The ID of the spreadsheet asset
|
1663
|
+
|
1664
|
+
end_column : int
|
1665
|
+
1-based ending column index
|
1666
|
+
|
1667
|
+
end_row : int
|
1668
|
+
1-based ending row index
|
1669
|
+
|
1670
|
+
start_column : int
|
1671
|
+
1-based starting column index
|
1672
|
+
|
1673
|
+
start_row : int
|
1674
|
+
1-based starting row index
|
1675
|
+
|
1676
|
+
type : str
|
1677
|
+
Formatting type (e.g. backgroundColor, textFormat, borders, etc.)
|
1678
|
+
|
1679
|
+
value_json : str
|
1680
|
+
JSON string for value param (e.g. '"#FF0000"' or '{"fontSize":12}')
|
1681
|
+
|
1682
|
+
sheet_id : typing.Optional[int]
|
1683
|
+
Sheet ID (defaults to 1)
|
1684
|
+
|
1685
|
+
request_options : typing.Optional[RequestOptions]
|
1686
|
+
Request-specific configuration.
|
1687
|
+
|
1688
|
+
Returns
|
1689
|
+
-------
|
1690
|
+
AsyncHttpResponse[SheetOperationResponse]
|
1691
|
+
Successful Response
|
1692
|
+
"""
|
1693
|
+
_response = await self._client_wrapper.httpx_client.request(
|
1694
|
+
"api/v0/tools/sheets/range/format",
|
1695
|
+
method="POST",
|
1696
|
+
json={
|
1697
|
+
"asset_id": asset_id,
|
1698
|
+
"end_column": end_column,
|
1699
|
+
"end_row": end_row,
|
1700
|
+
"sheet_id": sheet_id,
|
1701
|
+
"start_column": start_column,
|
1702
|
+
"start_row": start_row,
|
1703
|
+
"type": type,
|
1704
|
+
"value_json": value_json,
|
1705
|
+
},
|
1706
|
+
headers={
|
1707
|
+
"content-type": "application/json",
|
1708
|
+
},
|
1709
|
+
request_options=request_options,
|
1710
|
+
omit=OMIT,
|
1711
|
+
)
|
1712
|
+
try:
|
1713
|
+
if 200 <= _response.status_code < 300:
|
1714
|
+
_data = typing.cast(
|
1715
|
+
SheetOperationResponse,
|
1716
|
+
parse_obj_as(
|
1717
|
+
type_=SheetOperationResponse, # type: ignore
|
1718
|
+
object_=_response.json(),
|
1719
|
+
),
|
1720
|
+
)
|
1721
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
1722
|
+
if _response.status_code == 422:
|
1723
|
+
raise UnprocessableEntityError(
|
1724
|
+
headers=dict(_response.headers),
|
1725
|
+
body=typing.cast(
|
1726
|
+
typing.Optional[typing.Any],
|
1727
|
+
parse_obj_as(
|
1728
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1729
|
+
object_=_response.json(),
|
1730
|
+
),
|
1731
|
+
),
|
1732
|
+
)
|
1733
|
+
_response_json = _response.json()
|
1734
|
+
except JSONDecodeError:
|
1735
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1736
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1737
|
+
|
1738
|
+
async def update_range(
|
1739
|
+
self,
|
1740
|
+
*,
|
1741
|
+
asset_id: str,
|
1742
|
+
start_column: int,
|
1743
|
+
start_row: int,
|
1744
|
+
values: typing.Sequence[str],
|
1745
|
+
sheet_id: typing.Optional[int] = OMIT,
|
1746
|
+
request_options: typing.Optional[RequestOptions] = None,
|
1747
|
+
) -> AsyncHttpResponse[SheetOperationResponse]:
|
1748
|
+
"""
|
1749
|
+
Update a range of cells in an Athena spreadsheet.
|
1750
|
+
|
1751
|
+
Parameters
|
1752
|
+
----------
|
1753
|
+
asset_id : str
|
1754
|
+
The ID of the spreadsheet asset
|
1755
|
+
|
1756
|
+
start_column : int
|
1757
|
+
1-based starting column index
|
1758
|
+
|
1759
|
+
start_row : int
|
1760
|
+
1-based starting row index
|
1761
|
+
|
1762
|
+
values : typing.Sequence[str]
|
1763
|
+
List of pipe-separated strings representing rows (e.g. ['A1|B1|C1', 'A2|B2|C2'])
|
1764
|
+
|
1765
|
+
sheet_id : typing.Optional[int]
|
1766
|
+
Sheet ID (defaults to 1)
|
1767
|
+
|
1768
|
+
request_options : typing.Optional[RequestOptions]
|
1769
|
+
Request-specific configuration.
|
1770
|
+
|
1771
|
+
Returns
|
1772
|
+
-------
|
1773
|
+
AsyncHttpResponse[SheetOperationResponse]
|
1774
|
+
Successful Response
|
1775
|
+
"""
|
1776
|
+
_response = await self._client_wrapper.httpx_client.request(
|
1777
|
+
"api/v0/tools/sheets/range/update",
|
1778
|
+
method="POST",
|
1779
|
+
json={
|
1780
|
+
"asset_id": asset_id,
|
1781
|
+
"sheet_id": sheet_id,
|
1782
|
+
"start_column": start_column,
|
1783
|
+
"start_row": start_row,
|
1784
|
+
"values": values,
|
1785
|
+
},
|
1786
|
+
headers={
|
1787
|
+
"content-type": "application/json",
|
1788
|
+
},
|
1789
|
+
request_options=request_options,
|
1790
|
+
omit=OMIT,
|
1791
|
+
)
|
1792
|
+
try:
|
1793
|
+
if 200 <= _response.status_code < 300:
|
1794
|
+
_data = typing.cast(
|
1795
|
+
SheetOperationResponse,
|
1796
|
+
parse_obj_as(
|
1797
|
+
type_=SheetOperationResponse, # type: ignore
|
1798
|
+
object_=_response.json(),
|
1799
|
+
),
|
1800
|
+
)
|
1801
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
1802
|
+
if _response.status_code == 422:
|
1803
|
+
raise UnprocessableEntityError(
|
1804
|
+
headers=dict(_response.headers),
|
1805
|
+
body=typing.cast(
|
1806
|
+
typing.Optional[typing.Any],
|
1807
|
+
parse_obj_as(
|
1808
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1809
|
+
object_=_response.json(),
|
1810
|
+
),
|
1811
|
+
),
|
1812
|
+
)
|
1813
|
+
_response_json = _response.json()
|
1814
|
+
except JSONDecodeError:
|
1815
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1816
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1817
|
+
|
1818
|
+
async def duplicate_sheet(
|
1819
|
+
self,
|
1820
|
+
*,
|
1821
|
+
asset_id: str,
|
1822
|
+
sheet_id: typing.Optional[int] = OMIT,
|
1823
|
+
request_options: typing.Optional[RequestOptions] = None,
|
1824
|
+
) -> AsyncHttpResponse[SheetOperationResponse]:
|
1825
|
+
"""
|
1826
|
+
Duplicate an existing sheet in an Athena spreadsheet.
|
1827
|
+
|
1828
|
+
Parameters
|
1829
|
+
----------
|
1830
|
+
asset_id : str
|
1831
|
+
The ID of the spreadsheet asset
|
1832
|
+
|
1833
|
+
sheet_id : typing.Optional[int]
|
1834
|
+
Sheet ID to duplicate
|
1835
|
+
|
1836
|
+
request_options : typing.Optional[RequestOptions]
|
1837
|
+
Request-specific configuration.
|
1838
|
+
|
1839
|
+
Returns
|
1840
|
+
-------
|
1841
|
+
AsyncHttpResponse[SheetOperationResponse]
|
1842
|
+
Successful Response
|
1843
|
+
"""
|
1844
|
+
_response = await self._client_wrapper.httpx_client.request(
|
1845
|
+
"api/v0/tools/sheets/sheet/duplicate",
|
1846
|
+
method="POST",
|
1847
|
+
json={
|
1848
|
+
"asset_id": asset_id,
|
1849
|
+
"sheet_id": sheet_id,
|
1850
|
+
},
|
1851
|
+
headers={
|
1852
|
+
"content-type": "application/json",
|
1853
|
+
},
|
1854
|
+
request_options=request_options,
|
1855
|
+
omit=OMIT,
|
1856
|
+
)
|
1857
|
+
try:
|
1858
|
+
if 200 <= _response.status_code < 300:
|
1859
|
+
_data = typing.cast(
|
1860
|
+
SheetOperationResponse,
|
1861
|
+
parse_obj_as(
|
1862
|
+
type_=SheetOperationResponse, # type: ignore
|
1863
|
+
object_=_response.json(),
|
1864
|
+
),
|
1865
|
+
)
|
1866
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
1867
|
+
if _response.status_code == 422:
|
1868
|
+
raise UnprocessableEntityError(
|
1869
|
+
headers=dict(_response.headers),
|
1870
|
+
body=typing.cast(
|
1871
|
+
typing.Optional[typing.Any],
|
1872
|
+
parse_obj_as(
|
1873
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1874
|
+
object_=_response.json(),
|
1875
|
+
),
|
1876
|
+
),
|
1877
|
+
)
|
1878
|
+
_response_json = _response.json()
|
1879
|
+
except JSONDecodeError:
|
1880
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1881
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1882
|
+
|
1883
|
+
async def create_tab(
|
1884
|
+
self,
|
1885
|
+
*,
|
1886
|
+
asset_id: str,
|
1887
|
+
sheet_id: int,
|
1888
|
+
title: str,
|
1889
|
+
active_sheet_id: typing.Optional[int] = OMIT,
|
1890
|
+
tab_color: typing.Optional[str] = OMIT,
|
1891
|
+
request_options: typing.Optional[RequestOptions] = None,
|
1892
|
+
) -> AsyncHttpResponse[CreateNewSheetTabResponse]:
|
1893
|
+
"""
|
1894
|
+
Create a new tab in an Athena spreadsheet.
|
1895
|
+
|
1896
|
+
Parameters
|
1897
|
+
----------
|
1898
|
+
asset_id : str
|
1899
|
+
The ID of the spreadsheet asset
|
1900
|
+
|
1901
|
+
sheet_id : int
|
1902
|
+
Sheet ID of the new tab
|
1903
|
+
|
1904
|
+
title : str
|
1905
|
+
Title of the new tab
|
1906
|
+
|
1907
|
+
active_sheet_id : typing.Optional[int]
|
1908
|
+
Currently active sheet ID
|
1909
|
+
|
1910
|
+
tab_color : typing.Optional[str]
|
1911
|
+
Optional color of the new tab
|
1912
|
+
|
1913
|
+
request_options : typing.Optional[RequestOptions]
|
1914
|
+
Request-specific configuration.
|
1915
|
+
|
1916
|
+
Returns
|
1917
|
+
-------
|
1918
|
+
AsyncHttpResponse[CreateNewSheetTabResponse]
|
1919
|
+
Successful Response
|
1920
|
+
"""
|
1921
|
+
_response = await self._client_wrapper.httpx_client.request(
|
1922
|
+
"api/v0/tools/sheets/tab/create",
|
1923
|
+
method="POST",
|
1924
|
+
json={
|
1925
|
+
"active_sheet_id": active_sheet_id,
|
1926
|
+
"asset_id": asset_id,
|
1927
|
+
"sheet_id": sheet_id,
|
1928
|
+
"tab_color": tab_color,
|
1929
|
+
"title": title,
|
1930
|
+
},
|
1931
|
+
headers={
|
1932
|
+
"content-type": "application/json",
|
1933
|
+
},
|
1934
|
+
request_options=request_options,
|
1935
|
+
omit=OMIT,
|
1936
|
+
)
|
1937
|
+
try:
|
1938
|
+
if 200 <= _response.status_code < 300:
|
1939
|
+
_data = typing.cast(
|
1940
|
+
CreateNewSheetTabResponse,
|
1941
|
+
parse_obj_as(
|
1942
|
+
type_=CreateNewSheetTabResponse, # type: ignore
|
1943
|
+
object_=_response.json(),
|
1944
|
+
),
|
1945
|
+
)
|
1946
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
1947
|
+
if _response.status_code == 422:
|
1948
|
+
raise UnprocessableEntityError(
|
1949
|
+
headers=dict(_response.headers),
|
1950
|
+
body=typing.cast(
|
1951
|
+
typing.Optional[typing.Any],
|
1952
|
+
parse_obj_as(
|
1953
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
1954
|
+
object_=_response.json(),
|
1955
|
+
),
|
1956
|
+
),
|
1957
|
+
)
|
1958
|
+
_response_json = _response.json()
|
1959
|
+
except JSONDecodeError:
|
1960
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
1961
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
1962
|
+
|
1963
|
+
async def delete_table_column(
|
1964
|
+
self,
|
1965
|
+
*,
|
1966
|
+
asset_id: str,
|
1967
|
+
dimension_index: int,
|
1968
|
+
table_id: str,
|
1969
|
+
sheet_id: typing.Optional[int] = OMIT,
|
1970
|
+
request_options: typing.Optional[RequestOptions] = None,
|
1971
|
+
) -> AsyncHttpResponse[SheetOperationResponse]:
|
1972
|
+
"""
|
1973
|
+
Delete a column from a table within an Athena spreadsheet.
|
1974
|
+
|
1975
|
+
Parameters
|
1976
|
+
----------
|
1977
|
+
asset_id : str
|
1978
|
+
The ID of the spreadsheet asset
|
1979
|
+
|
1980
|
+
dimension_index : int
|
1981
|
+
0-based dimension index within the table
|
1982
|
+
|
1983
|
+
table_id : str
|
1984
|
+
Table ID where to delete column
|
1985
|
+
|
1986
|
+
sheet_id : typing.Optional[int]
|
1987
|
+
Sheet ID (defaults to 1)
|
1988
|
+
|
1989
|
+
request_options : typing.Optional[RequestOptions]
|
1990
|
+
Request-specific configuration.
|
1991
|
+
|
1992
|
+
Returns
|
1993
|
+
-------
|
1994
|
+
AsyncHttpResponse[SheetOperationResponse]
|
1995
|
+
Successful Response
|
1996
|
+
"""
|
1997
|
+
_response = await self._client_wrapper.httpx_client.request(
|
1998
|
+
"api/v0/tools/sheets/table/column/delete",
|
1999
|
+
method="POST",
|
2000
|
+
json={
|
2001
|
+
"asset_id": asset_id,
|
2002
|
+
"dimension_index": dimension_index,
|
2003
|
+
"sheet_id": sheet_id,
|
2004
|
+
"table_id": table_id,
|
2005
|
+
},
|
2006
|
+
headers={
|
2007
|
+
"content-type": "application/json",
|
2008
|
+
},
|
2009
|
+
request_options=request_options,
|
2010
|
+
omit=OMIT,
|
2011
|
+
)
|
2012
|
+
try:
|
2013
|
+
if 200 <= _response.status_code < 300:
|
2014
|
+
_data = typing.cast(
|
2015
|
+
SheetOperationResponse,
|
2016
|
+
parse_obj_as(
|
2017
|
+
type_=SheetOperationResponse, # type: ignore
|
2018
|
+
object_=_response.json(),
|
2019
|
+
),
|
2020
|
+
)
|
2021
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
2022
|
+
if _response.status_code == 422:
|
2023
|
+
raise UnprocessableEntityError(
|
2024
|
+
headers=dict(_response.headers),
|
2025
|
+
body=typing.cast(
|
2026
|
+
typing.Optional[typing.Any],
|
2027
|
+
parse_obj_as(
|
2028
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
2029
|
+
object_=_response.json(),
|
2030
|
+
),
|
2031
|
+
),
|
2032
|
+
)
|
2033
|
+
_response_json = _response.json()
|
2034
|
+
except JSONDecodeError:
|
2035
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
2036
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
2037
|
+
|
2038
|
+
async def insert_table_column(
|
2039
|
+
self,
|
2040
|
+
*,
|
2041
|
+
asset_id: str,
|
2042
|
+
dimension_index: int,
|
2043
|
+
direction: str,
|
2044
|
+
table_id: str,
|
2045
|
+
sheet_id: typing.Optional[int] = OMIT,
|
2046
|
+
request_options: typing.Optional[RequestOptions] = None,
|
2047
|
+
) -> AsyncHttpResponse[SheetOperationResponse]:
|
2048
|
+
"""
|
2049
|
+
Insert a column in a table within an Athena spreadsheet.
|
2050
|
+
|
2051
|
+
Parameters
|
2052
|
+
----------
|
2053
|
+
asset_id : str
|
2054
|
+
The ID of the spreadsheet asset
|
2055
|
+
|
2056
|
+
dimension_index : int
|
2057
|
+
0-based dimension index within the table
|
2058
|
+
|
2059
|
+
direction : str
|
2060
|
+
Direction of insertion (left or right)
|
2061
|
+
|
2062
|
+
table_id : str
|
2063
|
+
Table ID where to insert column
|
2064
|
+
|
2065
|
+
sheet_id : typing.Optional[int]
|
2066
|
+
Sheet ID (defaults to 1)
|
2067
|
+
|
2068
|
+
request_options : typing.Optional[RequestOptions]
|
2069
|
+
Request-specific configuration.
|
2070
|
+
|
2071
|
+
Returns
|
2072
|
+
-------
|
2073
|
+
AsyncHttpResponse[SheetOperationResponse]
|
2074
|
+
Successful Response
|
2075
|
+
"""
|
2076
|
+
_response = await self._client_wrapper.httpx_client.request(
|
2077
|
+
"api/v0/tools/sheets/table/column/insert",
|
2078
|
+
method="POST",
|
2079
|
+
json={
|
2080
|
+
"asset_id": asset_id,
|
2081
|
+
"dimension_index": dimension_index,
|
2082
|
+
"direction": direction,
|
2083
|
+
"sheet_id": sheet_id,
|
2084
|
+
"table_id": table_id,
|
2085
|
+
},
|
2086
|
+
headers={
|
2087
|
+
"content-type": "application/json",
|
2088
|
+
},
|
2089
|
+
request_options=request_options,
|
2090
|
+
omit=OMIT,
|
2091
|
+
)
|
2092
|
+
try:
|
2093
|
+
if 200 <= _response.status_code < 300:
|
2094
|
+
_data = typing.cast(
|
2095
|
+
SheetOperationResponse,
|
2096
|
+
parse_obj_as(
|
2097
|
+
type_=SheetOperationResponse, # type: ignore
|
2098
|
+
object_=_response.json(),
|
2099
|
+
),
|
2100
|
+
)
|
2101
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
2102
|
+
if _response.status_code == 422:
|
2103
|
+
raise UnprocessableEntityError(
|
2104
|
+
headers=dict(_response.headers),
|
2105
|
+
body=typing.cast(
|
2106
|
+
typing.Optional[typing.Any],
|
2107
|
+
parse_obj_as(
|
2108
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
2109
|
+
object_=_response.json(),
|
2110
|
+
),
|
2111
|
+
),
|
2112
|
+
)
|
2113
|
+
_response_json = _response.json()
|
2114
|
+
except JSONDecodeError:
|
2115
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
2116
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
2117
|
+
|
2118
|
+
async def create_table(
|
2119
|
+
self,
|
2120
|
+
*,
|
2121
|
+
asset_id: str,
|
2122
|
+
end_column_index: int,
|
2123
|
+
end_row_index: int,
|
2124
|
+
start_column_index: int,
|
2125
|
+
start_row_index: int,
|
2126
|
+
table_id: str,
|
2127
|
+
table_name: str,
|
2128
|
+
sheet_id: typing.Optional[int] = OMIT,
|
2129
|
+
request_options: typing.Optional[RequestOptions] = None,
|
2130
|
+
) -> AsyncHttpResponse[SheetOperationResponse]:
|
2131
|
+
"""
|
2132
|
+
Create a table in an Athena spreadsheet.
|
2133
|
+
|
2134
|
+
Parameters
|
2135
|
+
----------
|
2136
|
+
asset_id : str
|
2137
|
+
The ID of the spreadsheet asset
|
2138
|
+
|
2139
|
+
end_column_index : int
|
2140
|
+
1-based ending column index
|
2141
|
+
|
2142
|
+
end_row_index : int
|
2143
|
+
1-based ending row index
|
2144
|
+
|
2145
|
+
start_column_index : int
|
2146
|
+
1-based starting column index
|
2147
|
+
|
2148
|
+
start_row_index : int
|
2149
|
+
1-based starting row index
|
2150
|
+
|
2151
|
+
table_id : str
|
2152
|
+
Unique table ID
|
2153
|
+
|
2154
|
+
table_name : str
|
2155
|
+
Name of the table
|
2156
|
+
|
2157
|
+
sheet_id : typing.Optional[int]
|
2158
|
+
Sheet ID (defaults to 1)
|
2159
|
+
|
2160
|
+
request_options : typing.Optional[RequestOptions]
|
2161
|
+
Request-specific configuration.
|
2162
|
+
|
2163
|
+
Returns
|
2164
|
+
-------
|
2165
|
+
AsyncHttpResponse[SheetOperationResponse]
|
2166
|
+
Successful Response
|
2167
|
+
"""
|
2168
|
+
_response = await self._client_wrapper.httpx_client.request(
|
2169
|
+
"api/v0/tools/sheets/table/create",
|
2170
|
+
method="POST",
|
2171
|
+
json={
|
2172
|
+
"asset_id": asset_id,
|
2173
|
+
"end_column_index": end_column_index,
|
2174
|
+
"end_row_index": end_row_index,
|
2175
|
+
"sheet_id": sheet_id,
|
2176
|
+
"start_column_index": start_column_index,
|
2177
|
+
"start_row_index": start_row_index,
|
2178
|
+
"table_id": table_id,
|
2179
|
+
"table_name": table_name,
|
2180
|
+
},
|
2181
|
+
headers={
|
2182
|
+
"content-type": "application/json",
|
2183
|
+
},
|
2184
|
+
request_options=request_options,
|
2185
|
+
omit=OMIT,
|
2186
|
+
)
|
2187
|
+
try:
|
2188
|
+
if 200 <= _response.status_code < 300:
|
2189
|
+
_data = typing.cast(
|
2190
|
+
SheetOperationResponse,
|
2191
|
+
parse_obj_as(
|
2192
|
+
type_=SheetOperationResponse, # type: ignore
|
2193
|
+
object_=_response.json(),
|
2194
|
+
),
|
2195
|
+
)
|
2196
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
2197
|
+
if _response.status_code == 422:
|
2198
|
+
raise UnprocessableEntityError(
|
2199
|
+
headers=dict(_response.headers),
|
2200
|
+
body=typing.cast(
|
2201
|
+
typing.Optional[typing.Any],
|
2202
|
+
parse_obj_as(
|
2203
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
2204
|
+
object_=_response.json(),
|
2205
|
+
),
|
2206
|
+
),
|
2207
|
+
)
|
2208
|
+
_response_json = _response.json()
|
2209
|
+
except JSONDecodeError:
|
2210
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
2211
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
2212
|
+
|
2213
|
+
async def update_table(
|
2214
|
+
self,
|
2215
|
+
*,
|
2216
|
+
asset_id: str,
|
2217
|
+
end_column_index: int,
|
2218
|
+
end_row_index: int,
|
2219
|
+
start_column_index: int,
|
2220
|
+
start_row_index: int,
|
2221
|
+
table_id: str,
|
2222
|
+
table_name: str,
|
2223
|
+
sheet_id: typing.Optional[int] = OMIT,
|
2224
|
+
request_options: typing.Optional[RequestOptions] = None,
|
2225
|
+
) -> AsyncHttpResponse[SheetOperationResponse]:
|
2226
|
+
"""
|
2227
|
+
Update an existing table in an Athena spreadsheet.
|
2228
|
+
|
2229
|
+
Parameters
|
2230
|
+
----------
|
2231
|
+
asset_id : str
|
2232
|
+
The ID of the spreadsheet asset
|
2233
|
+
|
2234
|
+
end_column_index : int
|
2235
|
+
1-based ending column index
|
2236
|
+
|
2237
|
+
end_row_index : int
|
2238
|
+
1-based ending row index
|
2239
|
+
|
2240
|
+
start_column_index : int
|
2241
|
+
1-based starting column index
|
2242
|
+
|
2243
|
+
start_row_index : int
|
2244
|
+
1-based starting row index
|
2245
|
+
|
2246
|
+
table_id : str
|
2247
|
+
Table ID to update
|
2248
|
+
|
2249
|
+
table_name : str
|
2250
|
+
Name of the table
|
2251
|
+
|
2252
|
+
sheet_id : typing.Optional[int]
|
2253
|
+
Sheet ID (defaults to 1)
|
2254
|
+
|
2255
|
+
request_options : typing.Optional[RequestOptions]
|
2256
|
+
Request-specific configuration.
|
2257
|
+
|
2258
|
+
Returns
|
2259
|
+
-------
|
2260
|
+
AsyncHttpResponse[SheetOperationResponse]
|
2261
|
+
Successful Response
|
2262
|
+
"""
|
2263
|
+
_response = await self._client_wrapper.httpx_client.request(
|
2264
|
+
"api/v0/tools/sheets/table/update",
|
2265
|
+
method="POST",
|
2266
|
+
json={
|
2267
|
+
"asset_id": asset_id,
|
2268
|
+
"end_column_index": end_column_index,
|
2269
|
+
"end_row_index": end_row_index,
|
2270
|
+
"sheet_id": sheet_id,
|
2271
|
+
"start_column_index": start_column_index,
|
2272
|
+
"start_row_index": start_row_index,
|
2273
|
+
"table_id": table_id,
|
2274
|
+
"table_name": table_name,
|
2275
|
+
},
|
2276
|
+
headers={
|
2277
|
+
"content-type": "application/json",
|
2278
|
+
},
|
2279
|
+
request_options=request_options,
|
2280
|
+
omit=OMIT,
|
2281
|
+
)
|
2282
|
+
try:
|
2283
|
+
if 200 <= _response.status_code < 300:
|
2284
|
+
_data = typing.cast(
|
2285
|
+
SheetOperationResponse,
|
2286
|
+
parse_obj_as(
|
2287
|
+
type_=SheetOperationResponse, # type: ignore
|
2288
|
+
object_=_response.json(),
|
2289
|
+
),
|
2290
|
+
)
|
2291
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
2292
|
+
if _response.status_code == 422:
|
2293
|
+
raise UnprocessableEntityError(
|
2294
|
+
headers=dict(_response.headers),
|
2295
|
+
body=typing.cast(
|
2296
|
+
typing.Optional[typing.Any],
|
2297
|
+
parse_obj_as(
|
2298
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
2299
|
+
object_=_response.json(),
|
2300
|
+
),
|
2301
|
+
),
|
2302
|
+
)
|
2303
|
+
_response_json = _response.json()
|
2304
|
+
except JSONDecodeError:
|
2305
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
2306
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|