Skip to content

Commit c203926

Browse files
feat(api): api update
1 parent 174bbeb commit c203926

File tree

10 files changed

+88
-16
lines changed

10 files changed

+88
-16
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: 139
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-0186c0310e2a9f40302cc35f4248fca335b7ec8069502f684ba6f2fa37793033.yml
3-
openapi_spec_hash: 4fb1d2837ad3794864a7d59d393d6ff6
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-5bb582f84f0b4cf7bef84833fefd48a5f2734dc25805da2028fd8a6f1198da07.yml
3+
openapi_spec_hash: ced0e30dc67faa2414df511819408f12
44
config_hash: 3279841440b02d4e8303c961d6983492

lib/orb/models/invoice_create_params.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ 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 auto_collection
30+
# Determines whether this invoice will automatically attempt to charge a saved
31+
# payment method, if any. If not specified, the invoice inherits the customer's
32+
# auto_collection setting.
33+
#
34+
# @return [Boolean, nil]
35+
optional :auto_collection, Orb::Internal::Type::Boolean, nil?: true
36+
2937
# @!attribute customer_id
3038
# The id of the `Customer` to create this invoice for. One of `customer_id` and
3139
# `external_customer_id` are required.
@@ -86,7 +94,7 @@ class InvoiceCreateParams < Orb::Internal::Type::BaseModel
8694
# @return [Boolean, nil]
8795
optional :will_auto_issue, Orb::Internal::Type::Boolean
8896

89-
# @!method initialize(currency:, invoice_date:, line_items:, customer_id: nil, discount: nil, due_date: nil, external_customer_id: nil, memo: nil, metadata: nil, net_terms: nil, will_auto_issue: nil, request_options: {})
97+
# @!method initialize(currency:, invoice_date:, line_items:, auto_collection: nil, customer_id: nil, discount: nil, due_date: nil, external_customer_id: nil, memo: nil, metadata: nil, net_terms: nil, will_auto_issue: nil, request_options: {})
9098
# Some parameter documentations has been truncated, see
9199
# {Orb::Models::InvoiceCreateParams} for more details.
92100
#
@@ -96,6 +104,8 @@ class InvoiceCreateParams < Orb::Internal::Type::BaseModel
96104
#
97105
# @param line_items [Array<Orb::Models::InvoiceCreateParams::LineItem>]
98106
#
107+
# @param auto_collection [Boolean, nil] Determines whether this invoice will automatically attempt to charge a saved pay
108+
#
99109
# @param customer_id [String, nil] The id of the `Customer` to create this invoice for. One of `customer_id` and `e
100110
#
101111
# @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] An optional discount to attach to the invoice.

lib/orb/models/invoice_update_params.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ class InvoiceUpdateParams < Orb::Internal::Type::BaseModel
77
extend Orb::Internal::Type::RequestParameters::Converter
88
include Orb::Internal::Type::RequestParameters
99

10+
# @!attribute auto_collection
11+
# Determines whether this invoice will automatically attempt to charge a saved
12+
# payment method, if any. Can only be modified on draft invoices. If not
13+
# specified, the invoice's existing setting is unchanged.
14+
#
15+
# @return [Boolean, nil]
16+
optional :auto_collection, Orb::Internal::Type::Boolean, nil?: true
17+
1018
# @!attribute due_date
1119
# An optional custom due date for the invoice. If not set, the due date will be
1220
# calculated based on the `net_terms` value.
@@ -38,10 +46,12 @@ class InvoiceUpdateParams < Orb::Internal::Type::BaseModel
3846
# @return [Integer, nil]
3947
optional :net_terms, Integer, nil?: true
4048

41-
# @!method initialize(due_date: nil, invoice_date: nil, metadata: nil, net_terms: nil, request_options: {})
49+
# @!method initialize(auto_collection: nil, due_date: nil, invoice_date: nil, metadata: nil, net_terms: nil, request_options: {})
4250
# Some parameter documentations has been truncated, see
4351
# {Orb::Models::InvoiceUpdateParams} for more details.
4452
#
53+
# @param auto_collection [Boolean, nil] Determines whether this invoice will automatically attempt to charge a saved pay
54+
#
4555
# @param due_date [Date, Time, nil] An optional custom due date for the invoice. If not set, the due date will be ca
4656
#
4757
# @param invoice_date [Date, Time, nil] The date of the invoice. Can only be modified for one-off draft invoices.

lib/orb/resources/invoices.rb

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ class Invoices
1313
#
1414
# This endpoint is used to create a one-off invoice for a customer.
1515
#
16-
# @overload create(currency:, invoice_date:, line_items:, customer_id: nil, discount: nil, due_date: nil, external_customer_id: nil, memo: nil, metadata: nil, net_terms: nil, will_auto_issue: nil, request_options: {})
16+
# @overload create(currency:, invoice_date:, line_items:, auto_collection: nil, customer_id: nil, discount: nil, due_date: nil, external_customer_id: nil, memo: nil, metadata: nil, net_terms: nil, will_auto_issue: nil, request_options: {})
1717
#
1818
# @param currency [String] An ISO 4217 currency string. Must be the same as the customer's currency if it i
1919
#
2020
# @param invoice_date [Time] Optional invoice date to set. Must be in the past, if not set, `invoice_date` is
2121
#
2222
# @param line_items [Array<Orb::Models::InvoiceCreateParams::LineItem>]
2323
#
24+
# @param auto_collection [Boolean, nil] Determines whether this invoice will automatically attempt to charge a saved pay
25+
#
2426
# @param customer_id [String, nil] The id of the `Customer` to create this invoice for. One of `customer_id` and `e
2527
#
2628
# @param discount [Orb::Models::PercentageDiscount, Orb::Models::TrialDiscount, Orb::Models::UsageDiscount, Orb::Models::AmountDiscount, nil] An optional discount to attach to the invoice.
@@ -50,18 +52,21 @@ def create(params)
5052
# Some parameter documentations has been truncated, see
5153
# {Orb::Models::InvoiceUpdateParams} for more details.
5254
#
53-
# This endpoint allows you to update the `metadata`, `net_terms`, `due_date`, and
54-
# `invoice_date` properties on an invoice. If you pass null for the metadata
55-
# value, it will clear any existing metadata for that invoice.
55+
# This endpoint allows you to update the `metadata`, `net_terms`, `due_date`,
56+
# `invoice_date`, and `auto_collection` properties on an invoice. If you pass null
57+
# for the metadata value, it will clear any existing metadata for that invoice.
5658
#
5759
# `metadata` can be modified regardless of invoice state. `net_terms`, `due_date`,
58-
# and `invoice_date` can only be modified if the invoice is in a `draft` state.
59-
# `invoice_date` can only be modified for non-subscription invoices.
60+
# `invoice_date`, and `auto_collection` can only be modified if the invoice is in
61+
# a `draft` state. `invoice_date` can only be modified for non-subscription
62+
# invoices.
6063
#
61-
# @overload update(invoice_id, due_date: nil, invoice_date: nil, metadata: nil, net_terms: nil, request_options: {})
64+
# @overload update(invoice_id, auto_collection: nil, due_date: nil, invoice_date: nil, metadata: nil, net_terms: nil, request_options: {})
6265
#
6366
# @param invoice_id [String]
6467
#
68+
# @param auto_collection [Boolean, nil] Determines whether this invoice will automatically attempt to charge a saved pay
69+
#
6570
# @param due_date [Date, Time, nil] An optional custom due date for the invoice. If not set, the due date will be ca
6671
#
6772
# @param invoice_date [Date, Time, nil] The date of the invoice. Can only be modified for one-off draft invoices.

rbi/orb/models/invoice_create_params.rbi

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

25+
# Determines whether this invoice will automatically attempt to charge a saved
26+
# payment method, if any. If not specified, the invoice inherits the customer's
27+
# auto_collection setting.
28+
sig { returns(T.nilable(T::Boolean)) }
29+
attr_accessor :auto_collection
30+
2531
# The id of the `Customer` to create this invoice for. One of `customer_id` and
2632
# `external_customer_id` are required.
2733
sig { returns(T.nilable(String)) }
@@ -85,6 +91,7 @@ module Orb
8591
currency: String,
8692
invoice_date: Time,
8793
line_items: T::Array[Orb::InvoiceCreateParams::LineItem::OrHash],
94+
auto_collection: T.nilable(T::Boolean),
8895
customer_id: T.nilable(String),
8996
discount:
9097
T.nilable(
@@ -112,6 +119,10 @@ module Orb
112119
# set to the current time in the customer's timezone.
113120
invoice_date:,
114121
line_items:,
122+
# Determines whether this invoice will automatically attempt to charge a saved
123+
# payment method, if any. If not specified, the invoice inherits the customer's
124+
# auto_collection setting.
125+
auto_collection: nil,
115126
# The id of the `Customer` to create this invoice for. One of `customer_id` and
116127
# `external_customer_id` are required.
117128
customer_id: nil,
@@ -150,6 +161,7 @@ module Orb
150161
currency: String,
151162
invoice_date: Time,
152163
line_items: T::Array[Orb::InvoiceCreateParams::LineItem],
164+
auto_collection: T.nilable(T::Boolean),
153165
customer_id: T.nilable(String),
154166
discount:
155167
T.nilable(

rbi/orb/models/invoice_update_params.rbi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ module Orb
99
OrHash =
1010
T.type_alias { T.any(Orb::InvoiceUpdateParams, Orb::Internal::AnyHash) }
1111

12+
# Determines whether this invoice will automatically attempt to charge a saved
13+
# payment method, if any. Can only be modified on draft invoices. If not
14+
# specified, the invoice's existing setting is unchanged.
15+
sig { returns(T.nilable(T::Boolean)) }
16+
attr_accessor :auto_collection
17+
1218
# An optional custom due date for the invoice. If not set, the due date will be
1319
# calculated based on the `net_terms` value.
1420
sig { returns(T.nilable(Orb::InvoiceUpdateParams::DueDate::Variants)) }
@@ -36,6 +42,7 @@ module Orb
3642

3743
sig do
3844
params(
45+
auto_collection: T.nilable(T::Boolean),
3946
due_date: T.nilable(Orb::InvoiceUpdateParams::DueDate::Variants),
4047
invoice_date:
4148
T.nilable(Orb::InvoiceUpdateParams::InvoiceDate::Variants),
@@ -45,6 +52,10 @@ module Orb
4552
).returns(T.attached_class)
4653
end
4754
def self.new(
55+
# Determines whether this invoice will automatically attempt to charge a saved
56+
# payment method, if any. Can only be modified on draft invoices. If not
57+
# specified, the invoice's existing setting is unchanged.
58+
auto_collection: nil,
4859
# An optional custom due date for the invoice. If not set, the due date will be
4960
# calculated based on the `net_terms` value.
5061
due_date: nil,
@@ -67,6 +78,7 @@ module Orb
6778
sig do
6879
override.returns(
6980
{
81+
auto_collection: T.nilable(T::Boolean),
7082
due_date: T.nilable(Orb::InvoiceUpdateParams::DueDate::Variants),
7183
invoice_date:
7284
T.nilable(Orb::InvoiceUpdateParams::InvoiceDate::Variants),

rbi/orb/resources/invoices.rbi

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module Orb
1414
currency: String,
1515
invoice_date: Time,
1616
line_items: T::Array[Orb::InvoiceCreateParams::LineItem::OrHash],
17+
auto_collection: T.nilable(T::Boolean),
1718
customer_id: T.nilable(String),
1819
discount:
1920
T.nilable(
@@ -41,6 +42,10 @@ module Orb
4142
# set to the current time in the customer's timezone.
4243
invoice_date:,
4344
line_items:,
45+
# Determines whether this invoice will automatically attempt to charge a saved
46+
# payment method, if any. If not specified, the invoice inherits the customer's
47+
# auto_collection setting.
48+
auto_collection: nil,
4449
# The id of the `Customer` to create this invoice for. One of `customer_id` and
4550
# `external_customer_id` are required.
4651
customer_id: nil,
@@ -73,16 +78,18 @@ module Orb
7378
)
7479
end
7580

76-
# This endpoint allows you to update the `metadata`, `net_terms`, `due_date`, and
77-
# `invoice_date` properties on an invoice. If you pass null for the metadata
78-
# value, it will clear any existing metadata for that invoice.
81+
# This endpoint allows you to update the `metadata`, `net_terms`, `due_date`,
82+
# `invoice_date`, and `auto_collection` properties on an invoice. If you pass null
83+
# for the metadata value, it will clear any existing metadata for that invoice.
7984
#
8085
# `metadata` can be modified regardless of invoice state. `net_terms`, `due_date`,
81-
# and `invoice_date` can only be modified if the invoice is in a `draft` state.
82-
# `invoice_date` can only be modified for non-subscription invoices.
86+
# `invoice_date`, and `auto_collection` can only be modified if the invoice is in
87+
# a `draft` state. `invoice_date` can only be modified for non-subscription
88+
# invoices.
8389
sig do
8490
params(
8591
invoice_id: String,
92+
auto_collection: T.nilable(T::Boolean),
8693
due_date: T.nilable(Orb::InvoiceUpdateParams::DueDate::Variants),
8794
invoice_date:
8895
T.nilable(Orb::InvoiceUpdateParams::InvoiceDate::Variants),
@@ -93,6 +100,10 @@ module Orb
93100
end
94101
def update(
95102
invoice_id,
103+
# Determines whether this invoice will automatically attempt to charge a saved
104+
# payment method, if any. Can only be modified on draft invoices. If not
105+
# specified, the invoice's existing setting is unchanged.
106+
auto_collection: nil,
96107
# An optional custom due date for the invoice. If not set, the due date will be
97108
# calculated based on the `net_terms` value.
98109
due_date: nil,

sig/orb/models/invoice_create_params.rbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module Orb
55
currency: String,
66
invoice_date: Time,
77
line_items: ::Array[Orb::InvoiceCreateParams::LineItem],
8+
auto_collection: bool?,
89
customer_id: String?,
910
discount: Orb::Models::discount?,
1011
due_date: Orb::Models::InvoiceCreateParams::due_date?,
@@ -26,6 +27,8 @@ module Orb
2627

2728
attr_accessor line_items: ::Array[Orb::InvoiceCreateParams::LineItem]
2829

30+
attr_accessor auto_collection: bool?
31+
2932
attr_accessor customer_id: String?
3033

3134
attr_accessor discount: Orb::Models::discount?
@@ -48,6 +51,7 @@ module Orb
4851
currency: String,
4952
invoice_date: Time,
5053
line_items: ::Array[Orb::InvoiceCreateParams::LineItem],
54+
?auto_collection: bool?,
5155
?customer_id: String?,
5256
?discount: Orb::Models::discount?,
5357
?due_date: Orb::Models::InvoiceCreateParams::due_date?,
@@ -63,6 +67,7 @@ module Orb
6367
currency: String,
6468
invoice_date: Time,
6569
line_items: ::Array[Orb::InvoiceCreateParams::LineItem],
70+
auto_collection: bool?,
6671
customer_id: String?,
6772
discount: Orb::Models::discount?,
6873
due_date: Orb::Models::InvoiceCreateParams::due_date?,

sig/orb/models/invoice_update_params.rbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module Orb
22
module Models
33
type invoice_update_params =
44
{
5+
auto_collection: bool?,
56
due_date: Orb::Models::InvoiceUpdateParams::due_date?,
67
invoice_date: Orb::Models::InvoiceUpdateParams::invoice_date?,
78
metadata: ::Hash[Symbol, String?]?,
@@ -13,6 +14,8 @@ module Orb
1314
extend Orb::Internal::Type::RequestParameters::Converter
1415
include Orb::Internal::Type::RequestParameters
1516

17+
attr_accessor auto_collection: bool?
18+
1619
attr_accessor due_date: Orb::Models::InvoiceUpdateParams::due_date?
1720

1821
attr_accessor invoice_date: Orb::Models::InvoiceUpdateParams::invoice_date?
@@ -22,6 +25,7 @@ module Orb
2225
attr_accessor net_terms: Integer?
2326

2427
def initialize: (
28+
?auto_collection: bool?,
2529
?due_date: Orb::Models::InvoiceUpdateParams::due_date?,
2630
?invoice_date: Orb::Models::InvoiceUpdateParams::invoice_date?,
2731
?metadata: ::Hash[Symbol, String?]?,
@@ -30,6 +34,7 @@ module Orb
3034
) -> void
3135

3236
def to_hash: -> {
37+
auto_collection: bool?,
3338
due_date: Orb::Models::InvoiceUpdateParams::due_date?,
3439
invoice_date: Orb::Models::InvoiceUpdateParams::invoice_date?,
3540
metadata: ::Hash[Symbol, String?]?,

sig/orb/resources/invoices.rbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module Orb
55
currency: String,
66
invoice_date: Time,
77
line_items: ::Array[Orb::InvoiceCreateParams::LineItem],
8+
?auto_collection: bool?,
89
?customer_id: String?,
910
?discount: Orb::Models::discount?,
1011
?due_date: Orb::Models::InvoiceCreateParams::due_date?,
@@ -18,6 +19,7 @@ module Orb
1819

1920
def update: (
2021
String invoice_id,
22+
?auto_collection: bool?,
2123
?due_date: Orb::Models::InvoiceUpdateParams::due_date?,
2224
?invoice_date: Orb::Models::InvoiceUpdateParams::invoice_date?,
2325
?metadata: ::Hash[Symbol, String?]?,

0 commit comments

Comments
 (0)