Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 90
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-a6a1b7ffd49d131bfc4a1e8e508ac1fe23875c64b27c99f97dd4df06ea5e3ff5.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb-6bef7452aabfcad0e298c7e0bbbd90aa6a1d954ad99a04fe756b827fd12a7ce9.yml
9 changes: 9 additions & 0 deletions src/orb/resources/invoices.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from .. import _legacy_response
from ..types import (
shared_params,
invoice_list_params,
invoice_create_params,
invoice_mark_paid_params,
Expand Down Expand Up @@ -51,6 +52,7 @@ def create(
line_items: Iterable[invoice_create_params.LineItem],
net_terms: int,
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
discount: Optional[shared_params.Discount] | NotGiven = NOT_GIVEN,
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,
memo: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -81,6 +83,8 @@ def create(
customer_id: The id of the `Customer` to create this invoice for. One of `customer_id` and
`external_customer_id` are required.

discount: An optional discount to attach to the invoice.

external_customer_id: The `external_customer_id` of the `Customer` to create this invoice for. One of
`customer_id` and `external_customer_id` are required.

Expand Down Expand Up @@ -112,6 +116,7 @@ def create(
"line_items": line_items,
"net_terms": net_terms,
"customer_id": customer_id,
"discount": discount,
"external_customer_id": external_customer_id,
"memo": memo,
"metadata": metadata,
Expand Down Expand Up @@ -462,6 +467,7 @@ async def create(
line_items: Iterable[invoice_create_params.LineItem],
net_terms: int,
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
discount: Optional[shared_params.Discount] | NotGiven = NOT_GIVEN,
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,
memo: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -492,6 +498,8 @@ async def create(
customer_id: The id of the `Customer` to create this invoice for. One of `customer_id` and
`external_customer_id` are required.

discount: An optional discount to attach to the invoice.

external_customer_id: The `external_customer_id` of the `Customer` to create this invoice for. One of
`customer_id` and `external_customer_id` are required.

Expand Down Expand Up @@ -523,6 +531,7 @@ async def create(
"line_items": line_items,
"net_terms": net_terms,
"customer_id": customer_id,
"discount": discount,
"external_customer_id": external_customer_id,
"memo": memo,
"metadata": metadata,
Expand Down
36 changes: 7 additions & 29 deletions src/orb/resources/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Dict, Iterable, Optional
from typing import Iterable, Optional

import httpx

Expand Down Expand Up @@ -81,7 +81,6 @@ def update(
item_id: str,
*,
external_connections: Optional[Iterable[item_update_params.ExternalConnection]],
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -90,15 +89,10 @@ def update(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
idempotency_key: str | None = None,
) -> Item:
"""Update items
"""
Update items

Args:
metadata: User-specified key/value pairs for the resource.

Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -113,13 +107,7 @@ def update(
raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
return self._put(
f"/items/{item_id}",
body=maybe_transform(
{
"external_connections": external_connections,
"metadata": metadata,
},
item_update_params.ItemUpdateParams,
),
body=maybe_transform({"external_connections": external_connections}, item_update_params.ItemUpdateParams),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand Down Expand Up @@ -268,7 +256,6 @@ async def update(
item_id: str,
*,
external_connections: Optional[Iterable[item_update_params.ExternalConnection]],
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -277,15 +264,10 @@ async def update(
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
idempotency_key: str | None = None,
) -> Item:
"""Update items
"""
Update items

Args:
metadata: User-specified key/value pairs for the resource.

Individual keys can be removed
by setting the value to `null`, and the entire metadata mapping can be cleared
by setting `metadata` to `null`.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -301,11 +283,7 @@ async def update(
return await self._put(
f"/items/{item_id}",
body=await async_maybe_transform(
{
"external_connections": external_connections,
"metadata": metadata,
},
item_update_params.ItemUpdateParams,
{"external_connections": external_connections}, item_update_params.ItemUpdateParams
),
options=make_request_options(
extra_headers=extra_headers,
Expand Down
Loading