inttegro 7.0.0 → 8.1.0
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/CHANGELOG.md +16 -0
- data/lib/inttegro/checkout/invoice_view.rb +8 -0
- data/lib/inttegro/checkout/order_line_item_group.rb +23 -0
- data/lib/inttegro/chime/chime.rb +3 -2
- data/lib/inttegro/chime/send_request.rb +12 -2
- data/lib/inttegro/chime/send_request_cooldown.rb +35 -0
- data/lib/inttegro/chime/transport.rb +2 -1
- data/lib/inttegro/custom_data.rb +132 -0
- data/lib/inttegro/customer/create_request.rb +3 -2
- data/lib/inttegro/customer/customer.rb +3 -2
- data/lib/inttegro/customer/data.rb +3 -2
- data/lib/inttegro/customer/update_request.rb +3 -2
- data/lib/inttegro/file/file.rb +3 -2
- data/lib/inttegro/file_link/create_request.rb +3 -2
- data/lib/inttegro/file_link/file_link.rb +3 -2
- data/lib/inttegro/financial_account/bank_request.rb +3 -2
- data/lib/inttegro/financial_account/connected.rb +3 -2
- data/lib/inttegro/financial_account/created.rb +3 -2
- data/lib/inttegro/financial_account/details.rb +3 -2
- data/lib/inttegro/financial_account/dosh_request.rb +3 -2
- data/lib/inttegro/financial_account/financial_account.rb +3 -2
- data/lib/inttegro/financial_account/request_base.rb +3 -2
- data/lib/inttegro/financial_account/update_request.rb +3 -2
- data/lib/inttegro/financial_account/updated.rb +3 -2
- data/lib/inttegro/financial_account/wallet_request.rb +3 -2
- data/lib/inttegro/financial_account/wire_page_accounts_item.rb +3 -2
- data/lib/inttegro/generated/enums.rb +17 -1
- data/lib/inttegro/generated/models.rb +36 -0
- data/lib/inttegro/generated/operations.rb +18 -3
- data/lib/inttegro/http_client.rb +1 -1
- data/lib/inttegro/model_serialization.rb +30 -1
- data/lib/inttegro/order/create_existing_customer.rb +26 -2
- data/lib/inttegro/order/create_new_customer.rb +26 -2
- data/lib/inttegro/order/document_delivery_attempt.rb +7 -0
- data/lib/inttegro/order/document_delivery_channel_summary.rb +34 -0
- data/lib/inttegro/order/document_delivery_summary.rb +43 -0
- data/lib/inttegro/order/document_delivery_summary_channels.rb +36 -0
- data/lib/inttegro/order/invoice.rb +8 -0
- data/lib/inttegro/order/invoice_format.rb +3 -2
- data/lib/inttegro/order/line_item_group.rb +25 -0
- data/lib/inttegro/order/order.rb +3 -2
- data/lib/inttegro/order/product_line_item_product.rb +3 -2
- data/lib/inttegro/order/receipt_document_format.rb +35 -0
- data/lib/inttegro/order/update_request.rb +26 -2
- data/lib/inttegro/otp/initiate_request.rb +35 -8
- data/lib/inttegro/otp/purpose.rb +62 -0
- data/lib/inttegro/otp/transmission.rb +4 -4
- data/lib/inttegro/otp/transmission_status.rb +9 -0
- data/lib/inttegro/otp/verify_request.rb +2 -1
- data/lib/inttegro/payment_method/payment_method.rb +14 -2
- data/lib/inttegro/payment_method/tokenize_base.rb +3 -2
- data/lib/inttegro/payment_method/tokenize_mobile_money_request.rb +3 -2
- data/lib/inttegro/payment_method/update_request.rb +3 -2
- data/lib/inttegro/payout/payout.rb +3 -2
- data/lib/inttegro/price/embedded_product.rb +3 -2
- data/lib/inttegro/product/create_request.rb +3 -2
- data/lib/inttegro/product/inline_details.rb +3 -2
- data/lib/inttegro/product/product.rb +3 -2
- data/lib/inttegro/product/update_request.rb +3 -2
- data/lib/inttegro/product/updated.rb +3 -2
- data/lib/inttegro/purchase_intent/product.rb +3 -2
- data/lib/inttegro/refund/create_request.rb +3 -2
- data/lib/inttegro/refund/failure.rb +45 -0
- data/lib/inttegro/refund/failure_reason.rb +49 -0
- data/lib/inttegro/refund/line_item.rb +31 -1
- data/lib/inttegro/refund/offline_settlement.rb +28 -0
- data/lib/inttegro/{otp/transmission_sent_via.rb → refund/offline_settlement_type.rb} +6 -6
- data/lib/inttegro/refund/order_fee_line_item.rb +43 -0
- data/lib/inttegro/refund/order_fee_line_item_fee.rb +34 -0
- data/lib/inttegro/refund/order_fee_line_item_type.rb +25 -0
- data/lib/inttegro/refund/order_line_item.rb +20 -0
- data/lib/inttegro/refund/order_product_line_item.rb +50 -0
- data/lib/inttegro/refund/order_product_line_item_product.rb +34 -0
- data/lib/inttegro/refund/order_product_line_item_type.rb +25 -0
- data/lib/inttegro/refund/order_shipping_line_item.rb +43 -0
- data/lib/inttegro/refund/order_shipping_line_item_shipping.rb +34 -0
- data/lib/inttegro/refund/order_shipping_line_item_type.rb +25 -0
- data/lib/inttegro/refund/payment_method_settlement.rb +55 -0
- data/lib/inttegro/refund/payment_method_settlement_type.rb +24 -0
- data/lib/inttegro/refund/refund.rb +39 -2
- data/lib/inttegro/refund/settlement.rb +19 -0
- data/lib/inttegro/refund/settlement_bank_account_payment_method.rb +44 -0
- data/lib/inttegro/refund/settlement_bank_account_payment_method_bank_account.rb +37 -0
- data/lib/inttegro/refund/settlement_bank_account_payment_method_bank_account_ghana_bank_account.rb +35 -0
- data/lib/inttegro/refund/settlement_bank_account_payment_method_type.rb +25 -0
- data/lib/inttegro/refund/settlement_mobile_money_payment_method.rb +44 -0
- data/lib/inttegro/refund/settlement_mobile_money_payment_method_mobile_money.rb +43 -0
- data/lib/inttegro/refund/settlement_mobile_money_payment_method_type.rb +25 -0
- data/lib/inttegro/refund/settlement_payment_method.rb +19 -0
- data/lib/inttegro/resources/customers.rb +8 -0
- data/lib/inttegro/resources/financial_accounts.rb +12 -0
- data/lib/inttegro/resources/orders.rb +8 -0
- data/lib/inttegro/resources/payouts.rb +8 -0
- data/lib/inttegro/resources/products.rb +8 -0
- data/lib/inttegro/search/base.rb +17 -0
- data/lib/inttegro/search/facet.rb +34 -0
- data/lib/inttegro/search/facet_bucket.rb +34 -0
- data/lib/inttegro/search/facet_result.rb +35 -0
- data/lib/inttegro/search/filter.rb +42 -0
- data/lib/inttegro/search/filter_operator.rb +27 -0
- data/lib/inttegro/search/freshness.rb +43 -0
- data/lib/inttegro/search/freshness_state.rb +36 -0
- data/lib/inttegro/search/page.rb +104 -0
- data/lib/inttegro/search/request.rb +68 -0
- data/lib/inttegro/search/resource_freshness.rb +50 -0
- data/lib/inttegro/search/resource_freshness_state.rb +37 -0
- data/lib/inttegro/search/resource_reference.rb +35 -0
- data/lib/inttegro/search/resource_total.rb +43 -0
- data/lib/inttegro/search/resource_total_relation.rb +28 -0
- data/lib/inttegro/search/response.rb +28 -0
- data/lib/inttegro/search/result.rb +78 -0
- data/lib/inttegro/search/sort.rb +36 -0
- data/lib/inttegro/search/sort_direction.rb +27 -0
- data/lib/inttegro/search/sort_field.rb +30 -0
- data/lib/inttegro/search/total.rb +35 -0
- data/lib/inttegro/search/total_relation.rb +27 -0
- data/lib/inttegro/search/type.rb +36 -0
- data/lib/inttegro/shared/fee_details.rb +3 -2
- data/lib/inttegro/shared/invoice_settings.rb +3 -2
- data/lib/inttegro/shared/shipping_details.rb +3 -2
- data/lib/inttegro/telemetry.rb +1 -1
- data/lib/inttegro/upload_request/create_request.rb +3 -2
- data/lib/inttegro/upload_request/details.rb +3 -2
- data/lib/inttegro/upload_request/upload_request.rb +3 -2
- data/lib/inttegro/version.rb +1 -1
- data/lib/inttegro.rb +1 -0
- data/rbi/inttegro/generated.rbi +15 -0
- metadata +57 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f8bc4f0b5a2c207f948dfa48b29deeccac6c66ee93dbcbc4dd0c9cea2f139fd7
|
|
4
|
+
data.tar.gz: a4ea44719929147719cf297a3c59d0f33862c87650d50247afa752d0afe3b7b7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 36ceb907d2fce5b241b2773f4e77a4efaec24361bec49c27b1b853f1dd43a894db911394be30db76a756fd4ef3348f8dfbdb01000072cabddc95bdfa6542d4db
|
|
7
|
+
data.tar.gz: 1d8e7b18fb1183c87f8dea4f62e5c3256d1413c7d8396cc9a7a699fea6f1a09b4a1cc30d3cf46806c4063bb1b954f56378643951164f9f442120f875d87e12e9
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [8.1.0] - 2026-09-21
|
|
4
|
+
|
|
5
|
+
- Added typed search across customers, financial accounts, orders, payouts, and
|
|
6
|
+
products, including filters, facets, sorting, cursor pagination, totals, and
|
|
7
|
+
freshness metadata.
|
|
8
|
+
- Added typed verification purposes for OTP initiation requests.
|
|
9
|
+
|
|
10
|
+
## [8.0.0] - 2026-09-16
|
|
11
|
+
|
|
12
|
+
- Breaking: replaced generic custom-data hashes with immutable Sorbet-typed
|
|
13
|
+
`CustomData`, `CustomDataInput`, and `CustomDataPatch` values.
|
|
14
|
+
- Preserved open-ended JSON request values while making replacement and merge
|
|
15
|
+
behavior explicit and validating custom-data size and key limits.
|
|
16
|
+
- Kept customer billing and shipping addresses represented by their native
|
|
17
|
+
typed request and response models throughout serialization.
|
|
18
|
+
|
|
3
19
|
## [7.0.0] - 2026-09-14
|
|
4
20
|
|
|
5
21
|
- Breaking: replaced payout hashes and generic payloads with named request,
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
|
+
require_relative "../order/document_delivery_summary"
|
|
7
8
|
require_relative "invoice_view_beneficiary"
|
|
8
9
|
require_relative "invoice_view_format"
|
|
9
10
|
require_relative "invoice_view_status"
|
|
@@ -18,6 +19,12 @@ module Inttegro
|
|
|
18
19
|
#
|
|
19
20
|
# @api public
|
|
20
21
|
#
|
|
22
|
+
# @!attribute [r] delivery_summary
|
|
23
|
+
# Bounded aggregate of Chime-accepted sends for one generated order document.
|
|
24
|
+
#
|
|
25
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `delivery_summary`.
|
|
26
|
+
# @return [Inttegro::Order::DocumentDeliverySummary, nil]
|
|
27
|
+
#
|
|
21
28
|
# @!attribute [r] id
|
|
22
29
|
# Value of the `id` field in the Inttegro API payload.
|
|
23
30
|
#
|
|
@@ -66,6 +73,7 @@ module Inttegro
|
|
|
66
73
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `beneficiary`.
|
|
67
74
|
# @return [Inttegro::Checkout::InvoiceViewBeneficiary, nil]
|
|
68
75
|
class InvoiceView < T::Struct
|
|
76
|
+
const :delivery_summary, T.nilable(Inttegro::Order::DocumentDeliverySummary), default: nil
|
|
69
77
|
const :id, String
|
|
70
78
|
const :application_id, T.nilable(String), default: nil
|
|
71
79
|
const :number, T.nilable(String), default: nil
|
|
@@ -31,6 +31,29 @@ module Inttegro
|
|
|
31
31
|
class OrderLineItemGroup < T::Struct
|
|
32
32
|
const :line_items, T.nilable(T::Array[Inttegro::Shared::LineItem]), default: nil
|
|
33
33
|
const :total, T.nilable(Inttegro::Money::Amount), default: nil
|
|
34
|
+
|
|
35
|
+
extend T::Sig
|
|
36
|
+
|
|
37
|
+
sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
|
|
38
|
+
def self.from_hash(hash, strict = false)
|
|
39
|
+
data = hash.dup
|
|
40
|
+
if (line_items_value = data["line_items"]).is_a?(Array)
|
|
41
|
+
data["line_items"] = line_items_value.map do |item|
|
|
42
|
+
next item unless item.is_a?(Hash)
|
|
43
|
+
case item["type"]
|
|
44
|
+
when "product"
|
|
45
|
+
Inttegro::Product::LineItem.from_hash(item)
|
|
46
|
+
when "fee"
|
|
47
|
+
Inttegro::Shared::FeeLineItem.from_hash(item)
|
|
48
|
+
when "shipping"
|
|
49
|
+
Inttegro::Shared::ShippingLineItem.from_hash(item)
|
|
50
|
+
else
|
|
51
|
+
item
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
super(data, strict)
|
|
56
|
+
end
|
|
34
57
|
end
|
|
35
58
|
end
|
|
36
59
|
end
|
data/lib/inttegro/chime/chime.rb
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
|
+
require_relative "../custom_data"
|
|
7
8
|
require_relative "email_message"
|
|
8
9
|
require_relative "recipient_detail"
|
|
9
10
|
require_relative "transmission"
|
|
@@ -28,7 +29,7 @@ module Inttegro
|
|
|
28
29
|
# collection rather than a raw map.
|
|
29
30
|
#
|
|
30
31
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
|
|
31
|
-
# @return [
|
|
32
|
+
# @return [Inttegro::CustomData, nil]
|
|
32
33
|
#
|
|
33
34
|
# @!attribute [r] customer_id
|
|
34
35
|
# Value of the `customer_id` field in the Inttegro API payload.
|
|
@@ -85,7 +86,7 @@ module Inttegro
|
|
|
85
86
|
# @return [Inttegro::Chime::Transmission, nil]
|
|
86
87
|
class Chime
|
|
87
88
|
const :created_at, Time
|
|
88
|
-
const :custom_data, T.nilable(
|
|
89
|
+
const :custom_data, T.nilable(Inttegro::CustomData), default: nil
|
|
89
90
|
const :customer_id, T.nilable(String), default: nil
|
|
90
91
|
const :email, T.nilable(Inttegro::Chime::EmailMessage), default: nil
|
|
91
92
|
const :full_message, String
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
|
+
require_relative "../custom_data"
|
|
7
8
|
require_relative "../message_template/reference"
|
|
8
9
|
require_relative "email_message_input"
|
|
9
10
|
require_relative "recipient"
|
|
11
|
+
require_relative "send_request_cooldown"
|
|
10
12
|
require_relative "send_request_request_meta"
|
|
11
13
|
|
|
12
14
|
module Inttegro
|
|
@@ -56,12 +58,19 @@ module Inttegro
|
|
|
56
58
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `purpose`.
|
|
57
59
|
# @return [String, nil]
|
|
58
60
|
#
|
|
61
|
+
# @!attribute [r] cooldown
|
|
62
|
+
# Optional application-scoped delivery cooldown. A repeat send with the same key is rejected
|
|
63
|
+
# until the duration elapses.
|
|
64
|
+
#
|
|
65
|
+
# Optional in the API payload; omitted values default to `nil`. Wire name: `cooldown`.
|
|
66
|
+
# @return [Inttegro::Chime::SendRequestCooldown, nil]
|
|
67
|
+
#
|
|
59
68
|
# @!attribute [r] custom_data
|
|
60
69
|
# Merchant-defined string values attached to a resource. SDKs expose this as a semantic
|
|
61
70
|
# collection rather than a raw map.
|
|
62
71
|
#
|
|
63
72
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
|
|
64
|
-
# @return [
|
|
73
|
+
# @return [Inttegro::CustomData, nil]
|
|
65
74
|
#
|
|
66
75
|
# @!attribute [r] request_meta
|
|
67
76
|
# Optional metadata controlling request processing
|
|
@@ -75,7 +84,8 @@ module Inttegro
|
|
|
75
84
|
const :message_template, T.nilable(Inttegro::MessageTemplate::Reference), default: nil
|
|
76
85
|
const :sender_id, T.nilable(String), default: nil
|
|
77
86
|
const :purpose, T.nilable(String), default: nil
|
|
78
|
-
const :
|
|
87
|
+
const :cooldown, T.nilable(Inttegro::Chime::SendRequestCooldown), default: nil
|
|
88
|
+
const :custom_data, T.nilable(Inttegro::CustomData), default: nil
|
|
79
89
|
const :request_meta, T.nilable(Inttegro::Chime::SendRequestRequestMeta), default: nil
|
|
80
90
|
end
|
|
81
91
|
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# typed: strict
|
|
3
|
+
|
|
4
|
+
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
|
+
|
|
6
|
+
require_relative "base"
|
|
7
|
+
|
|
8
|
+
module Inttegro
|
|
9
|
+
class Chime
|
|
10
|
+
# Optional application-scoped delivery cooldown. A repeat send with the same key is rejected
|
|
11
|
+
# until the duration elapses.
|
|
12
|
+
#
|
|
13
|
+
# This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
|
|
14
|
+
# payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
|
|
15
|
+
# field names and serialized enum values.
|
|
16
|
+
#
|
|
17
|
+
# @api public
|
|
18
|
+
#
|
|
19
|
+
# @!attribute [r] key
|
|
20
|
+
# Stable identifier for the notification being sent.
|
|
21
|
+
#
|
|
22
|
+
# Required in the API payload. Wire name: `key`.
|
|
23
|
+
# @return [String]
|
|
24
|
+
#
|
|
25
|
+
# @!attribute [r] duration_seconds
|
|
26
|
+
# Rolling cooldown from the first accepted send attempt.
|
|
27
|
+
#
|
|
28
|
+
# Required in the API payload. Wire name: `duration_seconds`.
|
|
29
|
+
# @return [Integer]
|
|
30
|
+
class SendRequestCooldown < T::Struct
|
|
31
|
+
const :key, String
|
|
32
|
+
const :duration_seconds, Integer
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -7,7 +7,8 @@ require_relative "base"
|
|
|
7
7
|
|
|
8
8
|
module Inttegro
|
|
9
9
|
class Chime
|
|
10
|
-
#
|
|
10
|
+
# Optional delivery transport. When omitted, an email address selects email and a phone number
|
|
11
|
+
# selects SMS.
|
|
11
12
|
#
|
|
12
13
|
# Use the constants below when constructing a request. `#serialize` returns the documented
|
|
13
14
|
# string wire value received from or sent to the API.
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# typed: strict
|
|
3
|
+
|
|
4
|
+
require "json"
|
|
5
|
+
require "sorbet-runtime"
|
|
6
|
+
|
|
7
|
+
module Inttegro
|
|
8
|
+
MAX_CUSTOM_DATA_KEY_BYTES = T.let(256, Integer)
|
|
9
|
+
MAX_CUSTOM_DATA_BYTES = T.let(25 * 1024, Integer)
|
|
10
|
+
|
|
11
|
+
# Immutable merchant-defined string values returned by the API.
|
|
12
|
+
class CustomData < Hash
|
|
13
|
+
extend T::Sig
|
|
14
|
+
extend T::Generic
|
|
15
|
+
|
|
16
|
+
K = type_member(:out) { { fixed: String } }
|
|
17
|
+
V = type_member(:out) { { fixed: String } }
|
|
18
|
+
Elem = type_member(:out) { { fixed: T::Array[T.any(String, String)] } }
|
|
19
|
+
|
|
20
|
+
sig { params(values: T::Hash[String, String]).void }
|
|
21
|
+
def initialize(values = {})
|
|
22
|
+
super()
|
|
23
|
+
values.each do |key, value|
|
|
24
|
+
CustomDataValidation.validate_key(key)
|
|
25
|
+
self[key] = value
|
|
26
|
+
end
|
|
27
|
+
CustomDataValidation.validate_size(to_h)
|
|
28
|
+
freeze
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
sig { params(key: String, value: String).returns(CustomData) }
|
|
32
|
+
def set(key, value)
|
|
33
|
+
CustomData.new(to_h.merge(key => value))
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
sig { params(key: String).returns(CustomData) }
|
|
37
|
+
def remove(key)
|
|
38
|
+
CustomData.new(to_h.reject { |candidate, _| candidate == key })
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Immutable open-ended JSON values accepted by create and replace requests.
|
|
43
|
+
class CustomDataInput < Hash
|
|
44
|
+
extend T::Sig
|
|
45
|
+
extend T::Generic
|
|
46
|
+
|
|
47
|
+
K = type_member(:out) { { fixed: String } }
|
|
48
|
+
V = type_member(:out) { { fixed: Object } }
|
|
49
|
+
Elem = type_member(:out) { { fixed: T::Array[T.any(String, Object)] } }
|
|
50
|
+
|
|
51
|
+
sig { params(values: T::Hash[String, Object]).void }
|
|
52
|
+
def initialize(values = {})
|
|
53
|
+
super()
|
|
54
|
+
values.each do |key, value|
|
|
55
|
+
CustomDataValidation.validate_key(key)
|
|
56
|
+
self[key] = CustomDataValidation.copy_json(value)
|
|
57
|
+
end
|
|
58
|
+
CustomDataValidation.validate_size(to_h)
|
|
59
|
+
freeze
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
sig { params(key: String, value: Object).returns(CustomDataInput) }
|
|
63
|
+
def set(key, value)
|
|
64
|
+
CustomDataInput.new(to_h.merge(key => value))
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
sig { params(key: String).returns(CustomDataInput) }
|
|
68
|
+
def remove(key)
|
|
69
|
+
CustomDataInput.new(to_h.reject { |candidate, _| candidate == key })
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Immutable custom-data merge operations. A nil value removes a stored key.
|
|
74
|
+
class CustomDataPatch < Hash
|
|
75
|
+
extend T::Sig
|
|
76
|
+
extend T::Generic
|
|
77
|
+
|
|
78
|
+
K = type_member(:out) { { fixed: String } }
|
|
79
|
+
V = type_member(:out) { { fixed: Object } }
|
|
80
|
+
Elem = type_member(:out) { { fixed: T::Array[T.any(String, Object)] } }
|
|
81
|
+
|
|
82
|
+
sig { params(values: T::Hash[String, Object]).void }
|
|
83
|
+
def initialize(values = {})
|
|
84
|
+
super()
|
|
85
|
+
values.each do |key, value|
|
|
86
|
+
CustomDataValidation.validate_key(key)
|
|
87
|
+
self[key] = CustomDataValidation.copy_json(value)
|
|
88
|
+
end
|
|
89
|
+
CustomDataValidation.validate_size(to_h)
|
|
90
|
+
freeze
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
sig { params(key: String, value: Object).returns(CustomDataPatch) }
|
|
94
|
+
def set(key, value)
|
|
95
|
+
raise ArgumentError, "use unset to remove a custom-data value" if value.nil?
|
|
96
|
+
|
|
97
|
+
CustomDataPatch.new(to_h.merge(key => value))
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
sig { params(key: String).returns(CustomDataPatch) }
|
|
101
|
+
def unset(key)
|
|
102
|
+
CustomDataPatch.new(to_h.merge(key => nil))
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
sig { params(key: String).returns(CustomDataPatch) }
|
|
106
|
+
def remove_change(key)
|
|
107
|
+
CustomDataPatch.new(to_h.reject { |candidate, _| candidate == key })
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
module CustomDataValidation
|
|
112
|
+
extend T::Sig
|
|
113
|
+
|
|
114
|
+
sig { params(key: String).void }
|
|
115
|
+
def self.validate_key(key)
|
|
116
|
+
raise ArgumentError, "custom data key exceeds 256 bytes" if key.bytesize > MAX_CUSTOM_DATA_KEY_BYTES
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
sig { params(values: T::Hash[String, Object]).void }
|
|
120
|
+
def self.validate_size(values)
|
|
121
|
+
raise ArgumentError, "custom data exceeds 25 KiB" if JSON.generate(values).bytesize > MAX_CUSTOM_DATA_BYTES
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
sig { params(value: Object).returns(Object) }
|
|
125
|
+
def self.copy_json(value)
|
|
126
|
+
JSON.parse(JSON.generate(value))
|
|
127
|
+
rescue JSON::GeneratorError, TypeError => error
|
|
128
|
+
raise TypeError, "custom data values must be JSON-serializable: #{error.message}"
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
private_constant :CustomDataValidation
|
|
132
|
+
end
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
|
+
require_relative "../custom_data"
|
|
7
8
|
require_relative "address_input"
|
|
8
9
|
|
|
9
10
|
module Inttegro
|
|
@@ -27,7 +28,7 @@ module Inttegro
|
|
|
27
28
|
# before storage.
|
|
28
29
|
#
|
|
29
30
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
|
|
30
|
-
# @return [
|
|
31
|
+
# @return [Inttegro::CustomDataInput, nil]
|
|
31
32
|
#
|
|
32
33
|
# @!attribute [r] email_address
|
|
33
34
|
# Value of the `email_address` field in the Inttegro API payload.
|
|
@@ -66,7 +67,7 @@ module Inttegro
|
|
|
66
67
|
# @return [String, nil]
|
|
67
68
|
class CreateRequest < T::Struct
|
|
68
69
|
const :billing_address, T.nilable(Inttegro::Customer::AddressInput), default: nil
|
|
69
|
-
const :custom_data, T.nilable(
|
|
70
|
+
const :custom_data, T.nilable(Inttegro::CustomDataInput), default: nil
|
|
70
71
|
const :email_address, T.nilable(String), default: nil
|
|
71
72
|
const :name, String
|
|
72
73
|
const :phone_number, T.nilable(String), default: nil
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
|
+
require_relative "../custom_data"
|
|
7
8
|
require_relative "address"
|
|
8
9
|
require_relative "balance_value"
|
|
9
10
|
|
|
@@ -39,7 +40,7 @@ module Inttegro
|
|
|
39
40
|
# collection rather than a raw map.
|
|
40
41
|
#
|
|
41
42
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
|
|
42
|
-
# @return [
|
|
43
|
+
# @return [Inttegro::CustomData, nil]
|
|
43
44
|
#
|
|
44
45
|
# @!attribute [r] email_address
|
|
45
46
|
# Value of the `email_address` field in the Inttegro API payload.
|
|
@@ -104,7 +105,7 @@ module Inttegro
|
|
|
104
105
|
const :balance, T::Hash[String, Inttegro::Customer::BalanceValue]
|
|
105
106
|
const :billing_address, T.nilable(Inttegro::Customer::Address), default: nil
|
|
106
107
|
const :created_at, Time
|
|
107
|
-
const :custom_data, T.nilable(
|
|
108
|
+
const :custom_data, T.nilable(Inttegro::CustomData), default: nil
|
|
108
109
|
const :email_address, T.nilable(String), default: nil
|
|
109
110
|
const :guest, T::Boolean
|
|
110
111
|
const :id, String
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
|
+
require_relative "../custom_data"
|
|
7
8
|
|
|
8
9
|
module Inttegro
|
|
9
10
|
class Customer
|
|
@@ -44,13 +45,13 @@ module Inttegro
|
|
|
44
45
|
# before storage.
|
|
45
46
|
#
|
|
46
47
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
|
|
47
|
-
# @return [
|
|
48
|
+
# @return [Inttegro::CustomDataInput, nil]
|
|
48
49
|
class Data < T::Struct
|
|
49
50
|
const :name, String
|
|
50
51
|
const :email_address, String
|
|
51
52
|
const :phone_number, String
|
|
52
53
|
const :reference, T.nilable(String), default: nil
|
|
53
|
-
const :custom_data, T.nilable(
|
|
54
|
+
const :custom_data, T.nilable(Inttegro::CustomDataInput), default: nil
|
|
54
55
|
end
|
|
55
56
|
end
|
|
56
57
|
end
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
|
+
require_relative "../custom_data"
|
|
7
8
|
require_relative "address_input"
|
|
8
9
|
|
|
9
10
|
module Inttegro
|
|
@@ -27,7 +28,7 @@ module Inttegro
|
|
|
27
28
|
# before storage.
|
|
28
29
|
#
|
|
29
30
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
|
|
30
|
-
# @return [
|
|
31
|
+
# @return [Inttegro::CustomDataInput, nil]
|
|
31
32
|
#
|
|
32
33
|
# @!attribute [r] customer_id
|
|
33
34
|
# Value of the `customer_id` field in the Inttegro API payload.
|
|
@@ -78,7 +79,7 @@ module Inttegro
|
|
|
78
79
|
# @return [String, nil]
|
|
79
80
|
class UpdateRequest < T::Struct
|
|
80
81
|
const :billing_address, T.nilable(Inttegro::Customer::AddressInput), default: nil
|
|
81
|
-
const :custom_data, T.nilable(
|
|
82
|
+
const :custom_data, T.nilable(Inttegro::CustomDataInput), default: nil
|
|
82
83
|
const :customer_id, String
|
|
83
84
|
const :email_address, T.nilable(String), default: nil
|
|
84
85
|
const :name, T.nilable(String), default: nil
|
data/lib/inttegro/file/file.rb
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
|
+
require_relative "../custom_data"
|
|
7
8
|
require_relative "actor"
|
|
8
9
|
require_relative "delivery"
|
|
9
10
|
require_relative "latest_error"
|
|
@@ -119,7 +120,7 @@ module Inttegro
|
|
|
119
120
|
# collection rather than a raw map.
|
|
120
121
|
#
|
|
121
122
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
|
|
122
|
-
# @return [
|
|
123
|
+
# @return [Inttegro::CustomData, nil]
|
|
123
124
|
#
|
|
124
125
|
# @!attribute [r] metadata
|
|
125
126
|
# System-managed string metadata attached to a file resource.
|
|
@@ -166,7 +167,7 @@ module Inttegro
|
|
|
166
167
|
const :storage, Inttegro::File::PublicStorage
|
|
167
168
|
const :delivery, T.nilable(Inttegro::File::Delivery), default: nil
|
|
168
169
|
const :latest_error, T.nilable(Inttegro::File::LatestError), default: nil
|
|
169
|
-
const :custom_data, T.nilable(
|
|
170
|
+
const :custom_data, T.nilable(Inttegro::CustomData), default: nil
|
|
170
171
|
const :metadata, T.nilable(T::Hash[String, String]), default: nil
|
|
171
172
|
const :created_at, Time
|
|
172
173
|
const :updated_at, Time
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
|
+
require_relative "../custom_data"
|
|
7
8
|
require_relative "../file/actor_input"
|
|
8
9
|
require_relative "access_request"
|
|
9
10
|
require_relative "delivery"
|
|
@@ -47,7 +48,7 @@ module Inttegro
|
|
|
47
48
|
# collection rather than a raw map.
|
|
48
49
|
#
|
|
49
50
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
|
|
50
|
-
# @return [
|
|
51
|
+
# @return [Inttegro::CustomData, nil]
|
|
51
52
|
#
|
|
52
53
|
# @!attribute [r] expires_at
|
|
53
54
|
# Value of the `expires_at` field in the Inttegro API payload.
|
|
@@ -59,7 +60,7 @@ module Inttegro
|
|
|
59
60
|
const :delivery, T.nilable(Inttegro::FileLink::Delivery), default: nil
|
|
60
61
|
const :access, T.nilable(Inttegro::FileLink::AccessRequest), default: nil
|
|
61
62
|
const :created_by, T.nilable(Inttegro::File::ActorInput), default: nil
|
|
62
|
-
const :custom_data, T.nilable(
|
|
63
|
+
const :custom_data, T.nilable(Inttegro::CustomData), default: nil
|
|
63
64
|
const :expires_at, T.nilable(Time), default: nil
|
|
64
65
|
end
|
|
65
66
|
end
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
|
+
require_relative "../custom_data"
|
|
7
8
|
require_relative "access"
|
|
8
9
|
require_relative "actor"
|
|
9
10
|
require_relative "delivery"
|
|
@@ -84,7 +85,7 @@ module Inttegro
|
|
|
84
85
|
# collection rather than a raw map.
|
|
85
86
|
#
|
|
86
87
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
|
|
87
|
-
# @return [
|
|
88
|
+
# @return [Inttegro::CustomData, nil]
|
|
88
89
|
#
|
|
89
90
|
# @!attribute [r] metadata
|
|
90
91
|
# System-managed string metadata attached to a file resource.
|
|
@@ -126,7 +127,7 @@ module Inttegro
|
|
|
126
127
|
const :access, Inttegro::FileLink::Access
|
|
127
128
|
const :created_by, Inttegro::FileLink::Actor
|
|
128
129
|
const :revoked_by, T.nilable(Inttegro::FileLink::Actor), default: nil
|
|
129
|
-
const :custom_data, T.nilable(
|
|
130
|
+
const :custom_data, T.nilable(Inttegro::CustomData), default: nil
|
|
130
131
|
const :metadata, T.nilable(T::Hash[String, String]), default: nil
|
|
131
132
|
const :created_at, Time
|
|
132
133
|
const :updated_at, Time
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
|
+
require_relative "../custom_data"
|
|
7
8
|
require_relative "bank_request_bank_account"
|
|
8
9
|
require_relative "bank_request_type"
|
|
9
10
|
require_relative "owner_input"
|
|
@@ -32,7 +33,7 @@ module Inttegro
|
|
|
32
33
|
# before storage.
|
|
33
34
|
#
|
|
34
35
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
|
|
35
|
-
# @return [
|
|
36
|
+
# @return [Inttegro::CustomDataInput, nil]
|
|
36
37
|
#
|
|
37
38
|
# @!attribute [r] description
|
|
38
39
|
# Value of the `description` field in the Inttegro API payload.
|
|
@@ -83,7 +84,7 @@ module Inttegro
|
|
|
83
84
|
# @return [Inttegro::FinancialAccount::BankRequestBankAccount]
|
|
84
85
|
class BankRequest < T::Struct
|
|
85
86
|
const :currency, String
|
|
86
|
-
const :custom_data, T.nilable(
|
|
87
|
+
const :custom_data, T.nilable(Inttegro::CustomDataInput), default: nil
|
|
87
88
|
const :description, T.nilable(String), default: nil
|
|
88
89
|
const :label, String
|
|
89
90
|
const :owner, T.nilable(Inttegro::FinancialAccount::OwnerInput), default: nil
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
|
+
require_relative "../custom_data"
|
|
7
8
|
require_relative "../shared/dosh_account"
|
|
8
9
|
require_relative "../shared/financial_institution"
|
|
9
10
|
require_relative "../shared/resource_supply"
|
|
@@ -48,7 +49,7 @@ module Inttegro
|
|
|
48
49
|
# collection rather than a raw map.
|
|
49
50
|
#
|
|
50
51
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
|
|
51
|
-
# @return [
|
|
52
|
+
# @return [Inttegro::CustomData, nil]
|
|
52
53
|
#
|
|
53
54
|
# @!attribute [r] description
|
|
54
55
|
# Value of the `description` field in the Inttegro API payload.
|
|
@@ -138,7 +139,7 @@ module Inttegro
|
|
|
138
139
|
const :archived_at, T.nilable(Time), default: nil
|
|
139
140
|
const :created_at, Time
|
|
140
141
|
const :currency, String
|
|
141
|
-
const :custom_data, T.nilable(
|
|
142
|
+
const :custom_data, T.nilable(Inttegro::CustomData), default: nil
|
|
142
143
|
const :description, T.nilable(String), default: nil
|
|
143
144
|
const :id, String
|
|
144
145
|
const :institution, T.nilable(Inttegro::Shared::FinancialInstitution), default: nil
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
|
+
require_relative "../custom_data"
|
|
7
8
|
require_relative "../shared/financial_institution"
|
|
8
9
|
require_relative "../shared/resource_supply"
|
|
9
10
|
require_relative "created_bank"
|
|
@@ -47,7 +48,7 @@ module Inttegro
|
|
|
47
48
|
# collection rather than a raw map.
|
|
48
49
|
#
|
|
49
50
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
|
|
50
|
-
# @return [
|
|
51
|
+
# @return [Inttegro::CustomData, nil]
|
|
51
52
|
#
|
|
52
53
|
# @!attribute [r] description
|
|
53
54
|
# Value of the `description` field in the Inttegro API payload.
|
|
@@ -130,7 +131,7 @@ module Inttegro
|
|
|
130
131
|
const :archived_at, T.nilable(Time), default: nil
|
|
131
132
|
const :created_at, Time
|
|
132
133
|
const :currency, String
|
|
133
|
-
const :custom_data, T.nilable(
|
|
134
|
+
const :custom_data, T.nilable(Inttegro::CustomData), default: nil
|
|
134
135
|
const :description, T.nilable(String), default: nil
|
|
135
136
|
const :id, String
|
|
136
137
|
const :institution, T.nilable(Inttegro::Shared::FinancialInstitution), default: nil
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
|
+
require_relative "../custom_data"
|
|
7
8
|
require_relative "../shared/financial_institution"
|
|
8
9
|
require_relative "../shared/resource_supply"
|
|
9
10
|
require_relative "pull_configuration"
|
|
@@ -44,7 +45,7 @@ module Inttegro
|
|
|
44
45
|
# collection rather than a raw map.
|
|
45
46
|
#
|
|
46
47
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
|
|
47
|
-
# @return [
|
|
48
|
+
# @return [Inttegro::CustomData, nil]
|
|
48
49
|
#
|
|
49
50
|
# @!attribute [r] description
|
|
50
51
|
# Value of the `description` field in the Inttegro API payload.
|
|
@@ -109,7 +110,7 @@ module Inttegro
|
|
|
109
110
|
const :archived_at, T.nilable(Time), default: nil
|
|
110
111
|
const :created_at, Time
|
|
111
112
|
const :currency, String
|
|
112
|
-
const :custom_data, T.nilable(
|
|
113
|
+
const :custom_data, T.nilable(Inttegro::CustomData), default: nil
|
|
113
114
|
const :description, T.nilable(String), default: nil
|
|
114
115
|
const :id, String
|
|
115
116
|
const :institution, T.nilable(Inttegro::Shared::FinancialInstitution), default: nil
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# Generated from openapi/commerce.yml by bin/generate-openapi-types. Do not edit.
|
|
5
5
|
|
|
6
6
|
require_relative "base"
|
|
7
|
+
require_relative "../custom_data"
|
|
7
8
|
require_relative "../shared/dosh_account"
|
|
8
9
|
require_relative "dosh_request_type"
|
|
9
10
|
require_relative "owner_input"
|
|
@@ -31,7 +32,7 @@ module Inttegro
|
|
|
31
32
|
# before storage.
|
|
32
33
|
#
|
|
33
34
|
# Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
|
|
34
|
-
# @return [
|
|
35
|
+
# @return [Inttegro::CustomDataInput, nil]
|
|
35
36
|
#
|
|
36
37
|
# @!attribute [r] description
|
|
37
38
|
# Value of the `description` field in the Inttegro API payload.
|
|
@@ -83,7 +84,7 @@ module Inttegro
|
|
|
83
84
|
# @return [Inttegro::Shared::DoshAccount]
|
|
84
85
|
class DoshRequest < T::Struct
|
|
85
86
|
const :currency, String
|
|
86
|
-
const :custom_data, T.nilable(
|
|
87
|
+
const :custom_data, T.nilable(Inttegro::CustomDataInput), default: nil
|
|
87
88
|
const :description, T.nilable(String), default: nil
|
|
88
89
|
const :label, String
|
|
89
90
|
const :owner, Inttegro::FinancialAccount::OwnerInput
|