Skip to content

Commit b260565

Browse files
feat(api): api update
1 parent b4c6410 commit b260565

File tree

8 files changed

+44
-45
lines changed

8 files changed

+44
-45
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

lib/orb/models/invoice_create_params.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ class InvoiceCreateParams < Orb::Internal::Type::BaseModel
2626
# @return [Array<Orb::Models::InvoiceCreateParams::LineItem>]
2727
required :line_items, -> { Orb::Internal::Type::ArrayOf[Orb::InvoiceCreateParams::LineItem] }
2828

29-
# @!attribute net_terms
30-
# Determines the difference between the invoice issue date for subscription
31-
# invoices as the date that they are due. A value of '0' here represents that the
32-
# invoice is due on issue, whereas a value of 30 represents that the customer has
33-
# 30 days to pay the invoice.
34-
#
35-
# @return [Integer]
36-
required :net_terms, Integer
37-
3829
# @!attribute customer_id
3930
# The id of the `Customer` to create this invoice for. One of `customer_id` and
4031
# `external_customer_id` are required.
@@ -69,6 +60,15 @@ class InvoiceCreateParams < Orb::Internal::Type::BaseModel
6960
# @return [Hash{Symbol=>String, nil}, nil]
7061
optional :metadata, Orb::Internal::Type::HashOf[String, nil?: true], nil?: true
7162

63+
# @!attribute net_terms
64+
# Determines the difference between the invoice issue date for subscription
65+
# invoices as the date that they are due. A value of '0' here represents that the
66+
# invoice is due on issue, whereas a value of 30 represents that the customer has
67+
# 30 days to pay the invoice.
68+
#
69+
# @return [Integer, nil]
70+
optional :net_terms, Integer, nil?: true
71+
7272
# @!attribute will_auto_issue
7373
# When true, this invoice will be submitted for issuance upon creation. When
7474
# false, the resulting invoice will require manual review to issue. Defaulted to
@@ -77,7 +77,7 @@ class InvoiceCreateParams < Orb::Internal::Type::BaseModel
7777
# @return [Boolean, nil]
7878
optional :will_auto_issue, Orb::Internal::Type::Boolean
7979

80-
# @!method initialize(currency:, invoice_date:, line_items:, net_terms:, customer_id: nil, discount: nil, external_customer_id: nil, memo: nil, metadata: nil, will_auto_issue: nil, request_options: {})
80+
# @!method initialize(currency:, invoice_date:, line_items:, customer_id: nil, discount: nil, external_customer_id: nil, memo: nil, metadata: nil, net_terms: nil, will_auto_issue: nil, request_options: {})
8181
# Some parameter documentations has been truncated, see
8282
# {Orb::Models::InvoiceCreateParams} for more details.
8383
#
@@ -87,8 +87,6 @@ class InvoiceCreateParams < Orb::Internal::Type::BaseModel
8787
#
8888
# @param line_items [Array<Orb::Models::InvoiceCreateParams::LineItem>]
8989
#
90-
# @param net_terms [Integer] Determines the difference between the invoice issue date for subscription invoic
91-
#
9290
# @param customer_id [String, nil] The id of the `Customer` to create this invoice for. One of `customer_id` and `e
9391
#
9492
# @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] An optional discount to attach to the invoice.
@@ -99,6 +97,8 @@ class InvoiceCreateParams < Orb::Internal::Type::BaseModel
9997
#
10098
# @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
10199
#
100+
# @param net_terms [Integer, nil] Determines the difference between the invoice issue date for subscription invoic
101+
#
102102
# @param will_auto_issue [Boolean] When true, this invoice will be submitted for issuance upon creation. When false
103103
#
104104
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]

lib/orb/resources/invoices.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@ class Invoices
88
#
99
# This endpoint is used to create a one-off invoice for a customer.
1010
#
11-
# @overload create(currency:, invoice_date:, line_items:, net_terms:, customer_id: nil, discount: nil, external_customer_id: nil, memo: nil, metadata: nil, will_auto_issue: nil, request_options: {})
11+
# @overload create(currency:, invoice_date:, line_items:, customer_id: nil, discount: nil, external_customer_id: nil, memo: nil, metadata: nil, net_terms: nil, will_auto_issue: nil, request_options: {})
1212
#
1313
# @param currency [String] An ISO 4217 currency string. Must be the same as the customer's currency if it i
1414
#
1515
# @param invoice_date [Time] Optional invoice date to set. Must be in the past, if not set, `invoice_date` is
1616
#
1717
# @param line_items [Array<Orb::Models::InvoiceCreateParams::LineItem>]
1818
#
19-
# @param net_terms [Integer] Determines the difference between the invoice issue date for subscription invoic
20-
#
2119
# @param customer_id [String, nil] The id of the `Customer` to create this invoice for. One of `customer_id` and `e
2220
#
2321
# @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] An optional discount to attach to the invoice.
@@ -28,6 +26,8 @@ class Invoices
2826
#
2927
# @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
3028
#
29+
# @param net_terms [Integer, nil] Determines the difference between the invoice issue date for subscription invoic
30+
#
3131
# @param will_auto_issue [Boolean] When true, this invoice will be submitted for issuance upon creation. When false
3232
#
3333
# @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}, nil]

rbi/orb/models/invoice_create_params.rbi

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ module Orb
2222
sig { returns(T::Array[Orb::InvoiceCreateParams::LineItem]) }
2323
attr_accessor :line_items
2424

25-
# Determines the difference between the invoice issue date for subscription
26-
# invoices as the date that they are due. A value of '0' here represents that the
27-
# invoice is due on issue, whereas a value of 30 represents that the customer has
28-
# 30 days to pay the invoice.
29-
sig { returns(Integer) }
30-
attr_accessor :net_terms
31-
3225
# The id of the `Customer` to create this invoice for. One of `customer_id` and
3326
# `external_customer_id` are required.
3427
sig { returns(T.nilable(String)) }
@@ -64,6 +57,13 @@ module Orb
6457
sig { returns(T.nilable(T::Hash[Symbol, T.nilable(String)])) }
6558
attr_accessor :metadata
6659

60+
# Determines the difference between the invoice issue date for subscription
61+
# invoices as the date that they are due. A value of '0' here represents that the
62+
# invoice is due on issue, whereas a value of 30 represents that the customer has
63+
# 30 days to pay the invoice.
64+
sig { returns(T.nilable(Integer)) }
65+
attr_accessor :net_terms
66+
6767
# When true, this invoice will be submitted for issuance upon creation. When
6868
# false, the resulting invoice will require manual review to issue. Defaulted to
6969
# false.
@@ -78,7 +78,6 @@ module Orb
7878
currency: String,
7979
invoice_date: Time,
8080
line_items: T::Array[Orb::InvoiceCreateParams::LineItem::OrHash],
81-
net_terms: Integer,
8281
customer_id: T.nilable(String),
8382
discount:
8483
T.nilable(
@@ -92,6 +91,7 @@ module Orb
9291
external_customer_id: T.nilable(String),
9392
memo: T.nilable(String),
9493
metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
94+
net_terms: T.nilable(Integer),
9595
will_auto_issue: T::Boolean,
9696
request_options: Orb::RequestOptions::OrHash
9797
).returns(T.attached_class)
@@ -104,11 +104,6 @@ module Orb
104104
# set to the current time in the customer's timezone.
105105
invoice_date:,
106106
line_items:,
107-
# Determines the difference between the invoice issue date for subscription
108-
# invoices as the date that they are due. A value of '0' here represents that the
109-
# invoice is due on issue, whereas a value of 30 represents that the customer has
110-
# 30 days to pay the invoice.
111-
net_terms:,
112107
# The id of the `Customer` to create this invoice for. One of `customer_id` and
113108
# `external_customer_id` are required.
114109
customer_id: nil,
@@ -123,6 +118,11 @@ module Orb
123118
# by setting the value to `null`, and the entire metadata mapping can be cleared
124119
# by setting `metadata` to `null`.
125120
metadata: nil,
121+
# Determines the difference between the invoice issue date for subscription
122+
# invoices as the date that they are due. A value of '0' here represents that the
123+
# invoice is due on issue, whereas a value of 30 represents that the customer has
124+
# 30 days to pay the invoice.
125+
net_terms: nil,
126126
# When true, this invoice will be submitted for issuance upon creation. When
127127
# false, the resulting invoice will require manual review to issue. Defaulted to
128128
# false.
@@ -137,7 +137,6 @@ module Orb
137137
currency: String,
138138
invoice_date: Time,
139139
line_items: T::Array[Orb::InvoiceCreateParams::LineItem],
140-
net_terms: Integer,
141140
customer_id: T.nilable(String),
142141
discount:
143142
T.nilable(
@@ -151,6 +150,7 @@ module Orb
151150
external_customer_id: T.nilable(String),
152151
memo: T.nilable(String),
153152
metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
153+
net_terms: T.nilable(Integer),
154154
will_auto_issue: T::Boolean,
155155
request_options: Orb::RequestOptions
156156
}

rbi/orb/resources/invoices.rbi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ module Orb
99
currency: String,
1010
invoice_date: Time,
1111
line_items: T::Array[Orb::InvoiceCreateParams::LineItem::OrHash],
12-
net_terms: Integer,
1312
customer_id: T.nilable(String),
1413
discount:
1514
T.nilable(
@@ -23,6 +22,7 @@ module Orb
2322
external_customer_id: T.nilable(String),
2423
memo: T.nilable(String),
2524
metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
25+
net_terms: T.nilable(Integer),
2626
will_auto_issue: T::Boolean,
2727
request_options: Orb::RequestOptions::OrHash
2828
).returns(Orb::Invoice)
@@ -35,11 +35,6 @@ module Orb
3535
# set to the current time in the customer's timezone.
3636
invoice_date:,
3737
line_items:,
38-
# Determines the difference between the invoice issue date for subscription
39-
# invoices as the date that they are due. A value of '0' here represents that the
40-
# invoice is due on issue, whereas a value of 30 represents that the customer has
41-
# 30 days to pay the invoice.
42-
net_terms:,
4338
# The id of the `Customer` to create this invoice for. One of `customer_id` and
4439
# `external_customer_id` are required.
4540
customer_id: nil,
@@ -54,6 +49,11 @@ module Orb
5449
# by setting the value to `null`, and the entire metadata mapping can be cleared
5550
# by setting `metadata` to `null`.
5651
metadata: nil,
52+
# Determines the difference between the invoice issue date for subscription
53+
# invoices as the date that they are due. A value of '0' here represents that the
54+
# invoice is due on issue, whereas a value of 30 represents that the customer has
55+
# 30 days to pay the invoice.
56+
net_terms: nil,
5757
# When true, this invoice will be submitted for issuance upon creation. When
5858
# false, the resulting invoice will require manual review to issue. Defaulted to
5959
# false.

sig/orb/models/invoice_create_params.rbs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ module Orb
55
currency: String,
66
invoice_date: Time,
77
line_items: ::Array[Orb::InvoiceCreateParams::LineItem],
8-
net_terms: Integer,
98
customer_id: String?,
109
discount: Orb::Models::discount?,
1110
external_customer_id: String?,
1211
memo: String?,
1312
metadata: ::Hash[Symbol, String?]?,
13+
net_terms: Integer?,
1414
will_auto_issue: bool
1515
}
1616
& Orb::Internal::Type::request_parameters
@@ -25,8 +25,6 @@ module Orb
2525

2626
attr_accessor line_items: ::Array[Orb::InvoiceCreateParams::LineItem]
2727

28-
attr_accessor net_terms: Integer
29-
3028
attr_accessor customer_id: String?
3129

3230
attr_accessor discount: Orb::Models::discount?
@@ -37,6 +35,8 @@ module Orb
3735

3836
attr_accessor metadata: ::Hash[Symbol, String?]?
3937

38+
attr_accessor net_terms: Integer?
39+
4040
attr_reader will_auto_issue: bool?
4141

4242
def will_auto_issue=: (bool) -> bool
@@ -45,12 +45,12 @@ module Orb
4545
currency: String,
4646
invoice_date: Time,
4747
line_items: ::Array[Orb::InvoiceCreateParams::LineItem],
48-
net_terms: Integer,
4948
?customer_id: String?,
5049
?discount: Orb::Models::discount?,
5150
?external_customer_id: String?,
5251
?memo: String?,
5352
?metadata: ::Hash[Symbol, String?]?,
53+
?net_terms: Integer?,
5454
?will_auto_issue: bool,
5555
?request_options: Orb::request_opts
5656
) -> void
@@ -59,12 +59,12 @@ module Orb
5959
currency: String,
6060
invoice_date: Time,
6161
line_items: ::Array[Orb::InvoiceCreateParams::LineItem],
62-
net_terms: Integer,
6362
customer_id: String?,
6463
discount: Orb::Models::discount?,
6564
external_customer_id: String?,
6665
memo: String?,
6766
metadata: ::Hash[Symbol, String?]?,
67+
net_terms: Integer?,
6868
will_auto_issue: bool,
6969
request_options: Orb::RequestOptions
7070
}

sig/orb/resources/invoices.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ module Orb
55
currency: String,
66
invoice_date: Time,
77
line_items: ::Array[Orb::InvoiceCreateParams::LineItem],
8-
net_terms: Integer,
98
?customer_id: String?,
109
?discount: Orb::Models::discount?,
1110
?external_customer_id: String?,
1211
?memo: String?,
1312
?metadata: ::Hash[Symbol, String?]?,
13+
?net_terms: Integer?,
1414
?will_auto_issue: bool,
1515
?request_options: Orb::request_opts
1616
) -> Orb::Invoice

test/orb/resources/invoices_test.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ def test_create_required_params
1818
start_date: "2023-09-22",
1919
unit_config: {unit_amount: "unit_amount"}
2020
}
21-
],
22-
net_terms: 0
21+
]
2322
)
2423

2524
assert_pattern do

0 commit comments

Comments
 (0)