schematichq 1.4.16 → 1.5.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 (132) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +4 -4
  3. data/.fern/replay.lock +21 -3
  4. data/.fernignore +1 -0
  5. data/CONTRIBUTING.md +2 -2
  6. data/README.md +23 -0
  7. data/WASM_VERSION +1 -1
  8. data/lib/schematic/accesstokens/client.rb +1 -1
  9. data/lib/schematic/accounts/client.rb +21 -21
  10. data/lib/schematic/accounts/types/update_onboarding_state_request_body.rb +2 -0
  11. data/lib/schematic/billing/client.rb +120 -24
  12. data/lib/schematic/billing/types/create_billing_subscription_request_body.rb +2 -0
  13. data/lib/schematic/billing/types/list_company_billing_profiles_params.rb +20 -0
  14. data/lib/schematic/billing/types/list_company_billing_profiles_request.rb +19 -0
  15. data/lib/schematic/billing/types/list_company_billing_profiles_response.rb +13 -0
  16. data/lib/schematic/billing/types/update_company_billing_profile_request_body.rb +23 -0
  17. data/lib/schematic/billing/types/update_company_billing_profile_response.rb +13 -0
  18. data/lib/schematic/catalogs/client.rb +10 -10
  19. data/lib/schematic/checkout/client.rb +9 -9
  20. data/lib/schematic/client.rb +1 -1
  21. data/lib/schematic/companies/client.rb +43 -43
  22. data/lib/schematic/components/client.rb +8 -8
  23. data/lib/schematic/componentspublic/client.rb +1 -1
  24. data/lib/schematic/credits/client.rb +372 -41
  25. data/lib/schematic/credits/types/count_credit_spend_policies_params.rb +24 -0
  26. data/lib/schematic/credits/types/count_credit_spend_policies_request.rb +23 -0
  27. data/lib/schematic/credits/types/count_credit_spend_policies_response.rb +13 -0
  28. data/lib/schematic/credits/types/create_company_credit_grant.rb +2 -0
  29. data/lib/schematic/credits/types/create_credit_spend_policy_request_body.rb +19 -0
  30. data/lib/schematic/credits/types/create_credit_spend_policy_response.rb +13 -0
  31. data/lib/schematic/credits/types/delete_credit_spend_policy_response.rb +13 -0
  32. data/lib/schematic/credits/types/get_credit_spend_policy_response.rb +13 -0
  33. data/lib/schematic/credits/types/list_credit_spend_policies_params.rb +24 -0
  34. data/lib/schematic/credits/types/list_credit_spend_policies_request.rb +23 -0
  35. data/lib/schematic/credits/types/list_credit_spend_policies_response.rb +13 -0
  36. data/lib/schematic/credits/types/release_credit_reservation_response.rb +13 -0
  37. data/lib/schematic/credits/types/reserve_credits_request_body.rb +19 -0
  38. data/lib/schematic/credits/types/reserve_credits_response.rb +13 -0
  39. data/lib/schematic/credits/types/update_credit_spend_policy_request_body.rb +15 -0
  40. data/lib/schematic/credits/types/update_credit_spend_policy_response.rb +13 -0
  41. data/lib/schematic/dataexports/client.rb +3 -3
  42. data/lib/schematic/datastream/client.rb +5 -2
  43. data/lib/schematic/datastream/resource_cache.rb +2 -4
  44. data/lib/schematic/datastream/websocket_client.rb +59 -1
  45. data/lib/schematic/entitlements/client.rb +25 -25
  46. data/lib/schematic/events/client.rb +107 -6
  47. data/lib/schematic/events/types/delete_otlp_environment_settings_response.rb +13 -0
  48. data/lib/schematic/events/types/get_otlp_environment_settings_response.rb +13 -0
  49. data/lib/schematic/events/types/upsert_otlp_environment_settings_request_body.rb +19 -0
  50. data/lib/schematic/events/types/upsert_otlp_environment_settings_response.rb +13 -0
  51. data/lib/schematic/features/client.rb +57 -17
  52. data/lib/schematic/features/types/check_and_reserve_flag_request_body.rb +21 -0
  53. data/lib/schematic/features/types/check_and_reserve_flag_response.rb +13 -0
  54. data/lib/schematic/insights/client.rb +6 -6
  55. data/lib/schematic/integrationsapi/client.rb +178 -9
  56. data/lib/schematic/integrationsapi/types/claim_stripe_sandbox_keys_request_body.rb +11 -0
  57. data/lib/schematic/integrationsapi/types/claim_stripe_sandbox_keys_response.rb +13 -0
  58. data/lib/schematic/integrationsapi/types/get_stripe_sandbox_claim_link_response.rb +13 -0
  59. data/lib/schematic/integrationsapi/types/get_stripe_sandbox_keys_response.rb +13 -0
  60. data/lib/schematic/integrationsapi/types/install_stripe_claimable_sandbox_response.rb +13 -0
  61. data/lib/schematic/integrationsapi/types/install_stripe_sandbox_request_body.rb +17 -0
  62. data/lib/schematic/integrationsapi/types/list_stripe_sandbox_countries_response.rb +13 -0
  63. data/lib/schematic/internal/multipart/multipart_form_data.rb +8 -3
  64. data/lib/schematic/internal/types/model.rb +14 -6
  65. data/lib/schematic/licenses/client.rb +3 -3
  66. data/lib/schematic/planbundle/client.rb +3 -3
  67. data/lib/schematic/plangroups/client.rb +3 -3
  68. data/lib/schematic/plangroups/types/create_plan_group_request_body.rb +2 -0
  69. data/lib/schematic/plangroups/types/update_plan_group_request_body.rb +2 -0
  70. data/lib/schematic/planmigrations/client.rb +11 -11
  71. data/lib/schematic/plans/client.rb +24 -18
  72. data/lib/schematic/plans/types/count_plans_params.rb +2 -0
  73. data/lib/schematic/plans/types/count_plans_request.rb +2 -0
  74. data/lib/schematic/plans/types/list_plans_params.rb +2 -0
  75. data/lib/schematic/plans/types/list_plans_request.rb +2 -0
  76. data/lib/schematic/scheduledcheckout/client.rb +4 -4
  77. data/lib/schematic/schematic_client.rb +15 -2
  78. data/lib/schematic/types/billing_arrears_anchor.rb +12 -0
  79. data/lib/schematic/types/billing_arrears_cadence.rb +12 -0
  80. data/lib/schematic/types/billing_credit_grant_response_data.rb +8 -0
  81. data/lib/schematic/types/billing_plan_credit_grant_response_data.rb +12 -0
  82. data/lib/schematic/types/check_and_reserve_flag_response_data.rb +39 -0
  83. data/lib/schematic/types/checkout_data_response_data.rb +4 -0
  84. data/lib/schematic/types/claimed_stripe_sandbox_keys_response_data.rb +13 -0
  85. data/lib/schematic/types/company_billing_profile_response_data.rb +35 -0
  86. data/lib/schematic/types/company_detail_response_data.rb +4 -0
  87. data/lib/schematic/types/company_override_response_data.rb +4 -0
  88. data/lib/schematic/types/company_plan_credit_grant_view.rb +12 -0
  89. data/lib/schematic/types/create_billing_plan_credit_grant_request_body.rb +12 -0
  90. data/lib/schematic/types/credit_company_grant_view.rb +14 -0
  91. data/lib/schematic/types/credit_reservation_response_data.rb +25 -0
  92. data/lib/schematic/types/credit_spend_policy_response_data.rb +25 -0
  93. data/lib/schematic/types/credit_spend_policy_scope.rb +13 -0
  94. data/lib/schematic/types/credit_usage_reason.rb +2 -0
  95. data/lib/schematic/types/event_body_inference.rb +2 -0
  96. data/lib/schematic/types/event_body_track.rb +2 -0
  97. data/lib/schematic/types/event_detail_response_data.rb +2 -0
  98. data/lib/schematic/types/event_response_data.rb +2 -0
  99. data/lib/schematic/types/flag_check_reservation_response_data.rb +23 -0
  100. data/lib/schematic/types/get_onboarding_state_resp.rb +6 -0
  101. data/lib/schematic/types/issue_temporary_access_token_response_data.rb +3 -1
  102. data/lib/schematic/types/onboarding_requirement.rb +1 -0
  103. data/lib/schematic/types/onboarding_roadmap_view.rb +11 -0
  104. data/lib/schematic/types/otlp_environment_settings_response_data.rb +23 -0
  105. data/lib/schematic/types/plan_credit_grant_view.rb +12 -0
  106. data/lib/schematic/types/plan_group_detail_response_data.rb +2 -0
  107. data/lib/schematic/types/plan_group_response_data.rb +2 -0
  108. data/lib/schematic/types/rule_condition_detail_response_data.rb +2 -0
  109. data/lib/schematic/types/rule_condition_plan_version_response_data.rb +15 -0
  110. data/lib/schematic/types/rules_engine_schema_version.rb +1 -1
  111. data/lib/schematic/types/rulesengine_company.rb +2 -0
  112. data/lib/schematic/types/rulesengine_credit_postpaid_config.rb +9 -0
  113. data/lib/schematic/types/slack_connect_invite_status.rb +15 -0
  114. data/lib/schematic/types/slack_connect_invite_view.rb +15 -0
  115. data/lib/schematic/types/stripe_integration_config.rb +6 -0
  116. data/lib/schematic/types/stripe_sandbox_claim_link.rb +15 -0
  117. data/lib/schematic/types/stripe_sandbox_countries_response_data.rb +9 -0
  118. data/lib/schematic/types/stripe_sandbox_install_response_data.rb +21 -0
  119. data/lib/schematic/types/stripe_sandbox_keys_response_data.rb +13 -0
  120. data/lib/schematic/types/temporary_access_token_issuer_type.rb +12 -0
  121. data/lib/schematic/types/temporary_access_token_response_data.rb +3 -1
  122. data/lib/schematic/types/update_billing_plan_credit_grant_request_body.rb +12 -0
  123. data/lib/schematic/types/webhook_event_detail_response_data.rb +2 -0
  124. data/lib/schematic/types/webhook_event_response_data.rb +2 -0
  125. data/lib/schematic/version.rb +1 -1
  126. data/lib/schematic/wasm/rulesengine.wasm +0 -0
  127. data/lib/schematic/webhooks/client.rb +10 -10
  128. data/lib/schematic.rb +56 -4
  129. data/reference.md +1345 -44
  130. data/testapp/app.rb +13 -2
  131. metadata +55 -3
  132. data/lib/schematic/types/release_credit_lease_request_body.rb +0 -23
@@ -38,7 +38,7 @@ module Schematic
38
38
  end
39
39
  code = response.code.to_i
40
40
  if code.between?(200, 299)
41
- Schematic::Integrationsapi::Types::RunIntegrationResponse.load(response.body)
41
+ (response.body.to_s.empty? ? nil : Schematic::Integrationsapi::Types::RunIntegrationResponse.load(response.body))
42
42
  else
43
43
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
44
44
  raise error_class.new(response.body, code: code)
@@ -97,7 +97,7 @@ module Schematic
97
97
  end
98
98
  code = response.code.to_i
99
99
  if code.between?(200, 299)
100
- Schematic::Integrationsapi::Types::ListIntegrationsResponse.load(response.body)
100
+ (response.body.to_s.empty? ? nil : Schematic::Integrationsapi::Types::ListIntegrationsResponse.load(response.body))
101
101
  else
102
102
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
103
103
  raise error_class.new(response.body, code: code)
@@ -132,7 +132,7 @@ module Schematic
132
132
  end
133
133
  code = response.code.to_i
134
134
  if code.between?(200, 299)
135
- Schematic::Integrationsapi::Types::GetIntegrationWebhookUrlResponse.load(response.body)
135
+ (response.body.to_s.empty? ? nil : Schematic::Integrationsapi::Types::GetIntegrationWebhookUrlResponse.load(response.body))
136
136
  else
137
137
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
138
138
  raise error_class.new(response.body, code: code)
@@ -167,7 +167,7 @@ module Schematic
167
167
  end
168
168
  code = response.code.to_i
169
169
  if code.between?(200, 299)
170
- Schematic::Integrationsapi::Types::InstallIntegrationResponse.load(response.body)
170
+ (response.body.to_s.empty? ? nil : Schematic::Integrationsapi::Types::InstallIntegrationResponse.load(response.body))
171
171
  else
172
172
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
173
173
  raise error_class.new(response.body, code: code)
@@ -202,7 +202,7 @@ module Schematic
202
202
  end
203
203
  code = response.code.to_i
204
204
  if code.between?(200, 299)
205
- Schematic::Integrationsapi::Types::StartDataImportResponse.load(response.body)
205
+ (response.body.to_s.empty? ? nil : Schematic::Integrationsapi::Types::StartDataImportResponse.load(response.body))
206
206
  else
207
207
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
208
208
  raise error_class.new(response.body, code: code)
@@ -235,7 +235,108 @@ module Schematic
235
235
  end
236
236
  code = response.code.to_i
237
237
  if code.between?(200, 299)
238
- Schematic::Integrationsapi::Types::LoadSampleDataSetResponse.load(response.body)
238
+ (response.body.to_s.empty? ? nil : Schematic::Integrationsapi::Types::LoadSampleDataSetResponse.load(response.body))
239
+ else
240
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
241
+ raise error_class.new(response.body, code: code)
242
+ end
243
+ end
244
+
245
+ # @param request_options [Hash]
246
+ # @param _params [Hash]
247
+ # @option request_options [String] :base_url
248
+ # @option request_options [Hash{String => Object}] :additional_headers
249
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
250
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
251
+ # @option request_options [Integer] :timeout_in_seconds
252
+ #
253
+ # @example
254
+ # client.integrationsapi.get_stripe_sandbox_claim_link
255
+ #
256
+ # @return [Schematic::Integrationsapi::Types::GetStripeSandboxClaimLinkResponse]
257
+ def get_stripe_sandbox_claim_link(request_options: {}, **_params)
258
+ request = Schematic::Internal::JSON::Request.new(
259
+ base_url: request_options[:base_url],
260
+ method: "GET",
261
+ path: "integrations/stripe/sandbox/claim-link",
262
+ request_options: request_options
263
+ )
264
+ begin
265
+ response = @client.send(request)
266
+ rescue Net::HTTPRequestTimeout
267
+ raise Schematic::Errors::TimeoutError
268
+ end
269
+ code = response.code.to_i
270
+ if code.between?(200, 299)
271
+ (response.body.to_s.empty? ? nil : Schematic::Integrationsapi::Types::GetStripeSandboxClaimLinkResponse.load(response.body))
272
+ else
273
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
274
+ raise error_class.new(response.body, code: code)
275
+ end
276
+ end
277
+
278
+ # @param request_options [Hash]
279
+ # @param _params [Hash]
280
+ # @option request_options [String] :base_url
281
+ # @option request_options [Hash{String => Object}] :additional_headers
282
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
283
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
284
+ # @option request_options [Integer] :timeout_in_seconds
285
+ #
286
+ # @example
287
+ # client.integrationsapi.get_stripe_sandbox_keys
288
+ #
289
+ # @return [Schematic::Integrationsapi::Types::GetStripeSandboxKeysResponse]
290
+ def get_stripe_sandbox_keys(request_options: {}, **_params)
291
+ request = Schematic::Internal::JSON::Request.new(
292
+ base_url: request_options[:base_url],
293
+ method: "GET",
294
+ path: "integrations/stripe/sandbox/keys",
295
+ request_options: request_options
296
+ )
297
+ begin
298
+ response = @client.send(request)
299
+ rescue Net::HTTPRequestTimeout
300
+ raise Schematic::Errors::TimeoutError
301
+ end
302
+ code = response.code.to_i
303
+ if code.between?(200, 299)
304
+ (response.body.to_s.empty? ? nil : Schematic::Integrationsapi::Types::GetStripeSandboxKeysResponse.load(response.body))
305
+ else
306
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
307
+ raise error_class.new(response.body, code: code)
308
+ end
309
+ end
310
+
311
+ # @param request_options [Hash]
312
+ # @param params [Schematic::Integrationsapi::Types::ClaimStripeSandboxKeysRequestBody]
313
+ # @option request_options [String] :base_url
314
+ # @option request_options [Hash{String => Object}] :additional_headers
315
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
316
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
317
+ # @option request_options [Integer] :timeout_in_seconds
318
+ #
319
+ # @example
320
+ # client.integrationsapi.claim_stripe_sandbox_keys(token: "token")
321
+ #
322
+ # @return [Schematic::Integrationsapi::Types::ClaimStripeSandboxKeysResponse]
323
+ def claim_stripe_sandbox_keys(request_options: {}, **params)
324
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
325
+ request = Schematic::Internal::JSON::Request.new(
326
+ base_url: request_options[:base_url],
327
+ method: "POST",
328
+ path: "integrations/stripe/sandbox/keys/claim",
329
+ body: Schematic::Integrationsapi::Types::ClaimStripeSandboxKeysRequestBody.new(params).to_h,
330
+ request_options: request_options
331
+ )
332
+ begin
333
+ response = @client.send(request)
334
+ rescue Net::HTTPRequestTimeout
335
+ raise Schematic::Errors::TimeoutError
336
+ end
337
+ code = response.code.to_i
338
+ if code.between?(200, 299)
339
+ (response.body.to_s.empty? ? nil : Schematic::Integrationsapi::Types::ClaimStripeSandboxKeysResponse.load(response.body))
239
340
  else
240
341
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
241
342
  raise error_class.new(response.body, code: code)
@@ -270,7 +371,7 @@ module Schematic
270
371
  end
271
372
  code = response.code.to_i
272
373
  if code.between?(200, 299)
273
- Schematic::Integrationsapi::Types::AssumeStripeInstalledResponse.load(response.body)
374
+ (response.body.to_s.empty? ? nil : Schematic::Integrationsapi::Types::AssumeStripeInstalledResponse.load(response.body))
274
375
  else
275
376
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
276
377
  raise error_class.new(response.body, code: code)
@@ -305,7 +406,75 @@ module Schematic
305
406
  end
306
407
  code = response.code.to_i
307
408
  if code.between?(200, 299)
308
- Schematic::Integrationsapi::Types::InstallStripeResponse.load(response.body)
409
+ (response.body.to_s.empty? ? nil : Schematic::Integrationsapi::Types::InstallStripeResponse.load(response.body))
410
+ else
411
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
412
+ raise error_class.new(response.body, code: code)
413
+ end
414
+ end
415
+
416
+ # @param request_options [Hash]
417
+ # @param params [Schematic::Integrationsapi::Types::InstallStripeSandboxRequestBody]
418
+ # @option request_options [String] :base_url
419
+ # @option request_options [Hash{String => Object}] :additional_headers
420
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
421
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
422
+ # @option request_options [Integer] :timeout_in_seconds
423
+ #
424
+ # @example
425
+ # client.integrationsapi.install_stripe_claimable_sandbox(email: "email")
426
+ #
427
+ # @return [Schematic::Integrationsapi::Types::InstallStripeClaimableSandboxResponse]
428
+ def install_stripe_claimable_sandbox(request_options: {}, **params)
429
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
430
+ request = Schematic::Internal::JSON::Request.new(
431
+ base_url: request_options[:base_url],
432
+ method: "POST",
433
+ path: "integrations/stripe/v2/sandbox",
434
+ body: Schematic::Integrationsapi::Types::InstallStripeSandboxRequestBody.new(params).to_h,
435
+ request_options: request_options
436
+ )
437
+ begin
438
+ response = @client.send(request)
439
+ rescue Net::HTTPRequestTimeout
440
+ raise Schematic::Errors::TimeoutError
441
+ end
442
+ code = response.code.to_i
443
+ if code.between?(200, 299)
444
+ (response.body.to_s.empty? ? nil : Schematic::Integrationsapi::Types::InstallStripeClaimableSandboxResponse.load(response.body))
445
+ else
446
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
447
+ raise error_class.new(response.body, code: code)
448
+ end
449
+ end
450
+
451
+ # @param request_options [Hash]
452
+ # @param _params [Hash]
453
+ # @option request_options [String] :base_url
454
+ # @option request_options [Hash{String => Object}] :additional_headers
455
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
456
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
457
+ # @option request_options [Integer] :timeout_in_seconds
458
+ #
459
+ # @example
460
+ # client.integrationsapi.list_stripe_sandbox_countries
461
+ #
462
+ # @return [Schematic::Integrationsapi::Types::ListStripeSandboxCountriesResponse]
463
+ def list_stripe_sandbox_countries(request_options: {}, **_params)
464
+ request = Schematic::Internal::JSON::Request.new(
465
+ base_url: request_options[:base_url],
466
+ method: "GET",
467
+ path: "integrations/stripe/v2/sandbox-countries",
468
+ request_options: request_options
469
+ )
470
+ begin
471
+ response = @client.send(request)
472
+ rescue Net::HTTPRequestTimeout
473
+ raise Schematic::Errors::TimeoutError
474
+ end
475
+ code = response.code.to_i
476
+ if code.between?(200, 299)
477
+ (response.body.to_s.empty? ? nil : Schematic::Integrationsapi::Types::ListStripeSandboxCountriesResponse.load(response.body))
309
478
  else
310
479
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
311
480
  raise error_class.new(response.body, code: code)
@@ -340,7 +509,7 @@ module Schematic
340
509
  end
341
510
  code = response.code.to_i
342
511
  if code.between?(200, 299)
343
- Schematic::Integrationsapi::Types::UninstallIntegrationResponse.load(response.body)
512
+ (response.body.to_s.empty? ? nil : Schematic::Integrationsapi::Types::UninstallIntegrationResponse.load(response.body))
344
513
  else
345
514
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
346
515
  raise error_class.new(response.body, code: code)
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Integrationsapi
5
+ module Types
6
+ class ClaimStripeSandboxKeysRequestBody < Internal::Types::Model
7
+ field :token, -> { String }, optional: false, nullable: false
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Integrationsapi
5
+ module Types
6
+ class ClaimStripeSandboxKeysResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::ClaimedStripeSandboxKeysResponseData }, optional: false, nullable: false
8
+
9
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Integrationsapi
5
+ module Types
6
+ class GetStripeSandboxClaimLinkResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::StripeSandboxClaimLink }, optional: false, nullable: false
8
+
9
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Integrationsapi
5
+ module Types
6
+ class GetStripeSandboxKeysResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::ClaimedStripeSandboxKeysResponseData }, optional: false, nullable: false
8
+
9
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Integrationsapi
5
+ module Types
6
+ class InstallStripeClaimableSandboxResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::StripeSandboxInstallResponseData }, optional: false, nullable: false
8
+
9
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Integrationsapi
5
+ module Types
6
+ class InstallStripeSandboxRequestBody < Internal::Types::Model
7
+ field :country, -> { String }, optional: true, nullable: false
8
+
9
+ field :email, -> { String }, optional: false, nullable: false
10
+
11
+ field :name, -> { String }, optional: true, nullable: false
12
+
13
+ field :seed_sample_data, -> { Internal::Types::Boolean }, optional: true, nullable: false
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Integrationsapi
5
+ module Types
6
+ class ListStripeSandboxCountriesResponse < Internal::Types::Model
7
+ field :data, -> { Schematic::Types::StripeSandboxCountriesResponseData }, optional: false, nullable: false
8
+
9
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -30,13 +30,18 @@ module Schematic
30
30
  # Adds a file to the multipart form data.
31
31
  #
32
32
  # @param name [String] The name of the form field
33
- # @param file [#read] The file or readable object
34
- # @param filename [String, nil] Optional filename (defaults to basename of path for File objects)
33
+ # @param file [String, #read] A path to a file on disk, or a file/readable object
34
+ # @param filename [String, nil] Optional filename (defaults to basename of the path for paths and File objects)
35
35
  # @param content_type [String, nil] Optional content type (e.g. "image/png")
36
36
  # @return [self] Returns self for chaining
37
37
  def add_file(name:, file:, filename: nil, content_type: nil)
38
38
  headers = content_type ? { "Content-Type" => content_type } : nil
39
- filename ||= filename_for(file)
39
+ if file.is_a?(::String)
40
+ filename ||= ::File.basename(file)
41
+ file = ::File.binread(file)
42
+ else
43
+ filename ||= filename_for(file)
44
+ end
40
45
  add_part(FormDataPart.new(name:, value: file, filename:, headers:))
41
46
  end
42
47
 
@@ -141,13 +141,21 @@ module Schematic
141
141
  values = Utils.symbolize_keys(values.dup)
142
142
 
143
143
  self.class.fields.each do |field_name, field|
144
- value = values.delete(field.api_name.to_sym) || values.delete(field.api_name) || values.delete(field_name)
144
+ value = nil
145
+ [field.api_name.to_sym, field_name].uniq.each do |key|
146
+ next unless values.key?(key)
145
147
 
146
- field_value = value || (if field.literal?
147
- field.value
148
- elsif field.default
149
- field.default
150
- end)
148
+ candidate = values.delete(key)
149
+ value = candidate if value.nil?
150
+ end
151
+
152
+ field_value = if !value.nil?
153
+ value
154
+ elsif field.literal?
155
+ field.value
156
+ elsif !field.default.nil?
157
+ field.default
158
+ end
151
159
 
152
160
  @data[field_name] = Utils.coerce(field.type, field_value)
153
161
  end
@@ -56,7 +56,7 @@ module Schematic
56
56
  end
57
57
  code = response.code.to_i
58
58
  if code.between?(200, 299)
59
- Schematic::Licenses::Types::ListLicensesResponse.load(response.body)
59
+ (response.body.to_s.empty? ? nil : Schematic::Licenses::Types::ListLicensesResponse.load(response.body))
60
60
  else
61
61
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
62
62
  raise error_class.new(response.body, code: code)
@@ -91,7 +91,7 @@ module Schematic
91
91
  end
92
92
  code = response.code.to_i
93
93
  if code.between?(200, 299)
94
- Schematic::Licenses::Types::GetSingleLicenseResponse.load(response.body)
94
+ (response.body.to_s.empty? ? nil : Schematic::Licenses::Types::GetSingleLicenseResponse.load(response.body))
95
95
  else
96
96
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
97
97
  raise error_class.new(response.body, code: code)
@@ -144,7 +144,7 @@ module Schematic
144
144
  end
145
145
  code = response.code.to_i
146
146
  if code.between?(200, 299)
147
- Schematic::Licenses::Types::CountLicensesResponse.load(response.body)
147
+ (response.body.to_s.empty? ? nil : Schematic::Licenses::Types::CountLicensesResponse.load(response.body))
148
148
  else
149
149
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
150
150
  raise error_class.new(response.body, code: code)
@@ -50,7 +50,7 @@ module Schematic
50
50
  end
51
51
  code = response.code.to_i
52
52
  if code.between?(200, 299)
53
- Schematic::Planbundle::Types::CreateCustomPlanBundleResponse.load(response.body)
53
+ (response.body.to_s.empty? ? nil : Schematic::Planbundle::Types::CreateCustomPlanBundleResponse.load(response.body))
54
54
  else
55
55
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
56
56
  raise error_class.new(response.body, code: code)
@@ -93,7 +93,7 @@ module Schematic
93
93
  end
94
94
  code = response.code.to_i
95
95
  if code.between?(200, 299)
96
- Schematic::Planbundle::Types::CreatePlanBundleResponse.load(response.body)
96
+ (response.body.to_s.empty? ? nil : Schematic::Planbundle::Types::CreatePlanBundleResponse.load(response.body))
97
97
  else
98
98
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
99
99
  raise error_class.new(response.body, code: code)
@@ -141,7 +141,7 @@ module Schematic
141
141
  end
142
142
  code = response.code.to_i
143
143
  if code.between?(200, 299)
144
- Schematic::Planbundle::Types::UpdatePlanBundleResponse.load(response.body)
144
+ (response.body.to_s.empty? ? nil : Schematic::Planbundle::Types::UpdatePlanBundleResponse.load(response.body))
145
145
  else
146
146
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
147
147
  raise error_class.new(response.body, code: code)
@@ -42,7 +42,7 @@ module Schematic
42
42
  end
43
43
  code = response.code.to_i
44
44
  if code.between?(200, 299)
45
- Schematic::Plangroups::Types::GetPlanGroupResponse.load(response.body)
45
+ (response.body.to_s.empty? ? nil : Schematic::Plangroups::Types::GetPlanGroupResponse.load(response.body))
46
46
  else
47
47
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
48
48
  raise error_class.new(response.body, code: code)
@@ -104,7 +104,7 @@ module Schematic
104
104
  end
105
105
  code = response.code.to_i
106
106
  if code.between?(200, 299)
107
- Schematic::Plangroups::Types::CreatePlanGroupResponse.load(response.body)
107
+ (response.body.to_s.empty? ? nil : Schematic::Plangroups::Types::CreatePlanGroupResponse.load(response.body))
108
108
  else
109
109
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
110
110
  raise error_class.new(response.body, code: code)
@@ -172,7 +172,7 @@ module Schematic
172
172
  end
173
173
  code = response.code.to_i
174
174
  if code.between?(200, 299)
175
- Schematic::Plangroups::Types::UpdatePlanGroupResponse.load(response.body)
175
+ (response.body.to_s.empty? ? nil : Schematic::Plangroups::Types::UpdatePlanGroupResponse.load(response.body))
176
176
  else
177
177
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
178
178
  raise error_class.new(response.body, code: code)
@@ -74,6 +74,8 @@ module Schematic
74
74
 
75
75
  field :trial_days, -> { Integer }, optional: true, nullable: false
76
76
 
77
+ field :trial_eligibility_per_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
78
+
77
79
  field :trial_expiry_plan_id, -> { String }, optional: true, nullable: false
78
80
 
79
81
  field :trial_expiry_plan_price_id, -> { String }, optional: true, nullable: false
@@ -76,6 +76,8 @@ module Schematic
76
76
 
77
77
  field :trial_days, -> { Integer }, optional: true, nullable: false
78
78
 
79
+ field :trial_eligibility_per_plan, -> { Internal::Types::Boolean }, optional: true, nullable: false
80
+
79
81
  field :trial_expiry_plan_id, -> { String }, optional: true, nullable: false
80
82
 
81
83
  field :trial_expiry_plan_price_id, -> { String }, optional: true, nullable: false
@@ -56,7 +56,7 @@ module Schematic
56
56
  end
57
57
  code = response.code.to_i
58
58
  if code.between?(200, 299)
59
- Schematic::Planmigrations::Types::ListCompanyMigrationsResponse.load(response.body)
59
+ (response.body.to_s.empty? ? nil : Schematic::Planmigrations::Types::ListCompanyMigrationsResponse.load(response.body))
60
60
  else
61
61
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
62
62
  raise error_class.new(response.body, code: code)
@@ -91,7 +91,7 @@ module Schematic
91
91
  end
92
92
  code = response.code.to_i
93
93
  if code.between?(200, 299)
94
- Schematic::Planmigrations::Types::RetryCompanyMigrationResponse.load(response.body)
94
+ (response.body.to_s.empty? ? nil : Schematic::Planmigrations::Types::RetryCompanyMigrationResponse.load(response.body))
95
95
  else
96
96
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
97
97
  raise error_class.new(response.body, code: code)
@@ -144,7 +144,7 @@ module Schematic
144
144
  end
145
145
  code = response.code.to_i
146
146
  if code.between?(200, 299)
147
- Schematic::Planmigrations::Types::CountCompanyMigrationsResponse.load(response.body)
147
+ (response.body.to_s.empty? ? nil : Schematic::Planmigrations::Types::CountCompanyMigrationsResponse.load(response.body))
148
148
  else
149
149
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
150
150
  raise error_class.new(response.body, code: code)
@@ -194,7 +194,7 @@ module Schematic
194
194
  end
195
195
  code = response.code.to_i
196
196
  if code.between?(200, 299)
197
- Schematic::Planmigrations::Types::ListMigrationsResponse.load(response.body)
197
+ (response.body.to_s.empty? ? nil : Schematic::Planmigrations::Types::ListMigrationsResponse.load(response.body))
198
198
  else
199
199
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
200
200
  raise error_class.new(response.body, code: code)
@@ -234,7 +234,7 @@ module Schematic
234
234
  end
235
235
  code = response.code.to_i
236
236
  if code.between?(200, 299)
237
- Schematic::Planmigrations::Types::CreateMigrationResponse.load(response.body)
237
+ (response.body.to_s.empty? ? nil : Schematic::Planmigrations::Types::CreateMigrationResponse.load(response.body))
238
238
  else
239
239
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
240
240
  raise error_class.new(response.body, code: code)
@@ -269,7 +269,7 @@ module Schematic
269
269
  end
270
270
  code = response.code.to_i
271
271
  if code.between?(200, 299)
272
- Schematic::Planmigrations::Types::GetMigrationResponse.load(response.body)
272
+ (response.body.to_s.empty? ? nil : Schematic::Planmigrations::Types::GetMigrationResponse.load(response.body))
273
273
  else
274
274
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
275
275
  raise error_class.new(response.body, code: code)
@@ -304,7 +304,7 @@ module Schematic
304
304
  end
305
305
  code = response.code.to_i
306
306
  if code.between?(200, 299)
307
- Schematic::Planmigrations::Types::CancelMigrationResponse.load(response.body)
307
+ (response.body.to_s.empty? ? nil : Schematic::Planmigrations::Types::CancelMigrationResponse.load(response.body))
308
308
  else
309
309
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
310
310
  raise error_class.new(response.body, code: code)
@@ -344,7 +344,7 @@ module Schematic
344
344
  end
345
345
  code = response.code.to_i
346
346
  if code.between?(200, 299)
347
- Schematic::Planmigrations::Types::CompleteMigrationNowResponse.load(response.body)
347
+ (response.body.to_s.empty? ? nil : Schematic::Planmigrations::Types::CompleteMigrationNowResponse.load(response.body))
348
348
  else
349
349
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
350
350
  raise error_class.new(response.body, code: code)
@@ -387,7 +387,7 @@ module Schematic
387
387
  end
388
388
  code = response.code.to_i
389
389
  if code.between?(200, 299)
390
- Schematic::Planmigrations::Types::RetryMigrationResponse.load(response.body)
390
+ (response.body.to_s.empty? ? nil : Schematic::Planmigrations::Types::RetryMigrationResponse.load(response.body))
391
391
  else
392
392
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
393
393
  raise error_class.new(response.body, code: code)
@@ -437,7 +437,7 @@ module Schematic
437
437
  end
438
438
  code = response.code.to_i
439
439
  if code.between?(200, 299)
440
- Schematic::Planmigrations::Types::CountMigrationsResponse.load(response.body)
440
+ (response.body.to_s.empty? ? nil : Schematic::Planmigrations::Types::CountMigrationsResponse.load(response.body))
441
441
  else
442
442
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
443
443
  raise error_class.new(response.body, code: code)
@@ -476,7 +476,7 @@ module Schematic
476
476
  end
477
477
  code = response.code.to_i
478
478
  if code.between?(200, 299)
479
- Schematic::Planmigrations::Types::PreviewMigrationResponse.load(response.body)
479
+ (response.body.to_s.empty? ? nil : Schematic::Planmigrations::Types::PreviewMigrationResponse.load(response.body))
480
480
  else
481
481
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
482
482
  raise error_class.new(response.body, code: code)