Skip to content

Commit b11877d

Browse files
feat(api): remove scaling_factor (#205)
feat(api): introduce credits status
1 parent 9b0a07b commit b11877d

22 files changed

Lines changed: 74 additions & 266 deletions

src/orb/resources/invoices.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,9 @@ def mark_paid(
342342
self,
343343
invoice_id: str,
344344
*,
345-
external_id: Optional[str],
346-
notes: Optional[str],
347345
payment_received_date: Union[str, date],
346+
external_id: Optional[str] | NotGiven = NOT_GIVEN,
347+
notes: Optional[str] | NotGiven = NOT_GIVEN,
348348
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
349349
# The extra values given here take precedence over values defined on the client or passed to this method.
350350
extra_headers: Headers | None = None,
@@ -359,12 +359,12 @@ def mark_paid(
359359
only be done to invoices that are in the `issued` status.
360360
361361
Args:
362+
payment_received_date: A date string to specify the date of the payment.
363+
362364
external_id: An optional external ID to associate with the payment.
363365
364366
notes: An optional note to associate with the payment.
365367
366-
payment_received_date: A date string to specify the date of the payment.
367-
368368
extra_headers: Send extra headers
369369
370370
extra_query: Add additional query parameters to the request
@@ -381,9 +381,9 @@ def mark_paid(
381381
f"/invoices/{invoice_id}/mark_paid",
382382
body=maybe_transform(
383383
{
384+
"payment_received_date": payment_received_date,
384385
"external_id": external_id,
385386
"notes": notes,
386-
"payment_received_date": payment_received_date,
387387
},
388388
invoice_mark_paid_params.InvoiceMarkPaidParams,
389389
),
@@ -753,9 +753,9 @@ async def mark_paid(
753753
self,
754754
invoice_id: str,
755755
*,
756-
external_id: Optional[str],
757-
notes: Optional[str],
758756
payment_received_date: Union[str, date],
757+
external_id: Optional[str] | NotGiven = NOT_GIVEN,
758+
notes: Optional[str] | NotGiven = NOT_GIVEN,
759759
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
760760
# The extra values given here take precedence over values defined on the client or passed to this method.
761761
extra_headers: Headers | None = None,
@@ -770,12 +770,12 @@ async def mark_paid(
770770
only be done to invoices that are in the `issued` status.
771771
772772
Args:
773+
payment_received_date: A date string to specify the date of the payment.
774+
773775
external_id: An optional external ID to associate with the payment.
774776
775777
notes: An optional note to associate with the payment.
776778
777-
payment_received_date: A date string to specify the date of the payment.
778-
779779
extra_headers: Send extra headers
780780
781781
extra_query: Add additional query parameters to the request
@@ -792,9 +792,9 @@ async def mark_paid(
792792
f"/invoices/{invoice_id}/mark_paid",
793793
body=await async_maybe_transform(
794794
{
795+
"payment_received_date": payment_received_date,
795796
"external_id": external_id,
796797
"notes": notes,
797-
"payment_received_date": payment_received_date,
798798
},
799799
invoice_mark_paid_params.InvoiceMarkPaidParams,
800800
),

src/orb/types/customers/cost_list_by_external_id_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ class DataPerPriceCost(BaseModel):
224224
}
225225
```
226226
227-
### Fixed fees
227+
## Fixed fees
228228
229229
Fixed fees are prices that are applied independent of usage quantities, and
230230
follow unit pricing. They also have an additional parameter

src/orb/types/customers/cost_list_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ class DataPerPriceCost(BaseModel):
224224
}
225225
```
226226
227-
### Fixed fees
227+
## Fixed fees
228228
229229
Fixed fees are prices that are applied independent of usage quantities, and
230230
follow unit pricing. They also have an additional parameter

src/orb/types/customers/credit_list_by_external_id_response.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from typing import Optional
44
from datetime import datetime
5+
from typing_extensions import Literal
56

67
from ..._models import BaseModel
78

@@ -16,3 +17,5 @@ class CreditListByExternalIDResponse(BaseModel):
1617
expiry_date: Optional[datetime] = None
1718

1819
per_unit_cost_basis: Optional[str] = None
20+
21+
status: Literal["active", "pending_payment"]

src/orb/types/customers/credit_list_response.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from typing import Optional
44
from datetime import datetime
5+
from typing_extensions import Literal
56

67
from ..._models import BaseModel
78

@@ -16,3 +17,5 @@ class CreditListResponse(BaseModel):
1617
expiry_date: Optional[datetime] = None
1718

1819
per_unit_cost_basis: Optional[str] = None
20+
21+
status: Literal["active", "pending_payment"]

src/orb/types/invoice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ class LineItem(BaseModel):
636636
}
637637
```
638638
639-
### Fixed fees
639+
## Fixed fees
640640
641641
Fixed fees are prices that are applied independent of usage quantities, and
642642
follow unit pricing. They also have an additional parameter

src/orb/types/invoice_create_params.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ class LineItemUnitConfig(TypedDict, total=False):
6969
unit_amount: Required[str]
7070
"""Rate per unit of usage"""
7171

72-
scaling_factor: Optional[float]
73-
"""Multiplier to scale rated quantity by"""
74-
7572

7673
class LineItem(TypedDict, total=False):
7774
end_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]]

src/orb/types/invoice_fetch_upcoming_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ class LineItem(BaseModel):
636636
}
637637
```
638638
639-
### Fixed fees
639+
## Fixed fees
640640
641641
Fixed fees are prices that are applied independent of usage quantities, and
642642
follow unit pricing. They also have an additional parameter

src/orb/types/invoice_line_item_create_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ class InvoiceLineItemCreateResponse(BaseModel):
382382
}
383383
```
384384
385-
### Fixed fees
385+
## Fixed fees
386386
387387
Fixed fees are prices that are applied independent of usage quantities, and
388388
follow unit pricing. They also have an additional parameter

src/orb/types/invoice_mark_paid_params.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313

1414
class InvoiceMarkPaidParams(TypedDict, total=False):
15-
external_id: Required[Optional[str]]
15+
payment_received_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]]
16+
"""A date string to specify the date of the payment."""
17+
18+
external_id: Optional[str]
1619
"""An optional external ID to associate with the payment."""
1720

18-
notes: Required[Optional[str]]
21+
notes: Optional[str]
1922
"""An optional note to associate with the payment."""
20-
21-
payment_received_date: Required[Annotated[Union[str, date], PropertyInfo(format="iso8601")]]
22-
"""A date string to specify the date of the payment."""

0 commit comments

Comments
 (0)