Skip to content

Commit 5a6bfe1

Browse files
feat(api): api update
1 parent 2179819 commit 5a6bfe1

File tree

4 files changed

+26
-32
lines changed

4 files changed

+26
-32
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: 116
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-373ca3e805c414f75a90b0088c57cbb60ff207abdca0a8e397c551de88606c4a.yml
3-
openapi_spec_hash: 1c30d01bd9c38f8a2aa4bd088fbe69bc
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-a44cccd16bb58080f7cc0669999403f6ed3f77287fad901caa6fd2523f2fbafd.yml
3+
openapi_spec_hash: af6444648d0b2a70b7f7ad234bd37541
44
config_hash: 1f535c1fa222aacf28b636eed21bec72

src/orb/resources/invoices.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ def create(
5757
currency: str,
5858
invoice_date: Union[str, datetime],
5959
line_items: Iterable[invoice_create_params.LineItem],
60-
net_terms: int,
6160
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
6261
discount: Optional[Discount] | NotGiven = NOT_GIVEN,
6362
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,
6463
memo: Optional[str] | NotGiven = NOT_GIVEN,
6564
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
65+
net_terms: Optional[int] | NotGiven = NOT_GIVEN,
6666
will_auto_issue: bool | NotGiven = NOT_GIVEN,
6767
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6868
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -82,11 +82,6 @@ def create(
8282
invoice_date: Optional invoice date to set. Must be in the past, if not set, `invoice_date` is
8383
set to the current time in the customer's timezone.
8484
85-
net_terms: Determines the difference between the invoice issue date for subscription
86-
invoices as the date that they are due. A value of '0' here represents that the
87-
invoice is due on issue, whereas a value of 30 represents that the customer has
88-
30 days to pay the invoice.
89-
9085
customer_id: The id of the `Customer` to create this invoice for. One of `customer_id` and
9186
`external_customer_id` are required.
9287
@@ -101,6 +96,11 @@ def create(
10196
by setting the value to `null`, and the entire metadata mapping can be cleared
10297
by setting `metadata` to `null`.
10398
99+
net_terms: Determines the difference between the invoice issue date for subscription
100+
invoices as the date that they are due. A value of '0' here represents that the
101+
invoice is due on issue, whereas a value of 30 represents that the customer has
102+
30 days to pay the invoice.
103+
104104
will_auto_issue: When true, this invoice will be submitted for issuance upon creation. When
105105
false, the resulting invoice will require manual review to issue. Defaulted to
106106
false.
@@ -122,12 +122,12 @@ def create(
122122
"currency": currency,
123123
"invoice_date": invoice_date,
124124
"line_items": line_items,
125-
"net_terms": net_terms,
126125
"customer_id": customer_id,
127126
"discount": discount,
128127
"external_customer_id": external_customer_id,
129128
"memo": memo,
130129
"metadata": metadata,
130+
"net_terms": net_terms,
131131
"will_auto_issue": will_auto_issue,
132132
},
133133
invoice_create_params.InvoiceCreateParams,
@@ -597,12 +597,12 @@ async def create(
597597
currency: str,
598598
invoice_date: Union[str, datetime],
599599
line_items: Iterable[invoice_create_params.LineItem],
600-
net_terms: int,
601600
customer_id: Optional[str] | NotGiven = NOT_GIVEN,
602601
discount: Optional[Discount] | NotGiven = NOT_GIVEN,
603602
external_customer_id: Optional[str] | NotGiven = NOT_GIVEN,
604603
memo: Optional[str] | NotGiven = NOT_GIVEN,
605604
metadata: Optional[Dict[str, Optional[str]]] | NotGiven = NOT_GIVEN,
605+
net_terms: Optional[int] | NotGiven = NOT_GIVEN,
606606
will_auto_issue: bool | NotGiven = NOT_GIVEN,
607607
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
608608
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -622,11 +622,6 @@ async def create(
622622
invoice_date: Optional invoice date to set. Must be in the past, if not set, `invoice_date` is
623623
set to the current time in the customer's timezone.
624624
625-
net_terms: Determines the difference between the invoice issue date for subscription
626-
invoices as the date that they are due. A value of '0' here represents that the
627-
invoice is due on issue, whereas a value of 30 represents that the customer has
628-
30 days to pay the invoice.
629-
630625
customer_id: The id of the `Customer` to create this invoice for. One of `customer_id` and
631626
`external_customer_id` are required.
632627
@@ -641,6 +636,11 @@ async def create(
641636
by setting the value to `null`, and the entire metadata mapping can be cleared
642637
by setting `metadata` to `null`.
643638
639+
net_terms: Determines the difference between the invoice issue date for subscription
640+
invoices as the date that they are due. A value of '0' here represents that the
641+
invoice is due on issue, whereas a value of 30 represents that the customer has
642+
30 days to pay the invoice.
643+
644644
will_auto_issue: When true, this invoice will be submitted for issuance upon creation. When
645645
false, the resulting invoice will require manual review to issue. Defaulted to
646646
false.
@@ -662,12 +662,12 @@ async def create(
662662
"currency": currency,
663663
"invoice_date": invoice_date,
664664
"line_items": line_items,
665-
"net_terms": net_terms,
666665
"customer_id": customer_id,
667666
"discount": discount,
668667
"external_customer_id": external_customer_id,
669668
"memo": memo,
670669
"metadata": metadata,
670+
"net_terms": net_terms,
671671
"will_auto_issue": will_auto_issue,
672672
},
673673
invoice_create_params.InvoiceCreateParams,

src/orb/types/invoice_create_params.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ class InvoiceCreateParams(TypedDict, total=False):
2929

3030
line_items: Required[Iterable[LineItem]]
3131

32-
net_terms: Required[int]
33-
"""
34-
Determines the difference between the invoice issue date for subscription
35-
invoices as the date that they are due. A value of '0' here represents that the
36-
invoice is due on issue, whereas a value of 30 represents that the customer has
37-
30 days to pay the invoice.
38-
"""
39-
4032
customer_id: Optional[str]
4133
"""The id of the `Customer` to create this invoice for.
4234
@@ -62,6 +54,14 @@ class InvoiceCreateParams(TypedDict, total=False):
6254
metadata mapping can be cleared by setting `metadata` to `null`.
6355
"""
6456

57+
net_terms: Optional[int]
58+
"""
59+
Determines the difference between the invoice issue date for subscription
60+
invoices as the date that they are due. A value of '0' here represents that the
61+
invoice is due on issue, whereas a value of 30 represents that the customer has
62+
30 days to pay the invoice.
63+
"""
64+
6565
will_auto_issue: bool
6666
"""When true, this invoice will be submitted for issuance upon creation.
6767

tests/api_resources/test_invoices.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def test_method_create(self, client: Orb) -> None:
3838
"unit_config": {"unit_amount": "unit_amount"},
3939
}
4040
],
41-
net_terms=0,
4241
)
4342
assert_matches_type(Invoice, invoice, path=["response"])
4443

@@ -58,7 +57,6 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
5857
"unit_config": {"unit_amount": "unit_amount"},
5958
}
6059
],
61-
net_terms=0,
6260
customer_id="4khy3nwzktxv7",
6361
discount={
6462
"discount_type": "percentage",
@@ -76,6 +74,7 @@ def test_method_create_with_all_params(self, client: Orb) -> None:
7674
external_customer_id="external-customer-id",
7775
memo="An optional memo for my invoice.",
7876
metadata={"foo": "string"},
77+
net_terms=0,
7978
will_auto_issue=False,
8079
)
8180
assert_matches_type(Invoice, invoice, path=["response"])
@@ -96,7 +95,6 @@ def test_raw_response_create(self, client: Orb) -> None:
9695
"unit_config": {"unit_amount": "unit_amount"},
9796
}
9897
],
99-
net_terms=0,
10098
)
10199

102100
assert response.is_closed is True
@@ -120,7 +118,6 @@ def test_streaming_response_create(self, client: Orb) -> None:
120118
"unit_config": {"unit_amount": "unit_amount"},
121119
}
122120
],
123-
net_terms=0,
124121
) as response:
125122
assert not response.is_closed
126123
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -491,7 +488,6 @@ async def test_method_create(self, async_client: AsyncOrb) -> None:
491488
"unit_config": {"unit_amount": "unit_amount"},
492489
}
493490
],
494-
net_terms=0,
495491
)
496492
assert_matches_type(Invoice, invoice, path=["response"])
497493

@@ -511,7 +507,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
511507
"unit_config": {"unit_amount": "unit_amount"},
512508
}
513509
],
514-
net_terms=0,
515510
customer_id="4khy3nwzktxv7",
516511
discount={
517512
"discount_type": "percentage",
@@ -529,6 +524,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOrb) -> No
529524
external_customer_id="external-customer-id",
530525
memo="An optional memo for my invoice.",
531526
metadata={"foo": "string"},
527+
net_terms=0,
532528
will_auto_issue=False,
533529
)
534530
assert_matches_type(Invoice, invoice, path=["response"])
@@ -549,7 +545,6 @@ async def test_raw_response_create(self, async_client: AsyncOrb) -> None:
549545
"unit_config": {"unit_amount": "unit_amount"},
550546
}
551547
],
552-
net_terms=0,
553548
)
554549

555550
assert response.is_closed is True
@@ -573,7 +568,6 @@ async def test_streaming_response_create(self, async_client: AsyncOrb) -> None:
573568
"unit_config": {"unit_amount": "unit_amount"},
574569
}
575570
],
576-
net_terms=0,
577571
) as response:
578572
assert not response.is_closed
579573
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

0 commit comments

Comments
 (0)