Skip to content

Commit 7fec694

Browse files
feat(api): api update
1 parent bf3e37a commit 7fec694

File tree

7 files changed

+106
-17
lines changed

7 files changed

+106
-17
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 10
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/grid%2Fspreadsheet-api-ae41932155230b865ddb20e28d874de8256f130bc59c0ba67125d52e2e43586a.yml
3-
openapi_spec_hash: a297de17280f9fbb7a85f72ac89dc9b1
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/grid%2Fspreadsheet-api-b337c0f981b3b48777c64c32edd73eb2b7bd513a38e077d7b342b7b372bc271d.yml
3+
openapi_spec_hash: 1a4275d62efcaaa62594d2bb734cf4eb
44
config_hash: d3f4645d9a93970cbead53b83c49a2c4

src/grid_api/resources/workbooks.py

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,18 @@ def calc(
131131
Run calculations in a workbook and retrieve cell objects.
132132
133133
Args:
134+
apply: Map of cell references to values. The values are written to cells in the
135+
spreadsheet before performing the read operation. You can write numbers,
136+
strings, and booleans. Any updated values are discarded at the end of the
137+
request.
138+
139+
```json
140+
{
141+
"apply": { "A1": 10, "A2": 2.718, "A3": "Total", "A4": true, "A5": null }
142+
// ...
143+
}
144+
```
145+
134146
extra_headers: Send extra headers
135147
136148
extra_query: Add additional query parameters to the request
@@ -175,7 +187,7 @@ def export(
175187
exported.
176188
177189
Args:
178-
apply: Cells to update before exporting
190+
apply: Cells to update before exporting.
179191
180192
goal_seek: Goal seek. Use this to calculate the required input value for a formula to
181193
achieve a specified target result. This is particularly useful when the desired
@@ -292,8 +304,7 @@ def render_chart(
292304
chart: Options for rendering a chart from workbook data. Specify the data range, chart
293305
type, image output format, and title and axis labels.
294306
295-
apply: Cells to update before rendering the chart. Changes are discarded at the end of
296-
the request
307+
apply: Cells to update before rendering the chart.
297308
298309
matte: Hex color code for the chart's background matte, e.g. '#FFFFFF' for white, if
299310
not specified, the chart will have a transparent background. Note, this is
@@ -392,6 +403,18 @@ def values(
392403
Run calculations in a workbook and retrieve cell values.
393404
394405
Args:
406+
apply: Map of cell references to values. The values are written to cells in the
407+
spreadsheet before performing the read operation. You can write numbers,
408+
strings, and booleans. Any updated values are discarded at the end of the
409+
request.
410+
411+
```json
412+
{
413+
"apply": { "A1": 10, "A2": 2.718, "A3": "Total", "A4": true, "A5": null }
414+
// ...
415+
}
416+
```
417+
395418
extra_headers: Send extra headers
396419
397420
extra_query: Add additional query parameters to the request
@@ -505,6 +528,18 @@ async def calc(
505528
Run calculations in a workbook and retrieve cell objects.
506529
507530
Args:
531+
apply: Map of cell references to values. The values are written to cells in the
532+
spreadsheet before performing the read operation. You can write numbers,
533+
strings, and booleans. Any updated values are discarded at the end of the
534+
request.
535+
536+
```json
537+
{
538+
"apply": { "A1": 10, "A2": 2.718, "A3": "Total", "A4": true, "A5": null }
539+
// ...
540+
}
541+
```
542+
508543
extra_headers: Send extra headers
509544
510545
extra_query: Add additional query parameters to the request
@@ -549,7 +584,7 @@ async def export(
549584
exported.
550585
551586
Args:
552-
apply: Cells to update before exporting
587+
apply: Cells to update before exporting.
553588
554589
goal_seek: Goal seek. Use this to calculate the required input value for a formula to
555590
achieve a specified target result. This is particularly useful when the desired
@@ -666,8 +701,7 @@ async def render_chart(
666701
chart: Options for rendering a chart from workbook data. Specify the data range, chart
667702
type, image output format, and title and axis labels.
668703
669-
apply: Cells to update before rendering the chart. Changes are discarded at the end of
670-
the request
704+
apply: Cells to update before rendering the chart.
671705
672706
matte: Hex color code for the chart's background matte, e.g. '#FFFFFF' for white, if
673707
not specified, the chart will have a transparent background. Note, this is
@@ -766,6 +800,18 @@ async def values(
766800
Run calculations in a workbook and retrieve cell values.
767801
768802
Args:
803+
apply: Map of cell references to values. The values are written to cells in the
804+
spreadsheet before performing the read operation. You can write numbers,
805+
strings, and booleans. Any updated values are discarded at the end of the
806+
request.
807+
808+
```json
809+
{
810+
"apply": { "A1": 10, "A2": 2.718, "A3": "Total", "A4": true, "A5": null }
811+
// ...
812+
}
813+
```
814+
769815
extra_headers: Send extra headers
770816
771817
extra_query: Add additional query parameters to the request

src/grid_api/types/workbook_calc_params.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,16 @@ class WorkbookCalcParams(TypedDict, total=False):
1414
read: Required[SequenceNotStr[str]]
1515

1616
apply: Optional[Dict[str, Union[float, str, bool, None]]]
17+
"""Map of cell references to values.
18+
19+
The values are written to cells in the spreadsheet before performing the read
20+
operation. You can write numbers, strings, and booleans. Any updated values are
21+
discarded at the end of the request.
22+
23+
```json
24+
{
25+
"apply": { "A1": 10, "A2": 2.718, "A3": "Total", "A4": true, "A5": null }
26+
// ...
27+
}
28+
```
29+
"""

src/grid_api/types/workbook_export_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
class WorkbookExportParams(TypedDict, total=False):
2424
apply: Optional[Iterable[Apply]]
25-
"""Cells to update before exporting"""
25+
"""Cells to update before exporting."""
2626

2727
goal_seek: Annotated[Optional[GoalSeek], PropertyInfo(alias="goalSeek")]
2828
"""Goal seek.

src/grid_api/types/workbook_render_chart_params.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ class WorkbookRenderChartParams(TypedDict, total=False):
2727
"""
2828

2929
apply: Optional[Iterable[Apply]]
30-
"""Cells to update before rendering the chart.
31-
32-
Changes are discarded at the end of the request
33-
"""
30+
"""Cells to update before rendering the chart."""
3431

3532
matte: Optional[str]
3633
"""Hex color code for the chart's background matte, e.g.

src/grid_api/types/workbook_values_params.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,16 @@ class WorkbookValuesParams(TypedDict, total=False):
1414
read: Required[SequenceNotStr[str]]
1515

1616
apply: Optional[Dict[str, Union[float, str, bool, None]]]
17+
"""Map of cell references to values.
18+
19+
The values are written to cells in the spreadsheet before performing the read
20+
operation. You can write numbers, strings, and booleans. Any updated values are
21+
discarded at the end of the request.
22+
23+
```json
24+
{
25+
"apply": { "A1": 10, "A2": 2.718, "A3": "Total", "A4": true, "A5": null }
26+
// ...
27+
}
28+
```
29+
"""

tests/api_resources/test_workbooks.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,12 @@ def test_method_calc_with_all_params(self, client: Grid) -> None:
8484
workbook = client.workbooks.calc(
8585
id="id",
8686
read=["A1"],
87-
apply={"foo": 1234},
87+
apply={
88+
"A1": 100,
89+
"A2": 2.718,
90+
"A3": "Total",
91+
"A4": True,
92+
},
8893
)
8994
assert_matches_type(WorkbookCalcResponse, workbook, path=["response"])
9095

@@ -425,7 +430,12 @@ def test_method_values_with_all_params(self, client: Grid) -> None:
425430
workbook = client.workbooks.values(
426431
id="id",
427432
read=["A1"],
428-
apply={"foo": 1234},
433+
apply={
434+
"A1": 100,
435+
"A2": 2.718,
436+
"A3": "Total",
437+
"A4": True,
438+
},
429439
)
430440
assert_matches_type(WorkbookValuesResponse, workbook, path=["response"])
431441

@@ -524,7 +534,12 @@ async def test_method_calc_with_all_params(self, async_client: AsyncGrid) -> Non
524534
workbook = await async_client.workbooks.calc(
525535
id="id",
526536
read=["A1"],
527-
apply={"foo": 1234},
537+
apply={
538+
"A1": 100,
539+
"A2": 2.718,
540+
"A3": "Total",
541+
"A4": True,
542+
},
528543
)
529544
assert_matches_type(WorkbookCalcResponse, workbook, path=["response"])
530545

@@ -865,7 +880,12 @@ async def test_method_values_with_all_params(self, async_client: AsyncGrid) -> N
865880
workbook = await async_client.workbooks.values(
866881
id="id",
867882
read=["A1"],
868-
apply={"foo": 1234},
883+
apply={
884+
"A1": 100,
885+
"A2": 2.718,
886+
"A3": "Total",
887+
"A4": True,
888+
},
869889
)
870890
assert_matches_type(WorkbookValuesResponse, workbook, path=["response"])
871891

0 commit comments

Comments
 (0)