Skip to content

Commit 4b07848

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api)!: add semi_annual cadence and remove metadata from update items (#288)
1 parent cf8d370 commit 4b07848

19 files changed

+435
-190
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 90
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-a6a1b7ffd49d131bfc4a1e8e508ac1fe23875c64b27c99f97dd4df06ea5e3ff5.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-6bef7452aabfcad0e298c7e0bbbd90aa6a1d954ad99a04fe756b827fd12a7ce9.yml

src/orb/resources/invoices.py

+9
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
from .. import _legacy_response
1212
from ..types import (
13+
shared_params,
1314
invoice_list_params,
1415
invoice_create_params,
1516
invoice_mark_paid_params,
@@ -51,6 +52,7 @@ def create(
5152
line_items: Iterable[invoice_create_params.LineItem],
5253
net_terms: int,
5354
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
55+
discount: Optional[shared_params.Discount] | NotGiven = NOT_GIVEN,
5456
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,
5557
memo: Optional[str] | NotGiven = NOT_GIVEN,
5658
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
@@ -81,6 +83,8 @@ def create(
8183
customer_id: The id of the `Customer` to create this invoice for. One of `customer_id` and
8284
`external_customer_id` are required.
8385
86+
discount: An optional discount to attach to the invoice.
87+
8488
external_customer_id: The `external_customer_id` of the `Customer` to create this invoice for. One of
8589
`customer_id` and `external_customer_id` are required.
8690
@@ -112,6 +116,7 @@ def create(
112116
"line_items": line_items,
113117
"net_terms": net_terms,
114118
"customer_id": customer_id,
119+
"discount": discount,
115120
"external_customer_id": external_customer_id,
116121
"memo": memo,
117122
"metadata": metadata,
@@ -462,6 +467,7 @@ async def create(
462467
line_items: Iterable[invoice_create_params.LineItem],
463468
net_terms: int,
464469
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
470+
discount: Optional[shared_params.Discount] | NotGiven = NOT_GIVEN,
465471
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,
466472
memo: Optional[str] | NotGiven = NOT_GIVEN,
467473
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
@@ -492,6 +498,8 @@ async def create(
492498
customer_id: The id of the `Customer` to create this invoice for. One of `customer_id` and
493499
`external_customer_id` are required.
494500
501+
discount: An optional discount to attach to the invoice.
502+
495503
external_customer_id: The `external_customer_id` of the `Customer` to create this invoice for. One of
496504
`customer_id` and `external_customer_id` are required.
497505
@@ -523,6 +531,7 @@ async def create(
523531
"line_items": line_items,
524532
"net_terms": net_terms,
525533
"customer_id": customer_id,
534+
"discount": discount,
526535
"external_customer_id": external_customer_id,
527536
"memo": memo,
528537
"metadata": metadata,

src/orb/resources/items.py

+7-29
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Iterable, Optional
5+
from typing import Iterable, Optional
66

77
import httpx
88

@@ -81,7 +81,6 @@ def update(
8181
item_id: str,
8282
*,
8383
external_connections: Optional[Iterable[item_update_params.ExternalConnection]],
84-
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
8584
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
8685
# The extra values given here take precedence over values defined on the client or passed to this method.
8786
extra_headers: Headers | None = None,
@@ -90,15 +89,10 @@ def update(
9089
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
9190
idempotency_key: str | None = None,
9291
) -> Item:
93-
"""Update items
92+
"""
93+
Update items
9494
9595
Args:
96-
metadata: User-specified key/value pairs for the resource.
97-
98-
Individual keys can be removed
99-
by setting the value to `null`, and the entire metadata mapping can be cleared
100-
by setting `metadata` to `null`.
101-
10296
extra_headers: Send extra headers
10397
10498
extra_query: Add additional query parameters to the request
@@ -113,13 +107,7 @@ def update(
113107
raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
114108
return self._put(
115109
f"/items/{item_id}",
116-
body=maybe_transform(
117-
{
118-
"external_connections": external_connections,
119-
"metadata": metadata,
120-
},
121-
item_update_params.ItemUpdateParams,
122-
),
110+
body=maybe_transform({"external_connections": external_connections}, item_update_params.ItemUpdateParams),
123111
options=make_request_options(
124112
extra_headers=extra_headers,
125113
extra_query=extra_query,
@@ -268,7 +256,6 @@ async def update(
268256
item_id: str,
269257
*,
270258
external_connections: Optional[Iterable[item_update_params.ExternalConnection]],
271-
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
272259
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
273260
# The extra values given here take precedence over values defined on the client or passed to this method.
274261
extra_headers: Headers | None = None,
@@ -277,15 +264,10 @@ async def update(
277264
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
278265
idempotency_key: str | None = None,
279266
) -> Item:
280-
"""Update items
267+
"""
268+
Update items
281269
282270
Args:
283-
metadata: User-specified key/value pairs for the resource.
284-
285-
Individual keys can be removed
286-
by setting the value to `null`, and the entire metadata mapping can be cleared
287-
by setting `metadata` to `null`.
288-
289271
extra_headers: Send extra headers
290272
291273
extra_query: Add additional query parameters to the request
@@ -301,11 +283,7 @@ async def update(
301283
return await self._put(
302284
f"/items/{item_id}",
303285
body=await async_maybe_transform(
304-
{
305-
"external_connections": external_connections,
306-
"metadata": metadata,
307-
},
308-
item_update_params.ItemUpdateParams,
286+
{"external_connections": external_connections}, item_update_params.ItemUpdateParams
309287
),
310288
options=make_request_options(
311289
extra_headers=extra_headers,

0 commit comments

Comments
 (0)