Skip to content

Commit c82723f

Browse files
feat(api): api update
1 parent b3fa16d commit c82723f

File tree

7 files changed

+83
-14
lines changed

7 files changed

+83
-14
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

lib/orb/models/invoice_update_params.rb

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ class InvoiceUpdateParams < Orb::Internal::Type::BaseModel
1414
# @return [Date, Time, nil]
1515
optional :due_date, union: -> { Orb::InvoiceUpdateParams::DueDate }, nil?: true
1616

17+
# @!attribute invoice_date
18+
# The date of the invoice. Can only be modified for one-off draft invoices.
19+
#
20+
# @return [Date, Time, nil]
21+
optional :invoice_date, union: -> { Orb::InvoiceUpdateParams::InvoiceDate }, nil?: true
22+
1723
# @!attribute metadata
1824
# User-specified key/value pairs for the resource. Individual keys can be removed
1925
# by setting the value to `null`, and the entire metadata mapping can be cleared
@@ -32,12 +38,14 @@ class InvoiceUpdateParams < Orb::Internal::Type::BaseModel
3238
# @return [Integer, nil]
3339
optional :net_terms, Integer, nil?: true
3440

35-
# @!method initialize(due_date: nil, metadata: nil, net_terms: nil, request_options: {})
41+
# @!method initialize(due_date: nil, invoice_date: nil, metadata: nil, net_terms: nil, request_options: {})
3642
# Some parameter documentations has been truncated, see
3743
# {Orb::Models::InvoiceUpdateParams} for more details.
3844
#
3945
# @param due_date [Date, Time, nil] An optional custom due date for the invoice. If not set, the due date will be ca
4046
#
47+
# @param invoice_date [Date, Time, nil] The date of the invoice. Can only be modified for one-off draft invoices.
48+
#
4149
# @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
4250
#
4351
# @param net_terms [Integer, nil] The net terms determines the due date of the invoice. Due date is calculated bas
@@ -56,6 +64,18 @@ module DueDate
5664
# @!method self.variants
5765
# @return [Array(Date, Time)]
5866
end
67+
68+
# The date of the invoice. Can only be modified for one-off draft invoices.
69+
module InvoiceDate
70+
extend Orb::Internal::Type::Union
71+
72+
variant Date
73+
74+
variant Time
75+
76+
# @!method self.variants
77+
# @return [Array(Date, Time)]
78+
end
5979
end
6080
end
6181
end

lib/orb/resources/invoices.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,22 @@ def create(params)
4545
# Some parameter documentations has been truncated, see
4646
# {Orb::Models::InvoiceUpdateParams} for more details.
4747
#
48-
# This endpoint allows you to update the `metadata`, `net_terms`, and `due_date`
49-
# properties on an invoice. If you pass null for the metadata value, it will clear
50-
# any existing metadata for that invoice.
48+
# This endpoint allows you to update the `metadata`, `net_terms`, `due_date`, and
49+
# `invoice_date` properties on an invoice. If you pass null for the metadata
50+
# value, it will clear any existing metadata for that invoice.
5151
#
52-
# `metadata` can be modified regardless of invoice state. `net_terms` and
53-
# `due_date` can only be modified if the invoice is in a `draft` state.
52+
# `metadata` can be modified regardless of invoice state. `net_terms`, `due_date`,
53+
# and `invoice_date` can only be modified if the invoice is in a `draft` state.
54+
# `invoice_date` can only be modified for non-subscription invoices.
5455
#
55-
# @overload update(invoice_id, due_date: nil, metadata: nil, net_terms: nil, request_options: {})
56+
# @overload update(invoice_id, due_date: nil, invoice_date: nil, metadata: nil, net_terms: nil, request_options: {})
5657
#
5758
# @param invoice_id [String]
5859
#
5960
# @param due_date [Date, Time, nil] An optional custom due date for the invoice. If not set, the due date will be ca
6061
#
62+
# @param invoice_date [Date, Time, nil] The date of the invoice. Can only be modified for one-off draft invoices.
63+
#
6164
# @param metadata [Hash{Symbol=>String, nil}, nil] User-specified key/value pairs for the resource. Individual keys can be removed
6265
#
6366
# @param net_terms [Integer, nil] The net terms determines the due date of the invoice. Due date is calculated bas

rbi/orb/models/invoice_update_params.rbi

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ module Orb
1414
sig { returns(T.nilable(Orb::InvoiceUpdateParams::DueDate::Variants)) }
1515
attr_accessor :due_date
1616

17+
# The date of the invoice. Can only be modified for one-off draft invoices.
18+
sig do
19+
returns(T.nilable(Orb::InvoiceUpdateParams::InvoiceDate::Variants))
20+
end
21+
attr_accessor :invoice_date
22+
1723
# User-specified key/value pairs for the resource. Individual keys can be removed
1824
# by setting the value to `null`, and the entire metadata mapping can be cleared
1925
# by setting `metadata` to `null`.
@@ -31,6 +37,8 @@ module Orb
3137
sig do
3238
params(
3339
due_date: T.nilable(Orb::InvoiceUpdateParams::DueDate::Variants),
40+
invoice_date:
41+
T.nilable(Orb::InvoiceUpdateParams::InvoiceDate::Variants),
3442
metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
3543
net_terms: T.nilable(Integer),
3644
request_options: Orb::RequestOptions::OrHash
@@ -40,6 +48,8 @@ module Orb
4048
# An optional custom due date for the invoice. If not set, the due date will be
4149
# calculated based on the `net_terms` value.
4250
due_date: nil,
51+
# The date of the invoice. Can only be modified for one-off draft invoices.
52+
invoice_date: nil,
4353
# User-specified key/value pairs for the resource. Individual keys can be removed
4454
# by setting the value to `null`, and the entire metadata mapping can be cleared
4555
# by setting `metadata` to `null`.
@@ -58,6 +68,8 @@ module Orb
5868
override.returns(
5969
{
6070
due_date: T.nilable(Orb::InvoiceUpdateParams::DueDate::Variants),
71+
invoice_date:
72+
T.nilable(Orb::InvoiceUpdateParams::InvoiceDate::Variants),
6173
metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
6274
net_terms: T.nilable(Integer),
6375
request_options: Orb::RequestOptions
@@ -82,6 +94,21 @@ module Orb
8294
def self.variants
8395
end
8496
end
97+
98+
# The date of the invoice. Can only be modified for one-off draft invoices.
99+
module InvoiceDate
100+
extend Orb::Internal::Type::Union
101+
102+
Variants = T.type_alias { T.any(Date, Time) }
103+
104+
sig do
105+
override.returns(
106+
T::Array[Orb::InvoiceUpdateParams::InvoiceDate::Variants]
107+
)
108+
end
109+
def self.variants
110+
end
111+
end
85112
end
86113
end
87114
end

rbi/orb/resources/invoices.rbi

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,19 @@ module Orb
6868
)
6969
end
7070

71-
# This endpoint allows you to update the `metadata`, `net_terms`, and `due_date`
72-
# properties on an invoice. If you pass null for the metadata value, it will clear
73-
# any existing metadata for that invoice.
71+
# This endpoint allows you to update the `metadata`, `net_terms`, `due_date`, and
72+
# `invoice_date` properties on an invoice. If you pass null for the metadata
73+
# value, it will clear any existing metadata for that invoice.
7474
#
75-
# `metadata` can be modified regardless of invoice state. `net_terms` and
76-
# `due_date` can only be modified if the invoice is in a `draft` state.
75+
# `metadata` can be modified regardless of invoice state. `net_terms`, `due_date`,
76+
# and `invoice_date` can only be modified if the invoice is in a `draft` state.
77+
# `invoice_date` can only be modified for non-subscription invoices.
7778
sig do
7879
params(
7980
invoice_id: String,
8081
due_date: T.nilable(Orb::InvoiceUpdateParams::DueDate::Variants),
82+
invoice_date:
83+
T.nilable(Orb::InvoiceUpdateParams::InvoiceDate::Variants),
8184
metadata: T.nilable(T::Hash[Symbol, T.nilable(String)]),
8285
net_terms: T.nilable(Integer),
8386
request_options: Orb::RequestOptions::OrHash
@@ -88,6 +91,8 @@ module Orb
8891
# An optional custom due date for the invoice. If not set, the due date will be
8992
# calculated based on the `net_terms` value.
9093
due_date: nil,
94+
# The date of the invoice. Can only be modified for one-off draft invoices.
95+
invoice_date: nil,
9196
# User-specified key/value pairs for the resource. Individual keys can be removed
9297
# by setting the value to `null`, and the entire metadata mapping can be cleared
9398
# by setting `metadata` to `null`.

sig/orb/models/invoice_update_params.rbs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module Orb
33
type invoice_update_params =
44
{
55
due_date: Orb::Models::InvoiceUpdateParams::due_date?,
6+
invoice_date: Orb::Models::InvoiceUpdateParams::invoice_date?,
67
metadata: ::Hash[Symbol, String?]?,
78
net_terms: Integer?
89
}
@@ -14,19 +15,23 @@ module Orb
1415

1516
attr_accessor due_date: Orb::Models::InvoiceUpdateParams::due_date?
1617

18+
attr_accessor invoice_date: Orb::Models::InvoiceUpdateParams::invoice_date?
19+
1720
attr_accessor metadata: ::Hash[Symbol, String?]?
1821

1922
attr_accessor net_terms: Integer?
2023

2124
def initialize: (
2225
?due_date: Orb::Models::InvoiceUpdateParams::due_date?,
26+
?invoice_date: Orb::Models::InvoiceUpdateParams::invoice_date?,
2327
?metadata: ::Hash[Symbol, String?]?,
2428
?net_terms: Integer?,
2529
?request_options: Orb::request_opts
2630
) -> void
2731

2832
def to_hash: -> {
2933
due_date: Orb::Models::InvoiceUpdateParams::due_date?,
34+
invoice_date: Orb::Models::InvoiceUpdateParams::invoice_date?,
3035
metadata: ::Hash[Symbol, String?]?,
3136
net_terms: Integer?,
3237
request_options: Orb::RequestOptions
@@ -39,6 +44,14 @@ module Orb
3944

4045
def self?.variants: -> ::Array[Orb::Models::InvoiceUpdateParams::due_date]
4146
end
47+
48+
type invoice_date = Date | Time
49+
50+
module InvoiceDate
51+
extend Orb::Internal::Type::Union
52+
53+
def self?.variants: -> ::Array[Orb::Models::InvoiceUpdateParams::invoice_date]
54+
end
4255
end
4356
end
4457
end

sig/orb/resources/invoices.rbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module Orb
1919
def update: (
2020
String invoice_id,
2121
?due_date: Orb::Models::InvoiceUpdateParams::due_date?,
22+
?invoice_date: Orb::Models::InvoiceUpdateParams::invoice_date?,
2223
?metadata: ::Hash[Symbol, String?]?,
2324
?net_terms: Integer?,
2425
?request_options: Orb::request_opts

0 commit comments

Comments
 (0)