Skip to content

Commit a7f4558

Browse files
feat(api): api update
1 parent b614107 commit a7f4558

File tree

4 files changed

+27
-12
lines changed

4 files changed

+27
-12
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: 118
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-ef726ad139fa29757029206ee08150434fc6c52005fec6d42c7d2bcd3aa7ab47.yml
3-
openapi_spec_hash: e622beb7c26f9b0dd641bd5c92735a5b
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-faf1f7c723d2762f09e9690ef2ceda58cb0a6ddacf1a79c3754871b90e7db0dc.yml
3+
openapi_spec_hash: 22269f85fae1ec920bdb0b32435a7aa8
44
config_hash: dd4343ce95871032ef6e0735a4ca038c

src/orb/resources/invoices.py

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ def update(
154154
invoice_id: str,
155155
*,
156156
due_date: Union[Union[str, date], Union[str, datetime], None] | Omit = omit,
157+
invoice_date: Union[Union[str, date], Union[str, datetime], None] | Omit = omit,
157158
metadata: Optional[Dict[str, Optional[str]]] | Omit = omit,
158159
net_terms: Optional[int] | Omit = omit,
159160
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -165,17 +166,20 @@ def update(
165166
idempotency_key: str | None = None,
166167
) -> Invoice:
167168
"""
168-
This endpoint allows you to update the `metadata`, `net_terms`, and `due_date`
169-
properties on an invoice. If you pass null for the metadata value, it will clear
170-
any existing metadata for that invoice.
169+
This endpoint allows you to update the `metadata`, `net_terms`, `due_date`, and
170+
`invoice_date` properties on an invoice. If you pass null for the metadata
171+
value, it will clear any existing metadata for that invoice.
171172
172-
`metadata` can be modified regardless of invoice state. `net_terms` and
173-
`due_date` can only be modified if the invoice is in a `draft` state.
173+
`metadata` can be modified regardless of invoice state. `net_terms`, `due_date`,
174+
and `invoice_date` can only be modified if the invoice is in a `draft` state.
175+
`invoice_date` can only be modified for non-subscription invoices.
174176
175177
Args:
176178
due_date: An optional custom due date for the invoice. If not set, the due date will be
177179
calculated based on the `net_terms` value.
178180
181+
invoice_date: The date of the invoice. Can only be modified for one-off draft invoices.
182+
179183
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
180184
by setting the value to `null`, and the entire metadata mapping can be cleared
181185
by setting `metadata` to `null`.
@@ -203,6 +207,7 @@ def update(
203207
body=maybe_transform(
204208
{
205209
"due_date": due_date,
210+
"invoice_date": invoice_date,
206211
"metadata": metadata,
207212
"net_terms": net_terms,
208213
},
@@ -719,6 +724,7 @@ async def update(
719724
invoice_id: str,
720725
*,
721726
due_date: Union[Union[str, date], Union[str, datetime], None] | Omit = omit,
727+
invoice_date: Union[Union[str, date], Union[str, datetime], None] | Omit = omit,
722728
metadata: Optional[Dict[str, Optional[str]]] | Omit = omit,
723729
net_terms: Optional[int] | Omit = omit,
724730
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -730,17 +736,20 @@ async def update(
730736
idempotency_key: str | None = None,
731737
) -> Invoice:
732738
"""
733-
This endpoint allows you to update the `metadata`, `net_terms`, and `due_date`
734-
properties on an invoice. If you pass null for the metadata value, it will clear
735-
any existing metadata for that invoice.
739+
This endpoint allows you to update the `metadata`, `net_terms`, `due_date`, and
740+
`invoice_date` properties on an invoice. If you pass null for the metadata
741+
value, it will clear any existing metadata for that invoice.
736742
737-
`metadata` can be modified regardless of invoice state. `net_terms` and
738-
`due_date` can only be modified if the invoice is in a `draft` state.
743+
`metadata` can be modified regardless of invoice state. `net_terms`, `due_date`,
744+
and `invoice_date` can only be modified if the invoice is in a `draft` state.
745+
`invoice_date` can only be modified for non-subscription invoices.
739746
740747
Args:
741748
due_date: An optional custom due date for the invoice. If not set, the due date will be
742749
calculated based on the `net_terms` value.
743750
751+
invoice_date: The date of the invoice. Can only be modified for one-off draft invoices.
752+
744753
metadata: User-specified key/value pairs for the resource. Individual keys can be removed
745754
by setting the value to `null`, and the entire metadata mapping can be cleared
746755
by setting `metadata` to `null`.
@@ -768,6 +777,7 @@ async def update(
768777
body=await async_maybe_transform(
769778
{
770779
"due_date": due_date,
780+
"invoice_date": invoice_date,
771781
"metadata": metadata,
772782
"net_terms": net_terms,
773783
},

src/orb/types/invoice_update_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ class InvoiceUpdateParams(TypedDict, total=False):
1818
If not set, the due date will be calculated based on the `net_terms` value.
1919
"""
2020

21+
invoice_date: Annotated[Union[Union[str, date], Union[str, datetime], None], PropertyInfo(format="iso8601")]
22+
"""The date of the invoice. Can only be modified for one-off draft invoices."""
23+
2124
metadata: Optional[Dict[str, Optional[str]]]
2225
"""User-specified key/value pairs for the resource.
2326

tests/api_resources/test_invoices.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ def test_method_update_with_all_params(self, client: Orb) -> None:
140140
invoice = client.invoices.update(
141141
invoice_id="invoice_id",
142142
due_date=parse_date("2023-09-22"),
143+
invoice_date=parse_date("2023-09-22"),
143144
metadata={"foo": "string"},
144145
net_terms=0,
145146
)
@@ -593,6 +594,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncOrb) -> No
593594
invoice = await async_client.invoices.update(
594595
invoice_id="invoice_id",
595596
due_date=parse_date("2023-09-22"),
597+
invoice_date=parse_date("2023-09-22"),
596598
metadata={"foo": "string"},
597599
net_terms=0,
598600
)

0 commit comments

Comments
 (0)