Skip to content

Commit 18ed221

Browse files
SDK regeneration
1 parent 202f560 commit 18ed221

File tree

68 files changed

+2301
-3891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2301
-3891
lines changed

.fern/metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"cliVersion": "2.2.5",
2+
"cliVersion": "3.20.0",
33
"generatorName": "fernapi/fern-python-sdk",
4-
"generatorVersion": "4.38.4",
4+
"generatorVersion": "4.45.9",
55
"generatorConfig": {
66
"client": {
77
"class_name": "Square",

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
[project]
22
name = "squareup"
3+
dynamic = ["version"]
34

45
[tool.poetry]
56
name = "squareup"
6-
version = "43.2.1.20251016"
7+
version = "43.3.0.20251016"
78
description = ""
89
readme = "README.md"
910
authors = []

reference.md

Lines changed: 343 additions & 357 deletions
Large diffs are not rendered by default.

src/square/catalog/client.py

Lines changed: 8 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -262,34 +262,10 @@ def batch_upsert(
262262
batches=[
263263
{
264264
"objects": [
265-
{
266-
"type": "IMAGE",
267-
"id": "#Tea",
268-
"present_at_all_locations": True,
269-
},
270-
{
271-
"type": "IMAGE",
272-
"id": "#Coffee",
273-
"present_at_all_locations": True,
274-
},
275-
{
276-
"type": "ITEM",
277-
"id": "#Beverages",
278-
"present_at_all_locations": True,
279-
},
280-
{
281-
"type": "TAX",
282-
"id": "#SalesTax",
283-
"present_at_all_locations": True,
284-
"tax_data": {
285-
"name": "Sales Tax",
286-
"calculation_phase": "TAX_SUBTOTAL_PHASE",
287-
"inclusion_type": "ADDITIVE",
288-
"percentage": "5.0",
289-
"applies_to_custom_amounts": True,
290-
"enabled": True,
291-
},
292-
},
265+
{"id": "id", "type": "ITEM"},
266+
{"id": "id", "type": "ITEM"},
267+
{"id": "id", "type": "ITEM"},
268+
{"id": "id", "type": "TAX"},
293269
]
294270
}
295271
],
@@ -1019,34 +995,10 @@ async def main() -> None:
1019995
batches=[
1020996
{
1021997
"objects": [
1022-
{
1023-
"type": "IMAGE",
1024-
"id": "#Tea",
1025-
"present_at_all_locations": True,
1026-
},
1027-
{
1028-
"type": "IMAGE",
1029-
"id": "#Coffee",
1030-
"present_at_all_locations": True,
1031-
},
1032-
{
1033-
"type": "ITEM",
1034-
"id": "#Beverages",
1035-
"present_at_all_locations": True,
1036-
},
1037-
{
1038-
"type": "TAX",
1039-
"id": "#SalesTax",
1040-
"present_at_all_locations": True,
1041-
"tax_data": {
1042-
"name": "Sales Tax",
1043-
"calculation_phase": "TAX_SUBTOTAL_PHASE",
1044-
"inclusion_type": "ADDITIVE",
1045-
"percentage": "5.0",
1046-
"applies_to_custom_amounts": True,
1047-
"enabled": True,
1048-
},
1049-
},
998+
{"id": "id", "type": "ITEM"},
999+
{"id": "id", "type": "ITEM"},
1000+
{"id": "id", "type": "ITEM"},
1001+
{"id": "id", "type": "TAX"},
10501002
]
10511003
}
10521004
],

src/square/catalog/object/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def upsert(
8080
)
8181
client.catalog.object.upsert(
8282
idempotency_key="af3d1afc-7212-4300-b463-0bfc5314a5ae",
83-
object={"type": "IMAGE", "id": "#Cocoa"},
83+
object={"id": "id", "type": "ITEM"},
8484
)
8585
"""
8686
_response = self._raw_client.upsert(
@@ -286,7 +286,7 @@ async def upsert(
286286
async def main() -> None:
287287
await client.catalog.object.upsert(
288288
idempotency_key="af3d1afc-7212-4300-b463-0bfc5314a5ae",
289-
object={"type": "IMAGE", "id": "#Cocoa"},
289+
object={"id": "id", "type": "ITEM"},
290290
)
291291
292292

src/square/core/client_wrapper.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ def __init__(
2424

2525
def get_headers(self) -> typing.Dict[str, str]:
2626
headers: typing.Dict[str, str] = {
27-
"User-Agent": "squareup/43.2.1.20251016",
27+
"User-Agent": "squareup/43.3.0.20251016",
2828
"X-Fern-Language": "Python",
2929
"X-Fern-SDK-Name": "squareup",
30-
"X-Fern-SDK-Version": "43.2.1.20251016",
30+
"X-Fern-SDK-Version": "43.3.0.20251016",
3131
**(self.get_custom_headers() or {}),
3232
}
3333
token = self._get_token()
@@ -81,12 +81,22 @@ def __init__(
8181
base_url: str,
8282
timeout: typing.Optional[float] = None,
8383
version: typing.Optional[str] = None,
84+
async_token: typing.Optional[typing.Callable[[], typing.Awaitable[str]]] = None,
8485
httpx_client: httpx.AsyncClient,
8586
):
8687
super().__init__(token=token, headers=headers, base_url=base_url, timeout=timeout, version=version)
88+
self._async_token = async_token
8789
self.httpx_client = AsyncHttpClient(
8890
httpx_client=httpx_client,
8991
base_headers=self.get_headers,
9092
base_timeout=self.get_timeout,
9193
base_url=self.get_base_url,
94+
async_base_headers=self.async_get_headers,
9295
)
96+
97+
async def async_get_headers(self) -> typing.Dict[str, str]:
98+
headers = self.get_headers()
99+
if self._async_token is not None:
100+
token = await self._async_token()
101+
headers["Authorization"] = f"Bearer {token}"
102+
return headers

0 commit comments

Comments
 (0)