spaire 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/open_api_sdk/client_invoices.rb +160 -0
- data/lib/open_api_sdk/models/components/clientinvoicecreate.rb +20 -0
- data/lib/open_api_sdk/models/components/clientinvoicecreate.rbi +12 -0
- data/lib/open_api_sdk/models/components/clientinvoicelineitempreview.rb +54 -0
- data/lib/open_api_sdk/models/components/clientinvoicelineitempreview.rbi +26 -0
- data/lib/open_api_sdk/models/components/clientinvoicepreviewrequest.rb +247 -0
- data/lib/open_api_sdk/models/components/clientinvoicepreviewrequest.rbi +134 -0
- data/lib/open_api_sdk/models/components/clientinvoiceschema.rb +20 -0
- data/lib/open_api_sdk/models/components/clientinvoiceschema.rbi +12 -0
- data/lib/open_api_sdk/models/components/producttaxpreviewrequest.rb +76 -0
- data/lib/open_api_sdk/models/components/producttaxpreviewrequest.rbi +38 -0
- data/lib/open_api_sdk/models/components/producttaxpreviewresponse.rb +93 -0
- data/lib/open_api_sdk/models/components/producttaxpreviewresponse.rbi +50 -0
- data/lib/open_api_sdk/models/components/subscriptioncancel.rb +2 -1
- data/lib/open_api_sdk/models/components/subscriptionrevoke.rb +2 -1
- data/lib/open_api_sdk/models/components/taxratepreview.rb +42 -0
- data/lib/open_api_sdk/models/components/taxratepreview.rbi +20 -0
- data/lib/open_api_sdk/models/components.rb +5 -0
- data/lib/open_api_sdk/models/operations/client_invoices_preview_client_invoice_pdf_response.rb +39 -0
- data/lib/open_api_sdk/models/operations/client_invoices_preview_client_invoice_pdf_response.rbi +26 -0
- data/lib/open_api_sdk/models/operations/products_products_preview_tax_response.rb +51 -0
- data/lib/open_api_sdk/models/operations/products_products_preview_tax_response.rbi +32 -0
- data/lib/open_api_sdk/models/operations.rb +8 -0
- data/lib/open_api_sdk/products.rb +7 -0
- data/lib/open_api_sdk/sdkconfiguration.rb +9 -7
- data/lib/open_api_sdk/spaire_products.rb +217 -0
- data/lib/spaire.rb +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dfb7bc9275e2f87415c4d037d026608581ebbe666b6aa52ad84a3034660506d2
|
|
4
|
+
data.tar.gz: 59a38466c9ce48e4455883641b7a92ce92ed42a3b7dfa36bf2f9885631bff7ad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9f2e3891d94cc38bdbd3b301636e1fef705f53c1cdf2d059a750f79809d2cc7958aa61c81ea1f5f0a79d9b0ae0f24165cf8eed9d481be9b051474cc4caf9f811
|
|
7
|
+
data.tar.gz: e30e2dd4a6308f8bdf2b5db17aa5d8a2f4bba2ce7eadcf3398cace027b50fa03da41ca180b78a3e93e1f30c237b88ff2f5e293252da9c6b5fdbdb40573a656c3
|
|
@@ -424,6 +424,166 @@ module OpenApiSDK
|
|
|
424
424
|
end
|
|
425
425
|
end
|
|
426
426
|
|
|
427
|
+
sig {
|
|
428
|
+
params(
|
|
429
|
+
request: Models::Components::ClientInvoicePreviewRequest,
|
|
430
|
+
timeout_ms: T.nilable(Integer),
|
|
431
|
+
http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])
|
|
432
|
+
)
|
|
433
|
+
.returns(Models::Operations::ClientInvoicesPreviewClientInvoicePdfResponse)
|
|
434
|
+
}
|
|
435
|
+
def preview_client_invoice_pdf(request:, timeout_ms: nil, http_headers: nil)
|
|
436
|
+
# preview_client_invoice_pdf - Preview Client Invoice PDF
|
|
437
|
+
# Generate a real PDF preview from form data without creating anything.
|
|
438
|
+
#
|
|
439
|
+
# **Scopes**: `client_invoices:read`
|
|
440
|
+
url, params = @sdk_configuration.get_server_details
|
|
441
|
+
base_url = Utils.template_url(url, params)
|
|
442
|
+
url = "#{base_url}/v1/client-invoices/preview-pdf"
|
|
443
|
+
headers = {}
|
|
444
|
+
headers = T.cast(headers, T::Hash[String, String])
|
|
445
|
+
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :request, :json)
|
|
446
|
+
headers["content-type"] = req_content_type
|
|
447
|
+
raise StandardError, "request body is required" if data.nil? && form.nil?
|
|
448
|
+
|
|
449
|
+
if form && !form.empty?
|
|
450
|
+
body = Utils.encode_form(form)
|
|
451
|
+
elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded")
|
|
452
|
+
body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object]))
|
|
453
|
+
else
|
|
454
|
+
body = data
|
|
455
|
+
end
|
|
456
|
+
|
|
457
|
+
headers["Accept"] = "application/json"
|
|
458
|
+
headers["user-agent"] = @sdk_configuration.user_agent
|
|
459
|
+
|
|
460
|
+
security = @sdk_configuration.security_source&.call
|
|
461
|
+
|
|
462
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
|
463
|
+
timeout ||= @sdk_configuration.timeout
|
|
464
|
+
|
|
465
|
+
connection = @sdk_configuration.client
|
|
466
|
+
|
|
467
|
+
hook_ctx = SDKHooks::HookContext.new(
|
|
468
|
+
config: @sdk_configuration,
|
|
469
|
+
base_url: base_url,
|
|
470
|
+
oauth2_scopes: nil,
|
|
471
|
+
operation_id: "client_invoices:preview_client_invoice_pdf",
|
|
472
|
+
security_source: @sdk_configuration.security_source
|
|
473
|
+
)
|
|
474
|
+
|
|
475
|
+
error = T.let(nil, T.nilable(StandardError))
|
|
476
|
+
http_response = T.let(nil, T.nilable(Faraday::Response))
|
|
477
|
+
|
|
478
|
+
begin
|
|
479
|
+
http_response = T.must(connection).post(url) do |req|
|
|
480
|
+
req.body = body
|
|
481
|
+
req.headers.merge!(headers)
|
|
482
|
+
req.options.timeout = timeout unless timeout.nil?
|
|
483
|
+
Utils.configure_request_security(req, security)
|
|
484
|
+
http_headers&.each do |key, value|
|
|
485
|
+
req.headers[key.to_s] = value
|
|
486
|
+
end
|
|
487
|
+
|
|
488
|
+
@sdk_configuration.hooks.before_request(
|
|
489
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
|
490
|
+
hook_ctx: hook_ctx
|
|
491
|
+
),
|
|
492
|
+
request: req
|
|
493
|
+
)
|
|
494
|
+
end
|
|
495
|
+
|
|
496
|
+
rescue StandardError => e
|
|
497
|
+
error = e
|
|
498
|
+
ensure
|
|
499
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
|
500
|
+
http_response = @sdk_configuration.hooks.after_error(
|
|
501
|
+
error: error,
|
|
502
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
|
503
|
+
hook_ctx: hook_ctx
|
|
504
|
+
),
|
|
505
|
+
response: http_response
|
|
506
|
+
)
|
|
507
|
+
else
|
|
508
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
509
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
510
|
+
hook_ctx: hook_ctx
|
|
511
|
+
),
|
|
512
|
+
response: http_response
|
|
513
|
+
)
|
|
514
|
+
end
|
|
515
|
+
|
|
516
|
+
if http_response.nil?
|
|
517
|
+
raise error if !error.nil?
|
|
518
|
+
raise "no response"
|
|
519
|
+
end
|
|
520
|
+
end
|
|
521
|
+
|
|
522
|
+
content_type = http_response.headers.fetch("Content-Type", "application/octet-stream")
|
|
523
|
+
if Utils.match_status_code(http_response.status, ["200"])
|
|
524
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
525
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
526
|
+
hook_ctx: hook_ctx
|
|
527
|
+
),
|
|
528
|
+
response: http_response
|
|
529
|
+
)
|
|
530
|
+
return Models::Operations::ClientInvoicesPreviewClientInvoicePdfResponse.new(
|
|
531
|
+
status_code: http_response.status,
|
|
532
|
+
content_type: content_type,
|
|
533
|
+
raw_response: http_response
|
|
534
|
+
)
|
|
535
|
+
elsif Utils.match_status_code(http_response.status, ["422"])
|
|
536
|
+
if Utils.match_content_type(content_type, "application/json")
|
|
537
|
+
http_response = @sdk_configuration.hooks.after_success(
|
|
538
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
|
539
|
+
hook_ctx: hook_ctx
|
|
540
|
+
),
|
|
541
|
+
response: http_response
|
|
542
|
+
)
|
|
543
|
+
response_data = http_response.env.response_body
|
|
544
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::HTTPValidationError)
|
|
545
|
+
raise obj
|
|
546
|
+
else
|
|
547
|
+
raise(
|
|
548
|
+
::OpenApiSDK::Models::Errors::APIError.new(
|
|
549
|
+
status_code: http_response.status,
|
|
550
|
+
body: http_response.env.response_body,
|
|
551
|
+
raw_response: http_response
|
|
552
|
+
),
|
|
553
|
+
"Unknown content type received"
|
|
554
|
+
)
|
|
555
|
+
end
|
|
556
|
+
elsif Utils.match_status_code(http_response.status, ["4XX"])
|
|
557
|
+
raise(
|
|
558
|
+
::OpenApiSDK::Models::Errors::APIError.new(
|
|
559
|
+
status_code: http_response.status,
|
|
560
|
+
body: http_response.env.response_body,
|
|
561
|
+
raw_response: http_response
|
|
562
|
+
),
|
|
563
|
+
"API error occurred"
|
|
564
|
+
)
|
|
565
|
+
elsif Utils.match_status_code(http_response.status, ["5XX"])
|
|
566
|
+
raise(
|
|
567
|
+
::OpenApiSDK::Models::Errors::APIError.new(
|
|
568
|
+
status_code: http_response.status,
|
|
569
|
+
body: http_response.env.response_body,
|
|
570
|
+
raw_response: http_response
|
|
571
|
+
),
|
|
572
|
+
"API error occurred"
|
|
573
|
+
)
|
|
574
|
+
else
|
|
575
|
+
raise(
|
|
576
|
+
::OpenApiSDK::Models::Errors::APIError.new(
|
|
577
|
+
status_code: http_response.status,
|
|
578
|
+
body: http_response.env.response_body,
|
|
579
|
+
raw_response: http_response
|
|
580
|
+
),
|
|
581
|
+
"Unknown status code received"
|
|
582
|
+
)
|
|
583
|
+
|
|
584
|
+
end
|
|
585
|
+
end
|
|
586
|
+
|
|
427
587
|
sig {
|
|
428
588
|
params(
|
|
429
589
|
id: ::String,
|
|
@@ -76,6 +76,18 @@ module OpenApiSDK
|
|
|
76
76
|
Crystalline::Nilable.new(Crystalline::Boolean.new),
|
|
77
77
|
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("include_payment_link")}}
|
|
78
78
|
)
|
|
79
|
+
# Whether to show the organization logo on the PDF.
|
|
80
|
+
field(
|
|
81
|
+
:show_logo,
|
|
82
|
+
Crystalline::Nilable.new(Crystalline::Boolean.new),
|
|
83
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("show_logo")}}
|
|
84
|
+
)
|
|
85
|
+
# Whether to show 'via spaire' label under the logo.
|
|
86
|
+
field(
|
|
87
|
+
:show_mor_attribution,
|
|
88
|
+
Crystalline::Nilable.new(Crystalline::Boolean.new),
|
|
89
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("show_mor_attribution")}}
|
|
90
|
+
)
|
|
79
91
|
# Arbitrary key-value metadata to attach to the invoice.
|
|
80
92
|
field(
|
|
81
93
|
:user_metadata,
|
|
@@ -95,6 +107,8 @@ module OpenApiSDK
|
|
|
95
107
|
discount_amount: T.nilable(::Integer),
|
|
96
108
|
discount_label: T.nilable(::String),
|
|
97
109
|
include_payment_link: T.nilable(T::Boolean),
|
|
110
|
+
show_logo: T.nilable(T::Boolean),
|
|
111
|
+
show_mor_attribution: T.nilable(T::Boolean),
|
|
98
112
|
user_metadata: T.nilable(T::Hash[Symbol, ::Object])
|
|
99
113
|
)
|
|
100
114
|
.void
|
|
@@ -110,6 +124,8 @@ module OpenApiSDK
|
|
|
110
124
|
discount_amount: 0,
|
|
111
125
|
discount_label: nil,
|
|
112
126
|
include_payment_link: true,
|
|
127
|
+
show_logo: true,
|
|
128
|
+
show_mor_attribution: true,
|
|
113
129
|
user_metadata: nil
|
|
114
130
|
)
|
|
115
131
|
@customer_id = customer_id
|
|
@@ -122,6 +138,8 @@ module OpenApiSDK
|
|
|
122
138
|
@discount_amount = discount_amount
|
|
123
139
|
@discount_label = discount_label
|
|
124
140
|
@include_payment_link = include_payment_link
|
|
141
|
+
@show_logo = show_logo
|
|
142
|
+
@show_mor_attribution = show_mor_attribution
|
|
125
143
|
@user_metadata = user_metadata
|
|
126
144
|
end
|
|
127
145
|
|
|
@@ -138,6 +156,8 @@ module OpenApiSDK
|
|
|
138
156
|
return false unless @discount_amount == other.discount_amount
|
|
139
157
|
return false unless @discount_label == other.discount_label
|
|
140
158
|
return false unless @include_payment_link == other.include_payment_link
|
|
159
|
+
return false unless @show_logo == other.show_logo
|
|
160
|
+
return false unless @show_mor_attribution == other.show_mor_attribution
|
|
141
161
|
return false unless @user_metadata == other.user_metadata
|
|
142
162
|
true
|
|
143
163
|
end
|
|
@@ -66,6 +66,18 @@ class OpenApiSDK::Models::Components::ClientInvoiceCreate
|
|
|
66
66
|
def include_payment_link=(str_)
|
|
67
67
|
end
|
|
68
68
|
|
|
69
|
+
def show_logo
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def show_logo=(str_)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def show_mor_attribution
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def show_mor_attribution=(str_)
|
|
79
|
+
end
|
|
80
|
+
|
|
69
81
|
def user_metadata
|
|
70
82
|
end
|
|
71
83
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
module OpenApiSDK
|
|
7
|
+
module Models
|
|
8
|
+
module Components
|
|
9
|
+
# Relaxed line item for preview — allows zero amounts for in-progress editing.
|
|
10
|
+
class ClientInvoiceLineItemPreview
|
|
11
|
+
extend T::Sig
|
|
12
|
+
include Crystalline::MetadataFields
|
|
13
|
+
|
|
14
|
+
# Line item description.
|
|
15
|
+
field(
|
|
16
|
+
:description,
|
|
17
|
+
Crystalline::Nilable.new(::String),
|
|
18
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("description")}}
|
|
19
|
+
)
|
|
20
|
+
# Quantity.
|
|
21
|
+
field(
|
|
22
|
+
:quantity,
|
|
23
|
+
Crystalline::Nilable.new(::Integer),
|
|
24
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("quantity")}}
|
|
25
|
+
)
|
|
26
|
+
# Unit price in cents (0 allowed for preview).
|
|
27
|
+
field(
|
|
28
|
+
:unit_amount,
|
|
29
|
+
Crystalline::Nilable.new(::Integer),
|
|
30
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("unit_amount")}}
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
sig {
|
|
34
|
+
params(description: T.nilable(::String), quantity: T.nilable(::Integer), unit_amount: T.nilable(::Integer))
|
|
35
|
+
.void
|
|
36
|
+
}
|
|
37
|
+
def initialize(description: "—", quantity: 1, unit_amount: 0)
|
|
38
|
+
@description = description
|
|
39
|
+
@quantity = quantity
|
|
40
|
+
@unit_amount = unit_amount
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
44
|
+
def ==(other)
|
|
45
|
+
return false unless other.is_a?(self.class)
|
|
46
|
+
return false unless @description == other.description
|
|
47
|
+
return false unless @quantity == other.quantity
|
|
48
|
+
return false unless @unit_amount == other.unit_amount
|
|
49
|
+
true
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
class OpenApiSDK::Models::Components::ClientInvoiceLineItemPreview
|
|
5
|
+
extend ::Crystalline::MetadataFields::ClassMethods
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
class OpenApiSDK::Models::Components::ClientInvoiceLineItemPreview
|
|
9
|
+
def description
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def description=(str_)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def quantity
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def quantity=(str_)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def unit_amount
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def unit_amount=(str_)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# typed: true
|
|
4
|
+
# frozen_string_literal: true
|
|
5
|
+
|
|
6
|
+
module OpenApiSDK
|
|
7
|
+
module Models
|
|
8
|
+
module Components
|
|
9
|
+
# Request body for generating a real-time PDF preview without persisting.
|
|
10
|
+
class ClientInvoicePreviewRequest
|
|
11
|
+
extend T::Sig
|
|
12
|
+
include Crystalline::MetadataFields
|
|
13
|
+
|
|
14
|
+
# Organization ID.
|
|
15
|
+
field(
|
|
16
|
+
:organization_id,
|
|
17
|
+
::String,
|
|
18
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("organization_id"), required: true}}
|
|
19
|
+
)
|
|
20
|
+
# ISO 4217 currency code.
|
|
21
|
+
field(
|
|
22
|
+
:currency,
|
|
23
|
+
::String,
|
|
24
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("currency"), required: true}}
|
|
25
|
+
)
|
|
26
|
+
# Invoice line items.
|
|
27
|
+
field(
|
|
28
|
+
:line_items,
|
|
29
|
+
Crystalline::Array.new(Models::Components::ClientInvoiceLineItemPreview),
|
|
30
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("line_items"), required: true}}
|
|
31
|
+
)
|
|
32
|
+
# Optional customer ID to pull name/address from.
|
|
33
|
+
field(
|
|
34
|
+
:customer_id,
|
|
35
|
+
Crystalline::Nilable.new(::String),
|
|
36
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("customer_id")}}
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
field(
|
|
40
|
+
:due_date,
|
|
41
|
+
Crystalline::Nilable.new(::Date),
|
|
42
|
+
{
|
|
43
|
+
'format_json': {
|
|
44
|
+
'letter_case': ::OpenApiSDK::Utils.field_name("due_date"),
|
|
45
|
+
'decoder': ::OpenApiSDK::Utils.date_from_iso_format(true)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
field(
|
|
51
|
+
:memo,
|
|
52
|
+
Crystalline::Nilable.new(::String),
|
|
53
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("memo")}}
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
field(
|
|
57
|
+
:po_number,
|
|
58
|
+
Crystalline::Nilable.new(::String),
|
|
59
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("po_number")}}
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
field(
|
|
63
|
+
:on_behalf_of_label,
|
|
64
|
+
Crystalline::Nilable.new(::String),
|
|
65
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("on_behalf_of_label")}}
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
field(
|
|
69
|
+
:discount_amount,
|
|
70
|
+
Crystalline::Nilable.new(::Integer),
|
|
71
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("discount_amount")}}
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
field(
|
|
75
|
+
:discount_label,
|
|
76
|
+
Crystalline::Nilable.new(::String),
|
|
77
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("discount_label")}}
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
field(
|
|
81
|
+
:include_payment_link,
|
|
82
|
+
Crystalline::Nilable.new(Crystalline::Boolean.new),
|
|
83
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("include_payment_link")}}
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
field(
|
|
87
|
+
:checkout_link_url,
|
|
88
|
+
Crystalline::Nilable.new(::String),
|
|
89
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("checkout_link_url")}}
|
|
90
|
+
)
|
|
91
|
+
# Whether to show the organization logo on the PDF.
|
|
92
|
+
field(
|
|
93
|
+
:show_logo,
|
|
94
|
+
Crystalline::Nilable.new(Crystalline::Boolean.new),
|
|
95
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("show_logo")}}
|
|
96
|
+
)
|
|
97
|
+
# Whether to show 'via spaire' label under the logo.
|
|
98
|
+
field(
|
|
99
|
+
:show_mor_attribution,
|
|
100
|
+
Crystalline::Nilable.new(Crystalline::Boolean.new),
|
|
101
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("show_mor_attribution")}}
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
field(
|
|
105
|
+
:billing_name,
|
|
106
|
+
Crystalline::Nilable.new(::String),
|
|
107
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("billing_name")}}
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
field(
|
|
111
|
+
:billing_line1,
|
|
112
|
+
Crystalline::Nilable.new(::String),
|
|
113
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("billing_line1")}}
|
|
114
|
+
)
|
|
115
|
+
|
|
116
|
+
field(
|
|
117
|
+
:billing_line2,
|
|
118
|
+
Crystalline::Nilable.new(::String),
|
|
119
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("billing_line2")}}
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
field(
|
|
123
|
+
:billing_city,
|
|
124
|
+
Crystalline::Nilable.new(::String),
|
|
125
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("billing_city")}}
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
field(
|
|
129
|
+
:billing_state,
|
|
130
|
+
Crystalline::Nilable.new(::String),
|
|
131
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("billing_state")}}
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
field(
|
|
135
|
+
:billing_postal_code,
|
|
136
|
+
Crystalline::Nilable.new(::String),
|
|
137
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("billing_postal_code")}}
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
field(
|
|
141
|
+
:billing_country,
|
|
142
|
+
Crystalline::Nilable.new(::String),
|
|
143
|
+
{'format_json': {'letter_case': ::OpenApiSDK::Utils.field_name("billing_country")}}
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
sig {
|
|
147
|
+
params(
|
|
148
|
+
organization_id: ::String,
|
|
149
|
+
currency: ::String,
|
|
150
|
+
line_items: T::Array[Models::Components::ClientInvoiceLineItemPreview],
|
|
151
|
+
customer_id: T.nilable(::String),
|
|
152
|
+
due_date: T.nilable(::Date),
|
|
153
|
+
memo: T.nilable(::String),
|
|
154
|
+
po_number: T.nilable(::String),
|
|
155
|
+
on_behalf_of_label: T.nilable(::String),
|
|
156
|
+
discount_amount: T.nilable(::Integer),
|
|
157
|
+
discount_label: T.nilable(::String),
|
|
158
|
+
include_payment_link: T.nilable(T::Boolean),
|
|
159
|
+
checkout_link_url: T.nilable(::String),
|
|
160
|
+
show_logo: T.nilable(T::Boolean),
|
|
161
|
+
show_mor_attribution: T.nilable(T::Boolean),
|
|
162
|
+
billing_name: T.nilable(::String),
|
|
163
|
+
billing_line1: T.nilable(::String),
|
|
164
|
+
billing_line2: T.nilable(::String),
|
|
165
|
+
billing_city: T.nilable(::String),
|
|
166
|
+
billing_state: T.nilable(::String),
|
|
167
|
+
billing_postal_code: T.nilable(::String),
|
|
168
|
+
billing_country: T.nilable(::String)
|
|
169
|
+
)
|
|
170
|
+
.void
|
|
171
|
+
}
|
|
172
|
+
def initialize(
|
|
173
|
+
organization_id:,
|
|
174
|
+
currency:,
|
|
175
|
+
line_items:,
|
|
176
|
+
customer_id: nil,
|
|
177
|
+
due_date: nil,
|
|
178
|
+
memo: nil,
|
|
179
|
+
po_number: nil,
|
|
180
|
+
on_behalf_of_label: nil,
|
|
181
|
+
discount_amount: 0,
|
|
182
|
+
discount_label: nil,
|
|
183
|
+
include_payment_link: true,
|
|
184
|
+
checkout_link_url: nil,
|
|
185
|
+
show_logo: true,
|
|
186
|
+
show_mor_attribution: true,
|
|
187
|
+
billing_name: nil,
|
|
188
|
+
billing_line1: nil,
|
|
189
|
+
billing_line2: nil,
|
|
190
|
+
billing_city: nil,
|
|
191
|
+
billing_state: nil,
|
|
192
|
+
billing_postal_code: nil,
|
|
193
|
+
billing_country: nil
|
|
194
|
+
)
|
|
195
|
+
@organization_id = organization_id
|
|
196
|
+
@currency = currency
|
|
197
|
+
@line_items = line_items
|
|
198
|
+
@customer_id = customer_id
|
|
199
|
+
@due_date = due_date
|
|
200
|
+
@memo = memo
|
|
201
|
+
@po_number = po_number
|
|
202
|
+
@on_behalf_of_label = on_behalf_of_label
|
|
203
|
+
@discount_amount = discount_amount
|
|
204
|
+
@discount_label = discount_label
|
|
205
|
+
@include_payment_link = include_payment_link
|
|
206
|
+
@checkout_link_url = checkout_link_url
|
|
207
|
+
@show_logo = show_logo
|
|
208
|
+
@show_mor_attribution = show_mor_attribution
|
|
209
|
+
@billing_name = billing_name
|
|
210
|
+
@billing_line1 = billing_line1
|
|
211
|
+
@billing_line2 = billing_line2
|
|
212
|
+
@billing_city = billing_city
|
|
213
|
+
@billing_state = billing_state
|
|
214
|
+
@billing_postal_code = billing_postal_code
|
|
215
|
+
@billing_country = billing_country
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
sig { params(other: T.untyped).returns(T::Boolean) }
|
|
219
|
+
def ==(other)
|
|
220
|
+
return false unless other.is_a?(self.class)
|
|
221
|
+
return false unless @organization_id == other.organization_id
|
|
222
|
+
return false unless @currency == other.currency
|
|
223
|
+
return false unless @line_items == other.line_items
|
|
224
|
+
return false unless @customer_id == other.customer_id
|
|
225
|
+
return false unless @due_date == other.due_date
|
|
226
|
+
return false unless @memo == other.memo
|
|
227
|
+
return false unless @po_number == other.po_number
|
|
228
|
+
return false unless @on_behalf_of_label == other.on_behalf_of_label
|
|
229
|
+
return false unless @discount_amount == other.discount_amount
|
|
230
|
+
return false unless @discount_label == other.discount_label
|
|
231
|
+
return false unless @include_payment_link == other.include_payment_link
|
|
232
|
+
return false unless @checkout_link_url == other.checkout_link_url
|
|
233
|
+
return false unless @show_logo == other.show_logo
|
|
234
|
+
return false unless @show_mor_attribution == other.show_mor_attribution
|
|
235
|
+
return false unless @billing_name == other.billing_name
|
|
236
|
+
return false unless @billing_line1 == other.billing_line1
|
|
237
|
+
return false unless @billing_line2 == other.billing_line2
|
|
238
|
+
return false unless @billing_city == other.billing_city
|
|
239
|
+
return false unless @billing_state == other.billing_state
|
|
240
|
+
return false unless @billing_postal_code == other.billing_postal_code
|
|
241
|
+
return false unless @billing_country == other.billing_country
|
|
242
|
+
true
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
end
|
|
246
|
+
end
|
|
247
|
+
end
|