inttegro 1.0.0 → 3.0.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 (40) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/Dockerfile +1 -1
  4. data/README.md +9 -7
  5. data/SECURITY.md +11 -0
  6. data/lib/inttegro/enums.rb +2 -2
  7. data/lib/inttegro/file_download.rb +1 -1
  8. data/lib/inttegro/generated/enums.rb +221 -329
  9. data/lib/inttegro/generated/models.rb +3707 -3830
  10. data/lib/inttegro/generated/operations.rb +230 -230
  11. data/lib/inttegro/http_client.rb +62 -5
  12. data/lib/inttegro/models.rb +54 -105
  13. data/lib/inttegro/resources/apps.rb +3 -3
  14. data/lib/inttegro/resources/balance_transactions.rb +2 -6
  15. data/lib/inttegro/resources/balances.rb +1 -1
  16. data/lib/inttegro/resources/broadcasts.rb +2 -6
  17. data/lib/inttegro/resources/chimes.rb +5 -5
  18. data/lib/inttegro/resources/customers.rb +4 -4
  19. data/lib/inttegro/resources/file_links.rb +4 -6
  20. data/lib/inttegro/resources/file_references.rb +1 -1
  21. data/lib/inttegro/resources/files.rb +4 -6
  22. data/lib/inttegro/resources/financial_accounts.rb +22 -22
  23. data/lib/inttegro/resources/keys.rb +8 -10
  24. data/lib/inttegro/resources/message_templates.rb +13 -15
  25. data/lib/inttegro/resources/orders.rb +72 -69
  26. data/lib/inttegro/resources/otp.rb +4 -4
  27. data/lib/inttegro/resources/payment_methods.rb +34 -36
  28. data/lib/inttegro/resources/payouts.rb +28 -28
  29. data/lib/inttegro/resources/prices.rb +7 -7
  30. data/lib/inttegro/resources/products.rb +9 -9
  31. data/lib/inttegro/resources/purchase_intents.rb +8 -8
  32. data/lib/inttegro/resources/refunds.rb +6 -6
  33. data/lib/inttegro/resources/schedules.rb +4 -4
  34. data/lib/inttegro/resources/spec.rb +1 -1
  35. data/lib/inttegro/resources/upload_requests.rb +10 -10
  36. data/lib/inttegro/response_object.rb +1 -1
  37. data/lib/inttegro/version.rb +1 -1
  38. data/lib/inttegro.rb +15 -0
  39. data/rbi/inttegro/generated.rbi +124 -124
  40. metadata +3 -2
@@ -23,7 +23,7 @@ module Inttegro
23
23
  #
24
24
  # @param destinations [Hash] Map of currency codes to financial account IDs (required)
25
25
  #
26
- # @return [Inttegro::Models::SetPayoutDestinationsResponse] Updated payout settings
26
+ # @return [Inttegro::PayoutSettingsMutation] Updated payout settings
27
27
  #
28
28
  # @example Set payout destinations for multiple currencies
29
29
  # result = client.payouts.set_destinations(
@@ -33,13 +33,13 @@ module Inttegro
33
33
  # }
34
34
  # )
35
35
  #
36
- # puts "Destinations configured: #{result.settings&.destinations}"
36
+ # puts "Destinations configured: #{result.destinations}"
37
37
  #
38
38
  # @see https://studio.inttegro.com/enable-automatic-payouts for configuration guide
39
39
  def set_destinations(destinations:)
40
- @http.post_model(
40
+ @http.post_resource(
41
41
  "/payouts/set_destinations",
42
- Inttegro::Models::SetPayoutDestinationsResponse,
42
+ Inttegro::PayoutSettingsMutation, :settings,
43
43
  { destinations: destinations }
44
44
  )
45
45
  end
@@ -49,16 +49,16 @@ module Inttegro
49
49
  # Returns payout settings including configured payout destinations, schedule information,
50
50
  # and whether foreign exchange is enabled.
51
51
  #
52
- # @return [Inttegro::Models::GetPayoutSettingsResponse] Current payout settings
52
+ # @return [Inttegro::PayoutSettingsLookup] Current payout settings
53
53
  #
54
54
  # @example Get payout settings
55
55
  # result = client.payouts.settings
56
56
  #
57
- # puts "Payout schedule: #{result.settings&.schedule&.name}"
57
+ # puts "Payout schedule: #{result.schedule&.name}"
58
58
  #
59
59
  # @see https://studio.inttegro.com/product-payouts for payouts overview
60
60
  def settings
61
- @http.post_model("/payouts/settings", Inttegro::Models::GetPayoutSettingsResponse, {})
61
+ @http.post_resource("/payouts/settings", Inttegro::PayoutSettingsLookup, :settings, {})
62
62
  end
63
63
 
64
64
  # Disable automatic payouts by switching to manual payout mode.
@@ -68,26 +68,26 @@ module Inttegro
68
68
  # still be at least 7 days old before they can be paid out, but the payout will only occur when you
69
69
  # explicitly request it.
70
70
  #
71
- # @return [Inttegro::Models::DisableAutomaticPayoutsResponse] Updated payout settings
71
+ # @return [Inttegro::PayoutSettingsMutation] Updated payout settings
72
72
  #
73
73
  # @example Disable automatic payouts
74
74
  # result = client.payouts.disable_automatic
75
75
  #
76
- # puts "Schedule type: #{result.settings&.schedule&.type}"
76
+ # puts "Schedule type: #{result.schedule&.type}"
77
77
  #
78
78
  # @see https://studio.inttegro.com/disable-automatic-payouts for manual payout guide
79
79
  def disable_automatic
80
- @http.post_model(
80
+ @http.post_resource(
81
81
  "/payouts/disable",
82
- Inttegro::Models::DisableAutomaticPayoutsResponse,
82
+ Inttegro::PayoutSettingsMutation, :settings,
83
83
  {}
84
84
  )
85
85
  end
86
86
 
87
87
  def enable_automatic
88
- @http.post_model(
88
+ @http.post_resource(
89
89
  "/payouts/enable",
90
- Inttegro::Models::EnableAutomaticPayoutsResponse,
90
+ Inttegro::PayoutSettingsMutation, :settings,
91
91
  {}
92
92
  )
93
93
  end
@@ -106,16 +106,16 @@ module Inttegro
106
106
  # Important: FX conversion incurs additional fees beyond standard payout fees, and exchange rates are
107
107
  # determined at payout execution time. FX-enabled payouts require approval and special configuration.
108
108
  #
109
- # @return [Inttegro::Models::PayoutSettingsResponse] Updated payout settings
109
+ # @return [Inttegro::PayoutSettingsLookup] Updated payout settings
110
110
  #
111
111
  # @example Enable foreign exchange for payouts
112
112
  # result = client.payouts.enable_fx
113
113
  #
114
- # puts "FX enabled: #{result.settings&.fx_enabled}"
114
+ # puts "FX enabled: #{result.fx_enabled}"
115
115
  #
116
116
  # @see https://studio.inttegro.com/enable-fx-payouts for FX payout guide
117
117
  def enable_fx
118
- @http.post_model("/payouts/enable_fx", Inttegro::Models::PayoutSettingsResponse, {})
118
+ @http.post_resource("/payouts/enable_fx", Inttegro::PayoutSettingsLookup, :settings, {})
119
119
  end
120
120
 
121
121
  # Disable foreign exchange conversion for payouts.
@@ -123,16 +123,16 @@ module Inttegro
123
123
  # Disables FX conversion, restricting payouts to accounts that match the transaction currency.
124
124
  # After disabling FX, GHS balance can only be paid out to GHS accounts, USD balance only to USD accounts, etc.
125
125
  #
126
- # @return [Inttegro::Models::PayoutSettingsResponse] Updated payout settings
126
+ # @return [Inttegro::PayoutSettingsLookup] Updated payout settings
127
127
  #
128
128
  # @example Disable foreign exchange for payouts
129
129
  # result = client.payouts.disable_fx
130
130
  #
131
- # puts "FX enabled: #{result.settings&.fx_enabled}"
131
+ # puts "FX enabled: #{result.fx_enabled}"
132
132
  #
133
133
  # @see https://studio.inttegro.com/disable-fx-payouts for FX payout guide
134
134
  def disable_fx
135
- @http.post_model("/payouts/disable_fx", Inttegro::Models::PayoutSettingsResponse, {})
135
+ @http.post_resource("/payouts/disable_fx", Inttegro::PayoutSettingsLookup, :settings, {})
136
136
  end
137
137
 
138
138
  # Retrieve a paginated list of payouts.
@@ -147,7 +147,7 @@ module Inttegro
147
147
  # @option payload [String] :created_after Filter payouts created after this timestamp (ISO 8601)
148
148
  # @option payload [String] :created_before Filter payouts created before this timestamp (ISO 8601)
149
149
  #
150
- # @return [Inttegro::Models::PagePayoutsResponse] Paginated list of payouts
150
+ # @return [Inttegro::PayoutPage] Paginated list of payouts
151
151
  #
152
152
  # @example Get first page of payouts
153
153
  # result = client.payouts.page(
@@ -155,7 +155,7 @@ module Inttegro
155
155
  # page: 1
156
156
  # )
157
157
  #
158
- # puts "Retrieved #{result.page&.payouts&.length || 0} payouts"
158
+ # puts "Retrieved #{result.payouts&.length || 0} payouts"
159
159
  #
160
160
  # @example Filter by status
161
161
  # paid_payouts = client.payouts.page(
@@ -166,17 +166,17 @@ module Inttegro
166
166
  # @see https://studio.inttegro.com/pagination for pagination guide
167
167
  # @see https://studio.inttegro.com/product-payouts for payouts overview
168
168
  def page(payload = {})
169
- @http.post_model("/payouts/page", Inttegro::Models::PagePayoutsResponse, payload || {})
169
+ @http.post_resource("/payouts/page", Inttegro::PayoutPage, :page, payload || {})
170
170
  end
171
171
 
172
172
  def schedule(payload)
173
- @http.post_model("/payouts/schedule", Inttegro::Models::SchedulePayoutResponse, payload)
173
+ @http.post_resource("/payouts/schedule", Inttegro::Payout, :payout, payload)
174
174
  end
175
175
 
176
176
  def lookup(payout_id:)
177
- @http.post_model(
177
+ @http.post_resource(
178
178
  "/payouts/lookup",
179
- Inttegro::Models::LookupPayoutResponse,
179
+ Inttegro::Payout, :payout,
180
180
  { payout_id: payout_id }
181
181
  )
182
182
  end
@@ -187,11 +187,11 @@ module Inttegro
187
187
  #
188
188
  # @param payout_id [String] Scheduled payout ID
189
189
  #
190
- # @return [Inttegro::Models::CancelPayoutResponse] Canceled payout
190
+ # @return [Inttegro::Payout] Canceled payout
191
191
  def cancel(payout_id:)
192
- @http.post_model(
192
+ @http.post_resource(
193
193
  "/payouts/cancel",
194
- Inttegro::Models::CancelPayoutResponse,
194
+ Inttegro::Payout, :payout,
195
195
  { payout_id: payout_id }
196
196
  )
197
197
  end
@@ -9,31 +9,31 @@ module Inttegro
9
9
  end
10
10
 
11
11
  def create(payload)
12
- @http.post_model("/prices/create", Inttegro::Models::PriceResponse, payload)
12
+ @http.post_resource("/prices/create", Inttegro::Price, :price, payload)
13
13
  end
14
14
 
15
15
  def lookup(price_id:)
16
- @http.post_model("/prices/lookup", Inttegro::Models::PriceResponse, { price_id: price_id })
16
+ @http.post_resource("/prices/lookup", Inttegro::Price, :price, { price_id: price_id })
17
17
  end
18
18
 
19
19
  def page(payload = {})
20
- @http.post_model("/prices/page", Inttegro::Models::PricePageResponse, payload || {})
20
+ @http.post_resource("/prices/page", Inttegro::PricePage, :page, payload || {})
21
21
  end
22
22
 
23
23
  def update(payload)
24
- @http.post_model("/prices/update", Inttegro::Models::PriceResponse, payload)
24
+ @http.post_resource("/prices/update", Inttegro::Price, :price, payload)
25
25
  end
26
26
 
27
27
  def activate(price_id:)
28
- @http.post_model("/prices/activate", Inttegro::Models::PriceResponse, { price_id: price_id })
28
+ @http.post_resource("/prices/activate", Inttegro::Price, :price, { price_id: price_id })
29
29
  end
30
30
 
31
31
  def deactivate(price_id:)
32
- @http.post_model("/prices/deactivate", Inttegro::Models::PriceResponse, { price_id: price_id })
32
+ @http.post_resource("/prices/deactivate", Inttegro::Price, :price, { price_id: price_id })
33
33
  end
34
34
 
35
35
  def archive(price_id:)
36
- @http.post_model("/prices/archive", Inttegro::Models::PriceResponse, { price_id: price_id })
36
+ @http.post_resource("/prices/archive", Inttegro::Price, :price, { price_id: price_id })
37
37
  end
38
38
  end
39
39
  end
@@ -9,39 +9,39 @@ module Inttegro
9
9
  end
10
10
 
11
11
  def create(payload)
12
- @http.post_model("/products/create", Inttegro::Models::ProductResponse, payload)
12
+ @http.post_resource("/products/create", Inttegro::Product, :product, payload)
13
13
  end
14
14
 
15
15
  def add_price(payload)
16
- @http.post_model("/products/add_price", Inttegro::Models::AddProductPriceResponse, payload)
16
+ @http.post_resource("/products/add_price", Inttegro::ProductPriceNominal, :price, payload)
17
17
  end
18
18
 
19
19
  def set_default_unit_price(payload)
20
- @http.post_model("/products/set_default_unit_price", Inttegro::Models::ProductResponse, payload)
20
+ @http.post_resource("/products/set_default_unit_price", Inttegro::Product, :product, payload)
21
21
  end
22
22
 
23
23
  def lookup(product_id:)
24
- @http.post_model("/products/lookup", Inttegro::Models::ProductResponse, { product_id: product_id })
24
+ @http.post_resource("/products/lookup", Inttegro::Product, :product, { product_id: product_id })
25
25
  end
26
26
 
27
27
  def update(payload)
28
- @http.post_model("/products/update", Inttegro::Models::UpdateProductResponse, payload)
28
+ @http.post_resource("/products/update", Inttegro::UpdatedProduct, :product, payload)
29
29
  end
30
30
 
31
31
  def publish(product_id:)
32
- @http.post_model("/products/publish", Inttegro::Models::ProductResponse, { product_id: product_id })
32
+ @http.post_resource("/products/publish", Inttegro::Product, :product, { product_id: product_id })
33
33
  end
34
34
 
35
35
  def unpublish(product_id:)
36
- @http.post_model("/products/unpublish", Inttegro::Models::ProductResponse, { product_id: product_id })
36
+ @http.post_resource("/products/unpublish", Inttegro::Product, :product, { product_id: product_id })
37
37
  end
38
38
 
39
39
  def archive(product_id:)
40
- @http.post_model("/products/archive", Inttegro::Models::ProductResponse, { product_id: product_id })
40
+ @http.post_resource("/products/archive", Inttegro::Product, :product, { product_id: product_id })
41
41
  end
42
42
 
43
43
  def page(payload = {})
44
- @http.post_model("/products/page", Inttegro::Models::PageProductsResponse, payload || {})
44
+ @http.post_resource("/products/page", Inttegro::ProductPage, :page, payload || {})
45
45
  end
46
46
  end
47
47
  end
@@ -9,33 +9,33 @@ module Inttegro
9
9
  end
10
10
 
11
11
  def create(payload)
12
- @http.post_model("/purchase_intents/create", Inttegro::Models::PurchaseIntentResponse, payload)
12
+ @http.post_resource("/purchase_intents/create", Inttegro::PurchaseIntent, :purchase_intent, payload)
13
13
  end
14
14
 
15
15
  def update(payload)
16
- @http.post_model("/purchase_intents/update", Inttegro::Models::PurchaseIntentResponse, payload)
16
+ @http.post_resource("/purchase_intents/update", Inttegro::PurchaseIntent, :purchase_intent, payload)
17
17
  end
18
18
 
19
19
  def cancel(id:)
20
- @http.post_model(
20
+ @http.post_resource(
21
21
  "/purchase_intents/cancel",
22
- Inttegro::Models::PurchaseIntentResponse,
22
+ Inttegro::PurchaseIntent, :purchase_intent,
23
23
  { id: id }
24
24
  )
25
25
  end
26
26
 
27
27
  def lookup(id:)
28
- @http.post_model(
28
+ @http.post_resource(
29
29
  "/purchase_intents/lookup",
30
- Inttegro::Models::PurchaseIntentResponse,
30
+ Inttegro::PurchaseIntent, :purchase_intent,
31
31
  { id: id }
32
32
  )
33
33
  end
34
34
 
35
35
  def page(payload = {})
36
- @http.post_model(
36
+ @http.post_resource(
37
37
  "/purchase_intents/page",
38
- Inttegro::Models::PagePurchaseIntentsResponse,
38
+ Inttegro::PurchaseIntentPage, :page,
39
39
  payload || {}
40
40
  )
41
41
  end
@@ -9,27 +9,27 @@ module Inttegro
9
9
  end
10
10
 
11
11
  def create(payload)
12
- @http.post_model("/refunds/create", Inttegro::Models::RefundResponse, payload)
12
+ @http.post_resource("/refunds/create", Inttegro::Refund, :refund, payload)
13
13
  end
14
14
 
15
15
  def cancel(refund_id:)
16
- @http.post_model(
16
+ @http.post_resource(
17
17
  "/refunds/cancel",
18
- Inttegro::Models::RefundResponse,
18
+ Inttegro::Refund, :refund,
19
19
  { refund_id: refund_id }
20
20
  )
21
21
  end
22
22
 
23
23
  def lookup(refund_id:)
24
- @http.post_model(
24
+ @http.post_resource(
25
25
  "/refunds/lookup",
26
- Inttegro::Models::RefundResponse,
26
+ Inttegro::Refund, :refund,
27
27
  { refund_id: refund_id }
28
28
  )
29
29
  end
30
30
 
31
31
  def page(payload)
32
- @http.post_model("/refunds/page", Inttegro::Models::RefundPageResponse, payload)
32
+ @http.post_resource("/refunds/page", Inttegro::RefundPage, :page, payload)
33
33
  end
34
34
  end
35
35
  end
@@ -9,17 +9,17 @@ module Inttegro
9
9
  end
10
10
 
11
11
  def lookup(schedule_id:)
12
- @http.post_model(
12
+ @http.post_resource(
13
13
  "/schedules/lookup",
14
- Inttegro::Models::ScheduleLookupResponse,
14
+ Inttegro::ScheduleDetail, :scheduled_chime,
15
15
  { schedule_id: schedule_id }
16
16
  )
17
17
  end
18
18
 
19
19
  def cancel(schedule_id:)
20
- @http.post_model(
20
+ @http.post_resource(
21
21
  "/schedules/cancel",
22
- Inttegro::Models::ScheduleCancelResponse,
22
+ Inttegro::ScheduleCancelDetail, :scheduled_chime,
23
23
  { schedule_id: schedule_id }
24
24
  )
25
25
  end
@@ -9,7 +9,7 @@ module Inttegro
9
9
  end
10
10
 
11
11
  def countries
12
- @http.post_model("/spec/countries", Inttegro::Models::ListCountrySpecsResponse, {})
12
+ @http.post_model("/spec/countries", Inttegro::CountrySpecifications, {})
13
13
  end
14
14
  end
15
15
  end
@@ -9,39 +9,39 @@ module Inttegro
9
9
  end
10
10
 
11
11
  def create(payload, idempotency_key: nil)
12
- @http.post_model(
12
+ @http.post_resource(
13
13
  "/upload_requests/create",
14
- Inttegro::Models::UploadRequestResponse,
14
+ Inttegro::UploadRequest, :upload_request,
15
15
  payload,
16
16
  headers: headers(idempotency_key)
17
17
  )
18
18
  end
19
19
 
20
20
  def lookup(id:)
21
- @http.post_model(
21
+ @http.post_resource(
22
22
  "/upload_requests/lookup",
23
- Inttegro::Models::UploadRequestWithAttemptResponse,
23
+ Inttegro::UploadRequestDetails, :upload_request,
24
24
  { id: id }
25
25
  )
26
26
  end
27
27
 
28
28
  def page(payload = {})
29
- @http.post_model("/upload_requests/page", Inttegro::Models::UploadRequestPageResponse, payload || {})
29
+ @http.post_resource("/upload_requests/page", Inttegro::UploadRequestPage, :page, payload || {})
30
30
  end
31
31
 
32
32
  def cancel(payload, idempotency_key: nil)
33
- @http.post_model(
33
+ @http.post_resource(
34
34
  "/upload_requests/cancel",
35
- Inttegro::Models::UploadRequestResponse,
35
+ Inttegro::UploadRequest, :upload_request,
36
36
  payload,
37
37
  headers: headers(idempotency_key)
38
38
  )
39
39
  end
40
40
 
41
41
  def review(payload, idempotency_key: nil)
42
- @http.post_model(
42
+ @http.post_resource(
43
43
  "/upload_requests/review",
44
- Inttegro::Models::UploadRequestWithAttemptResponse,
44
+ Inttegro::UploadRequestDetails, :upload_request,
45
45
  payload,
46
46
  headers: headers(idempotency_key)
47
47
  )
@@ -50,7 +50,7 @@ module Inttegro
50
50
  def fulfill(upload_url:, file:)
51
51
  @http.post_multipart_model(
52
52
  upload_url,
53
- Inttegro::Models::FulfillUploadRequestResponse,
53
+ Inttegro::UploadFulfillment,
54
54
  files: { file: file },
55
55
  authenticated: false
56
56
  )
@@ -30,7 +30,7 @@ module Inttegro
30
30
 
31
31
  sig { params(klass: T::Class[T::Struct]).returns(T::Struct) }
32
32
  def deserialize(klass)
33
- Inttegro::Models.deserialize(to_h, klass)
33
+ Inttegro.deserialize(to_h, klass)
34
34
  end
35
35
 
36
36
  sig { params(name: Symbol, include_private: T::Boolean).returns(T::Boolean) }
@@ -2,5 +2,5 @@
2
2
  # typed: strict
3
3
 
4
4
  module Inttegro
5
- VERSION = "1.0.0"
5
+ VERSION = "3.0.0"
6
6
  end
data/lib/inttegro.rb CHANGED
@@ -11,4 +11,19 @@ require_relative "inttegro/models"
11
11
  require_relative "inttegro/version"
12
12
 
13
13
  module Inttegro
14
+ wire_constants = Operations::RESPONSE_MODELS.values.filter_map do |model|
15
+ name = model.name&.split("::")&.last
16
+ name.to_sym if name&.match?(/Response|Envelope/)
17
+ end
18
+ additional_wire_constants = %i[
19
+ ErrorEnvelope
20
+ FileServiceHealthResponse
21
+ FileServiceReadyResponse
22
+ PageFinancialAccountsResponse
23
+ ResponseObject
24
+ TransportResponse
25
+ ]
26
+ (wire_constants + additional_wire_constants).uniq.each do |name|
27
+ private_constant(name) if const_defined?(name, false)
28
+ end
14
29
  end