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.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/lib/inttegro/checkout/invoice_view.rb +8 -0
  4. data/lib/inttegro/checkout/order_line_item_group.rb +23 -0
  5. data/lib/inttegro/chime/chime.rb +3 -2
  6. data/lib/inttegro/chime/send_request.rb +12 -2
  7. data/lib/inttegro/chime/send_request_cooldown.rb +35 -0
  8. data/lib/inttegro/chime/transport.rb +2 -1
  9. data/lib/inttegro/custom_data.rb +132 -0
  10. data/lib/inttegro/customer/create_request.rb +3 -2
  11. data/lib/inttegro/customer/customer.rb +3 -2
  12. data/lib/inttegro/customer/data.rb +3 -2
  13. data/lib/inttegro/customer/update_request.rb +3 -2
  14. data/lib/inttegro/file/file.rb +3 -2
  15. data/lib/inttegro/file_link/create_request.rb +3 -2
  16. data/lib/inttegro/file_link/file_link.rb +3 -2
  17. data/lib/inttegro/financial_account/bank_request.rb +3 -2
  18. data/lib/inttegro/financial_account/connected.rb +3 -2
  19. data/lib/inttegro/financial_account/created.rb +3 -2
  20. data/lib/inttegro/financial_account/details.rb +3 -2
  21. data/lib/inttegro/financial_account/dosh_request.rb +3 -2
  22. data/lib/inttegro/financial_account/financial_account.rb +3 -2
  23. data/lib/inttegro/financial_account/request_base.rb +3 -2
  24. data/lib/inttegro/financial_account/update_request.rb +3 -2
  25. data/lib/inttegro/financial_account/updated.rb +3 -2
  26. data/lib/inttegro/financial_account/wallet_request.rb +3 -2
  27. data/lib/inttegro/financial_account/wire_page_accounts_item.rb +3 -2
  28. data/lib/inttegro/generated/enums.rb +17 -1
  29. data/lib/inttegro/generated/models.rb +36 -0
  30. data/lib/inttegro/generated/operations.rb +18 -3
  31. data/lib/inttegro/http_client.rb +1 -1
  32. data/lib/inttegro/model_serialization.rb +30 -1
  33. data/lib/inttegro/order/create_existing_customer.rb +26 -2
  34. data/lib/inttegro/order/create_new_customer.rb +26 -2
  35. data/lib/inttegro/order/document_delivery_attempt.rb +7 -0
  36. data/lib/inttegro/order/document_delivery_channel_summary.rb +34 -0
  37. data/lib/inttegro/order/document_delivery_summary.rb +43 -0
  38. data/lib/inttegro/order/document_delivery_summary_channels.rb +36 -0
  39. data/lib/inttegro/order/invoice.rb +8 -0
  40. data/lib/inttegro/order/invoice_format.rb +3 -2
  41. data/lib/inttegro/order/line_item_group.rb +25 -0
  42. data/lib/inttegro/order/order.rb +3 -2
  43. data/lib/inttegro/order/product_line_item_product.rb +3 -2
  44. data/lib/inttegro/order/receipt_document_format.rb +35 -0
  45. data/lib/inttegro/order/update_request.rb +26 -2
  46. data/lib/inttegro/otp/initiate_request.rb +35 -8
  47. data/lib/inttegro/otp/purpose.rb +62 -0
  48. data/lib/inttegro/otp/transmission.rb +4 -4
  49. data/lib/inttegro/otp/transmission_status.rb +9 -0
  50. data/lib/inttegro/otp/verify_request.rb +2 -1
  51. data/lib/inttegro/payment_method/payment_method.rb +14 -2
  52. data/lib/inttegro/payment_method/tokenize_base.rb +3 -2
  53. data/lib/inttegro/payment_method/tokenize_mobile_money_request.rb +3 -2
  54. data/lib/inttegro/payment_method/update_request.rb +3 -2
  55. data/lib/inttegro/payout/payout.rb +3 -2
  56. data/lib/inttegro/price/embedded_product.rb +3 -2
  57. data/lib/inttegro/product/create_request.rb +3 -2
  58. data/lib/inttegro/product/inline_details.rb +3 -2
  59. data/lib/inttegro/product/product.rb +3 -2
  60. data/lib/inttegro/product/update_request.rb +3 -2
  61. data/lib/inttegro/product/updated.rb +3 -2
  62. data/lib/inttegro/purchase_intent/product.rb +3 -2
  63. data/lib/inttegro/refund/create_request.rb +3 -2
  64. data/lib/inttegro/refund/failure.rb +45 -0
  65. data/lib/inttegro/refund/failure_reason.rb +49 -0
  66. data/lib/inttegro/refund/line_item.rb +31 -1
  67. data/lib/inttegro/refund/offline_settlement.rb +28 -0
  68. data/lib/inttegro/{otp/transmission_sent_via.rb → refund/offline_settlement_type.rb} +6 -6
  69. data/lib/inttegro/refund/order_fee_line_item.rb +43 -0
  70. data/lib/inttegro/refund/order_fee_line_item_fee.rb +34 -0
  71. data/lib/inttegro/refund/order_fee_line_item_type.rb +25 -0
  72. data/lib/inttegro/refund/order_line_item.rb +20 -0
  73. data/lib/inttegro/refund/order_product_line_item.rb +50 -0
  74. data/lib/inttegro/refund/order_product_line_item_product.rb +34 -0
  75. data/lib/inttegro/refund/order_product_line_item_type.rb +25 -0
  76. data/lib/inttegro/refund/order_shipping_line_item.rb +43 -0
  77. data/lib/inttegro/refund/order_shipping_line_item_shipping.rb +34 -0
  78. data/lib/inttegro/refund/order_shipping_line_item_type.rb +25 -0
  79. data/lib/inttegro/refund/payment_method_settlement.rb +55 -0
  80. data/lib/inttegro/refund/payment_method_settlement_type.rb +24 -0
  81. data/lib/inttegro/refund/refund.rb +39 -2
  82. data/lib/inttegro/refund/settlement.rb +19 -0
  83. data/lib/inttegro/refund/settlement_bank_account_payment_method.rb +44 -0
  84. data/lib/inttegro/refund/settlement_bank_account_payment_method_bank_account.rb +37 -0
  85. data/lib/inttegro/refund/settlement_bank_account_payment_method_bank_account_ghana_bank_account.rb +35 -0
  86. data/lib/inttegro/refund/settlement_bank_account_payment_method_type.rb +25 -0
  87. data/lib/inttegro/refund/settlement_mobile_money_payment_method.rb +44 -0
  88. data/lib/inttegro/refund/settlement_mobile_money_payment_method_mobile_money.rb +43 -0
  89. data/lib/inttegro/refund/settlement_mobile_money_payment_method_type.rb +25 -0
  90. data/lib/inttegro/refund/settlement_payment_method.rb +19 -0
  91. data/lib/inttegro/resources/customers.rb +8 -0
  92. data/lib/inttegro/resources/financial_accounts.rb +12 -0
  93. data/lib/inttegro/resources/orders.rb +8 -0
  94. data/lib/inttegro/resources/payouts.rb +8 -0
  95. data/lib/inttegro/resources/products.rb +8 -0
  96. data/lib/inttegro/search/base.rb +17 -0
  97. data/lib/inttegro/search/facet.rb +34 -0
  98. data/lib/inttegro/search/facet_bucket.rb +34 -0
  99. data/lib/inttegro/search/facet_result.rb +35 -0
  100. data/lib/inttegro/search/filter.rb +42 -0
  101. data/lib/inttegro/search/filter_operator.rb +27 -0
  102. data/lib/inttegro/search/freshness.rb +43 -0
  103. data/lib/inttegro/search/freshness_state.rb +36 -0
  104. data/lib/inttegro/search/page.rb +104 -0
  105. data/lib/inttegro/search/request.rb +68 -0
  106. data/lib/inttegro/search/resource_freshness.rb +50 -0
  107. data/lib/inttegro/search/resource_freshness_state.rb +37 -0
  108. data/lib/inttegro/search/resource_reference.rb +35 -0
  109. data/lib/inttegro/search/resource_total.rb +43 -0
  110. data/lib/inttegro/search/resource_total_relation.rb +28 -0
  111. data/lib/inttegro/search/response.rb +28 -0
  112. data/lib/inttegro/search/result.rb +78 -0
  113. data/lib/inttegro/search/sort.rb +36 -0
  114. data/lib/inttegro/search/sort_direction.rb +27 -0
  115. data/lib/inttegro/search/sort_field.rb +30 -0
  116. data/lib/inttegro/search/total.rb +35 -0
  117. data/lib/inttegro/search/total_relation.rb +27 -0
  118. data/lib/inttegro/search/type.rb +36 -0
  119. data/lib/inttegro/shared/fee_details.rb +3 -2
  120. data/lib/inttegro/shared/invoice_settings.rb +3 -2
  121. data/lib/inttegro/shared/shipping_details.rb +3 -2
  122. data/lib/inttegro/telemetry.rb +1 -1
  123. data/lib/inttegro/upload_request/create_request.rb +3 -2
  124. data/lib/inttegro/upload_request/details.rb +3 -2
  125. data/lib/inttegro/upload_request/upload_request.rb +3 -2
  126. data/lib/inttegro/version.rb +1 -1
  127. data/lib/inttegro.rb +1 -0
  128. data/rbi/inttegro/generated.rbi +15 -0
  129. metadata +57 -3
@@ -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"
@@ -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 [Hash{String => String}, nil]
51
+ # @return [Inttegro::CustomData, nil]
51
52
  #
52
53
  # @!attribute [r] description
53
54
  # Value of the `description` field in the Inttegro API payload.
@@ -143,7 +144,7 @@ module Inttegro
143
144
  const :archived_at, T.nilable(Time), default: nil
144
145
  const :created_at, Time
145
146
  const :currency, String
146
- const :custom_data, T.nilable(T::Hash[String, String]), default: nil
147
+ const :custom_data, T.nilable(Inttegro::CustomData), default: nil
147
148
  const :description, T.nilable(String), default: nil
148
149
  const :id, String
149
150
  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 "owner_input"
8
9
  require_relative "request_base_pull_configuration"
9
10
  require_relative "request_base_push_configuration"
@@ -30,7 +31,7 @@ module Inttegro
30
31
  # before storage.
31
32
  #
32
33
  # Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
33
- # @return [Hash{String => Object}, nil]
34
+ # @return [Inttegro::CustomDataInput, nil]
34
35
  #
35
36
  # @!attribute [r] description
36
37
  # Value of the `description` field in the Inttegro API payload.
@@ -75,7 +76,7 @@ module Inttegro
75
76
  # @return [Inttegro::FinancialAccount::Type]
76
77
  class RequestBase < T::Struct
77
78
  const :currency, String
78
- const :custom_data, T.nilable(T::Hash[String, Object]), default: nil
79
+ const :custom_data, T.nilable(Inttegro::CustomDataInput), default: nil
79
80
  const :description, T.nilable(String), default: nil
80
81
  const :label, String
81
82
  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 "owner_update_input"
8
9
 
9
10
  module Inttegro
@@ -27,7 +28,7 @@ module Inttegro
27
28
  # serialized to a string.
28
29
  #
29
30
  # Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
30
- # @return [Hash{String => Object}, nil]
31
+ # @return [Inttegro::CustomDataPatch, nil]
31
32
  #
32
33
  # @!attribute [r] description
33
34
  # Value of the `description` field in the Inttegro API payload.
@@ -54,7 +55,7 @@ module Inttegro
54
55
  # @return [String, nil]
55
56
  class UpdateRequest < T::Struct
56
57
  const :account_id, String
57
- const :custom_data, T.nilable(T::Hash[String, Object]), default: nil
58
+ const :custom_data, T.nilable(Inttegro::CustomDataPatch), default: nil
58
59
  const :description, T.nilable(String), default: nil
59
60
  const :label, T.nilable(String), default: nil
60
61
  const :owner, T.nilable(Inttegro::FinancialAccount::OwnerUpdateInput), 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 [Hash{String => String}, nil]
52
+ # @return [Inttegro::CustomData, nil]
52
53
  #
53
54
  # @!attribute [r] description
54
55
  # Value of the `description` field in the Inttegro API payload.
@@ -144,7 +145,7 @@ module Inttegro
144
145
  const :archived_at, T.nilable(Time), default: nil
145
146
  const :created_at, Time
146
147
  const :currency, String
147
- const :custom_data, T.nilable(T::Hash[String, String]), default: nil
148
+ const :custom_data, T.nilable(Inttegro::CustomData), default: nil
148
149
  const :description, T.nilable(String), default: nil
149
150
  const :id, String
150
151
  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 "owner_input"
8
9
  require_relative "request_base_pull_configuration"
9
10
  require_relative "request_base_push_configuration"
@@ -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 [Hash{String => Object}, nil]
35
+ # @return [Inttegro::CustomDataInput, nil]
35
36
  #
36
37
  # @!attribute [r] description
37
38
  # Value of the `description` field in the Inttegro API payload.
@@ -82,7 +83,7 @@ module Inttegro
82
83
  # @return [Inttegro::FinancialAccount::WalletRequestWallet]
83
84
  class WalletRequest < T::Struct
84
85
  const :currency, String
85
- const :custom_data, T.nilable(T::Hash[String, Object]), default: nil
86
+ const :custom_data, T.nilable(Inttegro::CustomDataInput), default: nil
86
87
  const :description, T.nilable(String), default: nil
87
88
  const :label, String
88
89
  const :owner, Inttegro::FinancialAccount::OwnerInput
@@ -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 "type"
8
9
 
9
10
  module Inttegro
@@ -69,7 +70,7 @@ module Inttegro
69
70
  # collection rather than a raw map.
70
71
  #
71
72
  # Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
72
- # @return [Hash{String => String}, nil]
73
+ # @return [Inttegro::CustomData, nil]
73
74
  class WirePageAccountsItem < T::Struct
74
75
  const :id, T.nilable(String), default: nil
75
76
  const :type, T.nilable(Inttegro::FinancialAccount::Type), default: nil
@@ -79,7 +80,7 @@ module Inttegro
79
80
  const :reference, T.nilable(String), default: nil
80
81
  const :created_at, T.nilable(Time), default: nil
81
82
  const :archived_at, T.nilable(Time), default: nil
82
- const :custom_data, T.nilable(T::Hash[String, String]), default: nil
83
+ const :custom_data, T.nilable(Inttegro::CustomData), default: nil
83
84
  end
84
85
  end
85
86
  end
@@ -40,8 +40,8 @@ require_relative "../message_template/variable_item_type"
40
40
  require_relative "../message_template/variable_type"
41
41
  require_relative "../money/currency"
42
42
  require_relative "../otp/alphabet_type"
43
+ require_relative "../otp/purpose"
43
44
  require_relative "../otp/status"
44
- require_relative "../otp/transmission_sent_via"
45
45
  require_relative "../otp/transmission_status"
46
46
  require_relative "../otp/verification_verdict"
47
47
  require_relative "../order/created_from_resource_type"
@@ -67,8 +67,24 @@ require_relative "../product/shipment_input_type"
67
67
  require_relative "../product/shipment_type"
68
68
  require_relative "../product/type"
69
69
  require_relative "../purchase_intent/status"
70
+ require_relative "../refund/failure_reason"
71
+ require_relative "../refund/offline_settlement_type"
72
+ require_relative "../refund/order_fee_line_item_type"
73
+ require_relative "../refund/order_product_line_item_type"
74
+ require_relative "../refund/order_shipping_line_item_type"
75
+ require_relative "../refund/payment_method_settlement_type"
70
76
  require_relative "../refund/reason"
77
+ require_relative "../refund/settlement_bank_account_payment_method_type"
78
+ require_relative "../refund/settlement_mobile_money_payment_method_type"
71
79
  require_relative "../refund/status"
80
+ require_relative "../search/filter_operator"
81
+ require_relative "../search/freshness_state"
82
+ require_relative "../search/resource_freshness_state"
83
+ require_relative "../search/resource_total_relation"
84
+ require_relative "../search/sort_direction"
85
+ require_relative "../search/sort_field"
86
+ require_relative "../search/total_relation"
87
+ require_relative "../search/type"
72
88
  require_relative "../secret_key/auth_result"
73
89
  require_relative "../secret_key/status"
74
90
  require_relative "../secret_key/token_type"
@@ -94,6 +94,9 @@ require_relative "../product/catalog_with_price_reference"
94
94
  require_relative "../checkout/payment_address"
95
95
  require_relative "../checkout/billing_details"
96
96
  require_relative "../checkout/confirm_payment_request"
97
+ require_relative "../order/document_delivery_channel_summary"
98
+ require_relative "../order/document_delivery_summary_channels"
99
+ require_relative "../order/document_delivery_summary"
97
100
  require_relative "../checkout/invoice_view_format_web"
98
101
  require_relative "../checkout/invoice_view_format_pdf"
99
102
  require_relative "../checkout/invoice_view_format_receipt"
@@ -142,9 +145,27 @@ require_relative "../order/created_from"
142
145
  require_relative "../order/address"
143
146
  require_relative "../order/customer"
144
147
  require_relative "../order/document_format"
148
+ require_relative "../order/receipt_document_format"
145
149
  require_relative "../order/invoice_format"
146
150
  require_relative "../order/invoice"
151
+ require_relative "../refund/failure"
152
+ require_relative "../refund/order_product_line_item_product"
153
+ require_relative "../refund/order_product_line_item"
154
+ require_relative "../refund/order_fee_line_item_fee"
155
+ require_relative "../refund/order_fee_line_item"
156
+ require_relative "../refund/order_shipping_line_item_shipping"
157
+ require_relative "../refund/order_shipping_line_item"
158
+ require_relative "../refund/order_line_item"
147
159
  require_relative "../refund/line_item"
160
+ require_relative "../refund/offline_settlement"
161
+ require_relative "../refund/settlement_mobile_money_payment_method_mobile_money"
162
+ require_relative "../refund/settlement_mobile_money_payment_method"
163
+ require_relative "../refund/settlement_bank_account_payment_method_bank_account_ghana_bank_account"
164
+ require_relative "../refund/settlement_bank_account_payment_method_bank_account"
165
+ require_relative "../refund/settlement_bank_account_payment_method"
166
+ require_relative "../refund/settlement_payment_method"
167
+ require_relative "../refund/payment_method_settlement"
168
+ require_relative "../refund/settlement"
148
169
  require_relative "../refund/refund"
149
170
  require_relative "../shared/invoice_settings"
150
171
  require_relative "../price/price"
@@ -473,6 +494,20 @@ require_relative "../refund/page_response"
473
494
  require_relative "../refund/response"
474
495
  require_relative "../message_template/render_preview_request"
475
496
  require_relative "../shared/request_confirmation_request"
497
+ require_relative "../search/facet"
498
+ require_relative "../search/facet_bucket"
499
+ require_relative "../search/facet_result"
500
+ require_relative "../search/filter"
501
+ require_relative "../search/resource_freshness"
502
+ require_relative "../search/freshness"
503
+ require_relative "../search/sort"
504
+ require_relative "../search/total"
505
+ require_relative "../search/resource_total"
506
+ require_relative "../search/resource_reference"
507
+ require_relative "../search/result"
508
+ require_relative "../search/page"
509
+ require_relative "../search/request"
510
+ require_relative "../search/response"
476
511
  require_relative "../shared/response_meta"
477
512
  require_relative "../upload_request/review_reason_input"
478
513
  require_relative "../upload_request/review_attempt_by_id_request"
@@ -493,6 +528,7 @@ require_relative "../secret_key/usage_row"
493
528
  require_relative "../secret_key/usage_page"
494
529
  require_relative "../secret_key/usage"
495
530
  require_relative "../secret_key/usage_request"
531
+ require_relative "../chime/send_request_cooldown"
496
532
  require_relative "../chime/send_request_request_meta"
497
533
  require_relative "../chime/send_request"
498
534
  require_relative "../payout/set_destinations_request"
@@ -126,7 +126,12 @@ module Inttegro
126
126
  "/prices/activate" => Inttegro::Price::Response,
127
127
  "/prices/deactivate" => Inttegro::Price::Response,
128
128
  "/prices/archive" => Inttegro::Price::Response,
129
- "/spec/countries" => Inttegro::Shared::CountrySpecifications
129
+ "/spec/countries" => Inttegro::Shared::CountrySpecifications,
130
+ "/customers/search" => Inttegro::Search::Response,
131
+ "/financial_accounts/search" => Inttegro::Search::Response,
132
+ "/orders/search" => Inttegro::Search::Response,
133
+ "/payouts/search" => Inttegro::Search::Response,
134
+ "/products/search" => Inttegro::Search::Response
130
135
  }.freeze, T::Hash[String, T::Class[T::Struct]])
131
136
 
132
137
  REQUEST_TYPE_NAMES = T.let({
@@ -246,7 +251,12 @@ module Inttegro
246
251
  "/prices/activate" => "Inttegro::Price::ActionRequest",
247
252
  "/prices/deactivate" => "Inttegro::Price::ActionRequest",
248
253
  "/prices/archive" => "Inttegro::Price::ActionRequest",
249
- "/spec/countries" => "Inttegro::Shared::ListCountrySpecsRequest"
254
+ "/spec/countries" => "Inttegro::Shared::ListCountrySpecsRequest",
255
+ "/customers/search" => "Inttegro::Search::Request",
256
+ "/financial_accounts/search" => "Inttegro::Search::Request",
257
+ "/orders/search" => "Inttegro::Search::Request",
258
+ "/payouts/search" => "Inttegro::Search::Request",
259
+ "/products/search" => "Inttegro::Search::Request"
250
260
  }.freeze, T::Hash[String, String])
251
261
 
252
262
  OPERATION_IDS = T.let({
@@ -370,7 +380,12 @@ module Inttegro
370
380
  "/prices/activate" => "activatePrice",
371
381
  "/prices/deactivate" => "deactivatePrice",
372
382
  "/prices/archive" => "archivePrice",
373
- "/spec/countries" => "listCountrySpecs"
383
+ "/spec/countries" => "listCountrySpecs",
384
+ "/customers/search" => "searchCustomers",
385
+ "/financial_accounts/search" => "searchFinancialAccounts",
386
+ "/orders/search" => "searchOrders",
387
+ "/payouts/search" => "searchPayouts",
388
+ "/products/search" => "searchProducts"
374
389
  }.freeze, T::Hash[String, String])
375
390
 
376
391
  BINARY_PATHS = T.let(["/files/contents", "/file_links/open"].freeze, T::Array[String])
@@ -520,7 +520,7 @@ module Inttegro
520
520
  path_or_url
521
521
  end
522
522
  action = path.split("/").reject(&:empty?).last
523
- !["", nil, "lookup", "page", "settings", "countries", "contents", "balances", "render_preview"].include?(action)
523
+ !["", nil, "lookup", "page", "search", "settings", "countries", "contents", "balances", "render_preview"].include?(action)
524
524
  rescue URI::InvalidURIError
525
525
  false
526
526
  end
@@ -44,7 +44,9 @@ module Inttegro
44
44
  data = stringify_json_keys(value, decode_timestamps: true)
45
45
  raise TypeError, "expected an object for #{klass}, got #{data.class}" unless data.is_a?(Hash)
46
46
 
47
- T.cast(klass, T.class_of(T::Struct)).from_hash(data)
47
+ model = T.cast(klass, T.class_of(T::Struct)).from_hash(data)
48
+ wrap_response_custom_data(model)
49
+ model
48
50
  end
49
51
 
50
52
  sig { params(value: Object, decode_timestamps: T::Boolean).returns(Object) }
@@ -56,6 +58,8 @@ module Inttegro
56
58
  # @api private
57
59
  def self.stringify_json_keys(value, decode_timestamps: false)
58
60
  case value
61
+ when CustomData, CustomDataInput, CustomDataPatch
62
+ value
59
63
  when T::Struct
60
64
  stringify_json_keys(value.serialize, decode_timestamps: decode_timestamps)
61
65
  when T::Enum
@@ -82,4 +86,29 @@ module Inttegro
82
86
  end
83
87
  end
84
88
  private_class_method :stringify_json_keys
89
+
90
+ sig { params(value: Object).returns(Object) }
91
+ def self.wrap_response_custom_data(value)
92
+ case value
93
+ when T::Struct
94
+ raw = value.instance_variable_get(:@custom_data)
95
+ if raw.is_a?(Hash) && !raw.is_a?(CustomData)
96
+ value.instance_variable_set(
97
+ :@custom_data,
98
+ CustomData.new(raw)
99
+ )
100
+ end
101
+ value.instance_variables.each do |variable|
102
+ next if variable == :@custom_data
103
+
104
+ wrap_response_custom_data(value.instance_variable_get(variable))
105
+ end
106
+ when Array
107
+ value.each { |item| wrap_response_custom_data(item) }
108
+ when Hash
109
+ value.each_value { |item| wrap_response_custom_data(item) }
110
+ end
111
+ value
112
+ end
113
+ private_class_method :wrap_response_custom_data
85
114
  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 "../payment_method/data"
8
9
  require_relative "../shared/billing_details"
9
10
  require_relative "../shared/invoice_settings"
@@ -112,7 +113,7 @@ module Inttegro
112
113
  # collection rather than a raw map.
113
114
  #
114
115
  # Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
115
- # @return [Hash{String => String}, nil]
116
+ # @return [Inttegro::CustomData, nil]
116
117
  #
117
118
  # @!attribute [r] billing_details
118
119
  # Value of the `billing_details` field in the Inttegro API payload.
@@ -139,9 +140,32 @@ module Inttegro
139
140
  const :invoice_settings, T.nilable(Inttegro::Shared::InvoiceSettings), default: nil
140
141
  const :payout_settings, T.nilable(Inttegro::Order::PayoutSettingsRequest), default: nil
141
142
  const :line_items, T::Array[Inttegro::Shared::LineItem]
142
- const :custom_data, T.nilable(T::Hash[String, String]), default: nil
143
+ const :custom_data, T.nilable(Inttegro::CustomData), default: nil
143
144
  const :billing_details, T.nilable(Inttegro::Shared::BillingDetails), default: nil
144
145
  const :shipping, T.nilable(Inttegro::Shared::Shipping), default: nil
146
+
147
+ extend T::Sig
148
+
149
+ sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
150
+ def self.from_hash(hash, strict = false)
151
+ data = hash.dup
152
+ if (line_items_value = data["line_items"]).is_a?(Array)
153
+ data["line_items"] = line_items_value.map do |item|
154
+ next item unless item.is_a?(Hash)
155
+ case item["type"]
156
+ when "product"
157
+ Inttegro::Product::LineItem.from_hash(item)
158
+ when "fee"
159
+ Inttegro::Shared::FeeLineItem.from_hash(item)
160
+ when "shipping"
161
+ Inttegro::Shared::ShippingLineItem.from_hash(item)
162
+ else
163
+ item
164
+ end
165
+ end
166
+ end
167
+ super(data, strict)
168
+ end
145
169
  end
146
170
  end
147
171
  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 "../customer/data"
8
9
  require_relative "../payment_method/data"
9
10
  require_relative "../shared/billing_details"
@@ -114,7 +115,7 @@ module Inttegro
114
115
  # collection rather than a raw map.
115
116
  #
116
117
  # Optional in the API payload; omitted values default to `nil`. Wire name: `custom_data`.
117
- # @return [Hash{String => String}, nil]
118
+ # @return [Inttegro::CustomData, nil]
118
119
  #
119
120
  # @!attribute [r] billing_details
120
121
  # Value of the `billing_details` field in the Inttegro API payload.
@@ -141,9 +142,32 @@ module Inttegro
141
142
  const :invoice_settings, T.nilable(Inttegro::Shared::InvoiceSettings), default: nil
142
143
  const :payout_settings, T.nilable(Inttegro::Order::PayoutSettingsRequest), default: nil
143
144
  const :line_items, T::Array[Inttegro::Shared::LineItem]
144
- const :custom_data, T.nilable(T::Hash[String, String]), default: nil
145
+ const :custom_data, T.nilable(Inttegro::CustomData), default: nil
145
146
  const :billing_details, T.nilable(Inttegro::Shared::BillingDetails), default: nil
146
147
  const :shipping, T.nilable(Inttegro::Shared::Shipping), default: nil
148
+
149
+ extend T::Sig
150
+
151
+ sig { params(hash: T::Hash[String, Object], strict: T::Boolean).returns(T.attached_class) }
152
+ def self.from_hash(hash, strict = false)
153
+ data = hash.dup
154
+ if (line_items_value = data["line_items"]).is_a?(Array)
155
+ data["line_items"] = line_items_value.map do |item|
156
+ next item unless item.is_a?(Hash)
157
+ case item["type"]
158
+ when "product"
159
+ Inttegro::Product::LineItem.from_hash(item)
160
+ when "fee"
161
+ Inttegro::Shared::FeeLineItem.from_hash(item)
162
+ when "shipping"
163
+ Inttegro::Shared::ShippingLineItem.from_hash(item)
164
+ else
165
+ item
166
+ end
167
+ end
168
+ end
169
+ super(data, strict)
170
+ end
147
171
  end
148
172
  end
149
173
  end
@@ -16,6 +16,12 @@ module Inttegro
16
16
  #
17
17
  # @api public
18
18
  #
19
+ # @!attribute [r] accepted_at
20
+ # Authoritative time at which Chime accepted this channel delivery.
21
+ #
22
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `accepted_at`.
23
+ # @return [Time, nil]
24
+ #
19
25
  # @!attribute [r] channel
20
26
  # Delivery channel.
21
27
  #
@@ -28,6 +34,7 @@ module Inttegro
28
34
  # Optional in the API payload; omitted values default to `nil`. Wire name: `chime_id`.
29
35
  # @return [String, nil]
30
36
  class DocumentDeliveryAttempt < T::Struct
37
+ const :accepted_at, T.nilable(Time), default: nil
31
38
  const :channel, T.nilable(Inttegro::Shared::DeliveryChannel), default: nil
32
39
  const :chime_id, T.nilable(String), default: nil
33
40
  end
@@ -0,0 +1,34 @@
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 Order
10
+ # Bounded aggregate of Chime-accepted sends through one channel.
11
+ #
12
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
13
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
14
+ # field names and serialized enum values.
15
+ #
16
+ # @api public
17
+ #
18
+ # @!attribute [r] count
19
+ # Number of deliveries accepted through this channel.
20
+ #
21
+ # Required in the API payload. Wire name: `count`.
22
+ # @return [Integer]
23
+ #
24
+ # @!attribute [r] latest_sent_at
25
+ # Latest authoritative Chime acceptance time for this channel.
26
+ #
27
+ # Required in the API payload. Wire name: `latest_sent_at`.
28
+ # @return [Time]
29
+ class DocumentDeliveryChannelSummary < T::Struct
30
+ const :count, Integer
31
+ const :latest_sent_at, Time
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,43 @@
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
+ require_relative "document_delivery_summary_channels"
8
+
9
+ module Inttegro
10
+ class Order
11
+ # Bounded aggregate of Chime-accepted sends for one generated order document.
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] channels
20
+ # Accepted send totals grouped by delivery channel. Channels with no accepted sends are
21
+ # omitted.
22
+ #
23
+ # Required in the API payload. Wire name: `channels`.
24
+ # @return [Inttegro::Order::DocumentDeliverySummaryChannels]
25
+ #
26
+ # @!attribute [r] latest_sent_at
27
+ # Latest authoritative Chime acceptance time across all channels.
28
+ #
29
+ # Required in the API payload. Wire name: `latest_sent_at`.
30
+ # @return [Time]
31
+ #
32
+ # @!attribute [r] total_count
33
+ # Total channel deliveries accepted for this document.
34
+ #
35
+ # Required in the API payload. Wire name: `total_count`.
36
+ # @return [Integer]
37
+ class DocumentDeliverySummary < T::Struct
38
+ const :channels, Inttegro::Order::DocumentDeliverySummaryChannels
39
+ const :latest_sent_at, Time
40
+ const :total_count, Integer
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,36 @@
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
+ require_relative "document_delivery_channel_summary"
8
+
9
+ module Inttegro
10
+ class Order
11
+ # Accepted send totals grouped by delivery channel. Channels with no accepted sends are
12
+ # omitted.
13
+ #
14
+ # This generated model is immutable. Construct it with `.new`, or decode a string-keyed API
15
+ # payload with `.from_hash`. `#serialize` produces a string-keyed hash using the original wire
16
+ # field names and serialized enum values.
17
+ #
18
+ # @api public
19
+ #
20
+ # @!attribute [r] email
21
+ # Bounded aggregate of Chime-accepted sends through one channel.
22
+ #
23
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `email`.
24
+ # @return [Inttegro::Order::DocumentDeliveryChannelSummary, nil]
25
+ #
26
+ # @!attribute [r] sms
27
+ # Bounded aggregate of Chime-accepted sends through one channel.
28
+ #
29
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `sms`.
30
+ # @return [Inttegro::Order::DocumentDeliveryChannelSummary, nil]
31
+ class DocumentDeliverySummaryChannels < T::Struct
32
+ const :email, T.nilable(Inttegro::Order::DocumentDeliveryChannelSummary), default: nil
33
+ const :sms, T.nilable(Inttegro::Order::DocumentDeliveryChannelSummary), default: nil
34
+ end
35
+ end
36
+ 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 "document_delivery_summary"
7
8
  require_relative "invoice_format"
8
9
 
9
10
  module Inttegro
@@ -16,6 +17,12 @@ module Inttegro
16
17
  #
17
18
  # @api public
18
19
  #
20
+ # @!attribute [r] delivery_summary
21
+ # Bounded aggregate of Chime-accepted sends for one generated order document.
22
+ #
23
+ # Optional in the API payload; omitted values default to `nil`. Wire name: `delivery_summary`.
24
+ # @return [Inttegro::Order::DocumentDeliverySummary, nil]
25
+ #
19
26
  # @!attribute [r] number
20
27
  # Value of the `number` field in the Inttegro API payload.
21
28
  #
@@ -28,6 +35,7 @@ module Inttegro
28
35
  # Required in the API payload. Wire name: `format`.
29
36
  # @return [Inttegro::Order::InvoiceFormat]
30
37
  class Invoice < T::Struct
38
+ const :delivery_summary, T.nilable(Inttegro::Order::DocumentDeliverySummary), default: nil
31
39
  const :number, T.nilable(String), default: nil
32
40
  const :format_value, Inttegro::Order::InvoiceFormat, name: "format"
33
41
  end
@@ -5,6 +5,7 @@
5
5
 
6
6
  require_relative "base"
7
7
  require_relative "document_format"
8
+ require_relative "receipt_document_format"
8
9
 
9
10
  module Inttegro
10
11
  class Order
@@ -32,11 +33,11 @@ module Inttegro
32
33
  # Value of the `receipt` field in the Inttegro API payload.
33
34
  #
34
35
  # Optional in the API payload; omitted values default to `nil`. Wire name: `receipt`.
35
- # @return [Inttegro::Order::DocumentFormat, nil]
36
+ # @return [Inttegro::Order::ReceiptDocumentFormat, nil]
36
37
  class InvoiceFormat < T::Struct
37
38
  const :web, Inttegro::Order::DocumentFormat
38
39
  const :pdf, Inttegro::Order::DocumentFormat
39
- const :receipt, T.nilable(Inttegro::Order::DocumentFormat), default: nil
40
+ const :receipt, T.nilable(Inttegro::Order::ReceiptDocumentFormat), default: nil
40
41
  end
41
42
  end
42
43
  end