schematichq 1.5.7 → 1.5.8

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 (121) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +4 -4
  3. data/.fern/replay.lock +7 -1
  4. data/lib/schematic/accesstokens/client.rb +1 -1
  5. data/lib/schematic/accounts/client.rb +15 -15
  6. data/lib/schematic/billing/client.rb +432 -37
  7. data/lib/schematic/billing/types/charge_native_invoice_response.rb +15 -0
  8. data/lib/schematic/billing/types/create_billing_subscription_request_body.rb +4 -0
  9. data/lib/schematic/billing/types/delete_contract_document_response.rb +15 -0
  10. data/lib/schematic/billing/types/get_company_contract_response.rb +15 -0
  11. data/lib/schematic/billing/types/get_company_upcoming_invoices_response.rb +15 -0
  12. data/lib/schematic/billing/types/move_to_default_plan_response.rb +15 -0
  13. data/lib/schematic/billing/types/reissue_native_invoice_link_response.rb +15 -0
  14. data/lib/schematic/billing/types/revoke_native_invoice_link_response.rb +15 -0
  15. data/lib/schematic/billing/types/update_billing_settings_request_body.rb +4 -0
  16. data/lib/schematic/billing/types/update_company_billing_profile_request_body.rb +6 -0
  17. data/lib/schematic/billing/types/upload_contract_document_request.rb +11 -0
  18. data/lib/schematic/billing/types/upload_contract_document_response.rb +15 -0
  19. data/lib/schematic/catalogs/client.rb +16 -16
  20. data/lib/schematic/catalogs/types/update_catalog_configuration_request_body.rb +2 -0
  21. data/lib/schematic/checkout/client.rb +98 -9
  22. data/lib/schematic/checkout/types/pause_subscription_request.rb +15 -0
  23. data/lib/schematic/checkout/types/pause_subscription_response.rb +15 -0
  24. data/lib/schematic/checkout/types/resume_subscription_request.rb +13 -0
  25. data/lib/schematic/checkout/types/resume_subscription_response.rb +15 -0
  26. data/lib/schematic/client.rb +7 -196
  27. data/lib/schematic/companies/client.rb +140 -44
  28. data/lib/schematic/companies/types/get_billing_entity_settings_response.rb +15 -0
  29. data/lib/schematic/companies/types/list_users_params.rb +4 -0
  30. data/lib/schematic/companies/types/list_users_request.rb +4 -0
  31. data/lib/schematic/companies/types/update_billing_entity_settings_request_body.rb +13 -0
  32. data/lib/schematic/companies/types/update_billing_entity_settings_response.rb +15 -0
  33. data/lib/schematic/components/client.rb +8 -8
  34. data/lib/schematic/componentspublic/client.rb +1 -1
  35. data/lib/schematic/credits/client.rb +41 -41
  36. data/lib/schematic/customplangrouprollouts/client.rb +258 -0
  37. data/lib/schematic/customplangrouprollouts/types/copy_custom_plan_request_body.rb +15 -0
  38. data/lib/schematic/customplangrouprollouts/types/copy_custom_plan_response.rb +15 -0
  39. data/lib/schematic/customplangrouprollouts/types/get_group_rollout_response.rb +15 -0
  40. data/lib/schematic/customplangrouprollouts/types/list_group_rollouts_params.rb +14 -0
  41. data/lib/schematic/customplangrouprollouts/types/list_group_rollouts_request.rb +11 -0
  42. data/lib/schematic/customplangrouprollouts/types/list_group_rollouts_response.rb +15 -0
  43. data/lib/schematic/customplangrouprollouts/types/preview_group_rollout_params.rb +16 -0
  44. data/lib/schematic/customplangrouprollouts/types/preview_group_rollout_request.rb +15 -0
  45. data/lib/schematic/customplangrouprollouts/types/preview_group_rollout_response.rb +15 -0
  46. data/lib/schematic/customplangrouprollouts/types/start_group_rollout_request_body.rb +17 -0
  47. data/lib/schematic/customplangrouprollouts/types/start_group_rollout_response.rb +15 -0
  48. data/lib/schematic/dataexports/client.rb +4 -4
  49. data/lib/schematic/entitlements/client.rb +28 -28
  50. data/lib/schematic/entitlements/types/create_billing_linked_plan_entitlement_request_body.rb +2 -0
  51. data/lib/schematic/entitlements/types/create_company_override_request_body.rb +2 -0
  52. data/lib/schematic/entitlements/types/create_plan_entitlement_request_body.rb +2 -0
  53. data/lib/schematic/entitlements/types/update_company_override_request_body.rb +2 -0
  54. data/lib/schematic/entitlements/types/update_plan_entitlement_request_body.rb +2 -0
  55. data/lib/schematic/errors/response_error.rb +4 -2
  56. data/lib/schematic/events/client.rb +213 -9
  57. data/lib/schematic/events/types/create_account_inference_cost_rate_request_body.rb +19 -0
  58. data/lib/schematic/events/types/create_account_inference_cost_rate_response.rb +15 -0
  59. data/lib/schematic/events/types/delete_account_inference_cost_rate_response.rb +15 -0
  60. data/lib/schematic/events/types/list_account_inference_cost_rates_params.rb +20 -0
  61. data/lib/schematic/events/types/list_account_inference_cost_rates_request.rb +17 -0
  62. data/lib/schematic/events/types/list_account_inference_cost_rates_response.rb +15 -0
  63. data/lib/schematic/events/types/update_account_inference_cost_rate_request_body.rb +13 -0
  64. data/lib/schematic/events/types/update_account_inference_cost_rate_response.rb +15 -0
  65. data/lib/schematic/features/client.rb +18 -18
  66. data/lib/schematic/insights/client.rb +6 -6
  67. data/lib/schematic/integrationsapi/client.rb +14 -14
  68. data/lib/schematic/internal/http/raw_client.rb +1 -1
  69. data/lib/schematic/licenses/client.rb +3 -3
  70. data/lib/schematic/planbundle/client.rb +3 -3
  71. data/lib/schematic/plangroups/client.rb +3 -3
  72. data/lib/schematic/planmigrations/client.rb +11 -11
  73. data/lib/schematic/plans/client.rb +20 -20
  74. data/lib/schematic/scheduledcheckout/client.rb +4 -4
  75. data/lib/schematic/types/account_inference_cost_rate_response_data.rb +29 -0
  76. data/lib/schematic/types/billing_invoice_billing_details_response_data.rb +2 -0
  77. data/lib/schematic/types/billing_invoice_detail_response_data.rb +2 -0
  78. data/lib/schematic/types/billing_moved_to_default_plan_response_data.rb +15 -0
  79. data/lib/schematic/types/billing_settings_response_data.rb +4 -0
  80. data/lib/schematic/types/billing_subscription_pause_behavior.rb +15 -0
  81. data/lib/schematic/types/billing_subscription_response_data.rb +6 -0
  82. data/lib/schematic/types/billing_subscription_view.rb +6 -0
  83. data/lib/schematic/types/billing_upcoming_invoice_response_data.rb +43 -0
  84. data/lib/schematic/types/billing_upcoming_invoices_response_data.rb +13 -0
  85. data/lib/schematic/types/catalog_configuration_response_data.rb +2 -0
  86. data/lib/schematic/types/catalog_plan_response_data.rb +4 -0
  87. data/lib/schematic/types/catalog_response_data.rb +2 -0
  88. data/lib/schematic/types/checkout_subscription.rb +6 -0
  89. data/lib/schematic/types/company_billing_entity_settings_response_data.rb +15 -0
  90. data/lib/schematic/types/company_billing_entity_subscription_response_data.rb +10 -0
  91. data/lib/schematic/types/company_billing_profile_contract_response_data.rb +55 -0
  92. data/lib/schematic/types/company_billing_profile_document_response_data.rb +15 -0
  93. data/lib/schematic/types/company_override_response_data.rb +2 -0
  94. data/lib/schematic/types/company_subscription_response_data.rb +10 -0
  95. data/lib/schematic/types/contract_billing_details_request_body.rb +19 -0
  96. data/lib/schematic/types/contract_postpaid_credit_response_data.rb +23 -0
  97. data/lib/schematic/types/contract_postpaid_response_data.rb +15 -0
  98. data/lib/schematic/types/create_entitlement_in_bundle_request_body.rb +2 -0
  99. data/lib/schematic/types/create_entitlement_req_common.rb +2 -0
  100. data/lib/schematic/types/credit_burn_breakdown_line.rb +4 -0
  101. data/lib/schematic/types/credit_model_rate.rb +17 -0
  102. data/lib/schematic/types/custom_plan_billing_response_data.rb +2 -0
  103. data/lib/schematic/types/group_rollout_change_response_data.rb +13 -0
  104. data/lib/schematic/types/group_rollout_changes_response_data.rb +23 -0
  105. data/lib/schematic/types/group_rollout_company_response_data.rb +15 -0
  106. data/lib/schematic/types/group_rollout_company_result_response_data.rb +19 -0
  107. data/lib/schematic/types/group_rollout_preview_response_data.rb +19 -0
  108. data/lib/schematic/types/group_rollout_response_data.rb +25 -0
  109. data/lib/schematic/types/group_rollout_versions_request_body.rb +13 -0
  110. data/lib/schematic/types/manage_plan_request.rb +2 -0
  111. data/lib/schematic/types/plan_change_action.rb +1 -0
  112. data/lib/schematic/types/plan_entitlement_response_data.rb +2 -0
  113. data/lib/schematic/types/publish_plan_version_request_body.rb +4 -0
  114. data/lib/schematic/types/publish_preview_response_data.rb +4 -0
  115. data/lib/schematic/types/stripe_integration_config.rb +2 -0
  116. data/lib/schematic/types/update_entitlement_req_common.rb +2 -0
  117. data/lib/schematic/version.rb +1 -1
  118. data/lib/schematic/webhooks/client.rb +10 -10
  119. data/lib/schematic.rb +66 -5
  120. data/reference.md +2146 -1054
  121. metadata +57 -2
@@ -64,7 +64,7 @@ module Schematic
64
64
  500 => Schematic::Types::ApiError
65
65
  }
66
66
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
67
- raise error_class.new(response.body, code: code, body: error_body)
67
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
68
68
  end
69
69
  end
70
70
 
@@ -116,7 +116,7 @@ module Schematic
116
116
  500 => Schematic::Types::ApiError
117
117
  }
118
118
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
119
- raise error_class.new(response.body, code: code, body: error_body)
119
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
120
120
  end
121
121
  end
122
122
 
@@ -159,7 +159,7 @@ module Schematic
159
159
  500 => Schematic::Types::ApiError
160
160
  }
161
161
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
162
- raise error_class.new(response.body, code: code, body: error_body)
162
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
163
163
  end
164
164
  end
165
165
 
@@ -202,7 +202,7 @@ module Schematic
202
202
  500 => Schematic::Types::ApiError
203
203
  }
204
204
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
205
- raise error_class.new(response.body, code: code, body: error_body)
205
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
206
206
  end
207
207
  end
208
208
 
@@ -252,7 +252,7 @@ module Schematic
252
252
  500 => Schematic::Types::ApiError
253
253
  }
254
254
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
255
- raise error_class.new(response.body, code: code, body: error_body)
255
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
256
256
  end
257
257
  end
258
258
 
@@ -316,7 +316,7 @@ module Schematic
316
316
  500 => Schematic::Types::ApiError
317
317
  }
318
318
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
319
- raise error_class.new(response.body, code: code, body: error_body)
319
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
320
320
  end
321
321
  end
322
322
 
@@ -380,7 +380,7 @@ module Schematic
380
380
  500 => Schematic::Types::ApiError
381
381
  }
382
382
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
383
- raise error_class.new(response.body, code: code, body: error_body)
383
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
384
384
  end
385
385
  end
386
386
 
@@ -441,7 +441,7 @@ module Schematic
441
441
  500 => Schematic::Types::ApiError
442
442
  }
443
443
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
444
- raise error_class.new(response.body, code: code, body: error_body)
444
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
445
445
  end
446
446
  end
447
447
 
@@ -492,7 +492,7 @@ module Schematic
492
492
  500 => Schematic::Types::ApiError
493
493
  }
494
494
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
495
- raise error_class.new(response.body, code: code, body: error_body)
495
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
496
496
  end
497
497
  end
498
498
 
@@ -535,7 +535,7 @@ module Schematic
535
535
  500 => Schematic::Types::ApiError
536
536
  }
537
537
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
538
- raise error_class.new(response.body, code: code, body: error_body)
538
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
539
539
  end
540
540
  end
541
541
 
@@ -590,7 +590,7 @@ module Schematic
590
590
  500 => Schematic::Types::ApiError
591
591
  }
592
592
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
593
- raise error_class.new(response.body, code: code, body: error_body)
593
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
594
594
  end
595
595
  end
596
596
 
@@ -638,7 +638,7 @@ module Schematic
638
638
  500 => Schematic::Types::ApiError
639
639
  }
640
640
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
641
- raise error_class.new(response.body, code: code, body: error_body)
641
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
642
642
  end
643
643
  end
644
644
 
@@ -696,7 +696,7 @@ module Schematic
696
696
  500 => Schematic::Types::ApiError
697
697
  }
698
698
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
699
- raise error_class.new(response.body, code: code, body: error_body)
699
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
700
700
  end
701
701
  end
702
702
 
@@ -743,7 +743,7 @@ module Schematic
743
743
  500 => Schematic::Types::ApiError
744
744
  }
745
745
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
746
- raise error_class.new(response.body, code: code, body: error_body)
746
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
747
747
  end
748
748
  end
749
749
 
@@ -786,7 +786,7 @@ module Schematic
786
786
  500 => Schematic::Types::ApiError
787
787
  }
788
788
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
789
- raise error_class.new(response.body, code: code, body: error_body)
789
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
790
790
  end
791
791
  end
792
792
 
@@ -886,7 +886,7 @@ module Schematic
886
886
  500 => Schematic::Types::ApiError
887
887
  }
888
888
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
889
- raise error_class.new(response.body, code: code, body: error_body)
889
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
890
890
  end
891
891
  end
892
892
 
@@ -942,7 +942,7 @@ module Schematic
942
942
  500 => Schematic::Types::ApiError
943
943
  }
944
944
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
945
- raise error_class.new(response.body, code: code, body: error_body)
945
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
946
946
  end
947
947
  end
948
948
 
@@ -985,7 +985,7 @@ module Schematic
985
985
  500 => Schematic::Types::ApiError
986
986
  }
987
987
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
988
- raise error_class.new(response.body, code: code, body: error_body)
988
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
989
989
  end
990
990
  end
991
991
 
@@ -1085,7 +1085,7 @@ module Schematic
1085
1085
  500 => Schematic::Types::ApiError
1086
1086
  }
1087
1087
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1088
- raise error_class.new(response.body, code: code, body: error_body)
1088
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1089
1089
  end
1090
1090
  end
1091
1091
 
@@ -1128,7 +1128,7 @@ module Schematic
1128
1128
  500 => Schematic::Types::ApiError
1129
1129
  }
1130
1130
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1131
- raise error_class.new(response.body, code: code, body: error_body)
1131
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1132
1132
  end
1133
1133
  end
1134
1134
 
@@ -1174,7 +1174,7 @@ module Schematic
1174
1174
  500 => Schematic::Types::ApiError
1175
1175
  }
1176
1176
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1177
- raise error_class.new(response.body, code: code, body: error_body)
1177
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1178
1178
  end
1179
1179
  end
1180
1180
 
@@ -1259,7 +1259,7 @@ module Schematic
1259
1259
  500 => Schematic::Types::ApiError
1260
1260
  }
1261
1261
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1262
- raise error_class.new(response.body, code: code, body: error_body)
1262
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1263
1263
  end
1264
1264
  end
1265
1265
 
@@ -1344,7 +1344,7 @@ module Schematic
1344
1344
  500 => Schematic::Types::ApiError
1345
1345
  }
1346
1346
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1347
- raise error_class.new(response.body, code: code, body: error_body)
1347
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1348
1348
  end
1349
1349
  end
1350
1350
 
@@ -1405,7 +1405,7 @@ module Schematic
1405
1405
  500 => Schematic::Types::ApiError
1406
1406
  }
1407
1407
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1408
- raise error_class.new(response.body, code: code, body: error_body)
1408
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1409
1409
  end
1410
1410
  end
1411
1411
 
@@ -1456,7 +1456,188 @@ module Schematic
1456
1456
  500 => Schematic::Types::ApiError
1457
1457
  }
1458
1458
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1459
- raise error_class.new(response.body, code: code, body: error_body)
1459
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1460
+ end
1461
+ end
1462
+
1463
+ # @param request_options [Hash]
1464
+ # @param params [Hash]
1465
+ # @option request_options [String] :base_url
1466
+ # @option request_options [Hash{String => Object}] :additional_headers
1467
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
1468
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
1469
+ # @option request_options [Integer] :timeout_in_seconds
1470
+ # @option params [String] :billing_profile_id
1471
+ #
1472
+ # @example
1473
+ # client.billing.get_company_contract(billing_profile_id: "billing_profile_id")
1474
+ #
1475
+ # @return [Schematic::Billing::Types::GetCompanyContractResponse]
1476
+ def get_company_contract(request_options: {}, **params)
1477
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
1478
+ request = Schematic::Internal::JSON::Request.new(
1479
+ base_url: request_options[:base_url],
1480
+ method: "GET",
1481
+ path: "billing/profiles/#{URI.encode_uri_component(params[:billing_profile_id].to_s)}/contract",
1482
+ request_options: request_options
1483
+ )
1484
+ begin
1485
+ response = @client.send(request)
1486
+ rescue Net::HTTPRequestTimeout
1487
+ raise Schematic::Errors::TimeoutError
1488
+ end
1489
+ code = response.code.to_i
1490
+ if code.between?(200, 299)
1491
+ (response.body.to_s.empty? ? nil : Schematic::Billing::Types::GetCompanyContractResponse.load(response.body))
1492
+ else
1493
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
1494
+ error_types = {
1495
+ 401 => Schematic::Types::ApiError,
1496
+ 403 => Schematic::Types::ApiError,
1497
+ 404 => Schematic::Types::ApiError,
1498
+ 500 => Schematic::Types::ApiError
1499
+ }
1500
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1501
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1502
+ end
1503
+ end
1504
+
1505
+ # @param request_options [Hash]
1506
+ # @param params [Hash]
1507
+ # @option request_options [String] :base_url
1508
+ # @option request_options [Hash{String => Object}] :additional_headers
1509
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
1510
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
1511
+ # @option request_options [Integer] :timeout_in_seconds
1512
+ # @option params [String] :billing_profile_id
1513
+ #
1514
+ # @example
1515
+ # client.billing.download_contract_document(billing_profile_id: "billing_profile_id")
1516
+ #
1517
+ # @return [String]
1518
+ def download_contract_document(request_options: {}, **params)
1519
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
1520
+ request = Schematic::Internal::JSON::Request.new(
1521
+ base_url: request_options[:base_url],
1522
+ method: "GET",
1523
+ path: "billing/profiles/#{URI.encode_uri_component(params[:billing_profile_id].to_s)}/document",
1524
+ request_options: request_options
1525
+ )
1526
+ begin
1527
+ response = @client.send(request)
1528
+ rescue Net::HTTPRequestTimeout
1529
+ raise Schematic::Errors::TimeoutError
1530
+ end
1531
+ code = response.code.to_i
1532
+ return response.body if code.between?(200, 299)
1533
+
1534
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
1535
+ error_types = {
1536
+ 401 => Schematic::Types::ApiError,
1537
+ 403 => Schematic::Types::ApiError,
1538
+ 404 => Schematic::Types::ApiError,
1539
+ 500 => Schematic::Types::ApiError
1540
+ }
1541
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1542
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1543
+ end
1544
+
1545
+ # @param request_options [Hash]
1546
+ # @param params [void]
1547
+ # @option request_options [String] :base_url
1548
+ # @option request_options [Hash{String => Object}] :additional_headers
1549
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
1550
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
1551
+ # @option request_options [Integer] :timeout_in_seconds
1552
+ # @option params [String] :billing_profile_id
1553
+ #
1554
+ # @example
1555
+ # client.billing.upload_contract_document(
1556
+ # billing_profile_id: "billing_profile_id",
1557
+ # file: "/path/to/your/file"
1558
+ # )
1559
+ #
1560
+ # @return [Schematic::Billing::Types::UploadContractDocumentResponse]
1561
+ def upload_contract_document(request_options: {}, **params)
1562
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
1563
+ body = Internal::Multipart::FormData.new
1564
+
1565
+ if params[:file]
1566
+ body.add_file(
1567
+ name: "file",
1568
+ file: params[:file]
1569
+ )
1570
+ end
1571
+
1572
+ request = Schematic::Internal::Multipart::Request.new(
1573
+ base_url: request_options[:base_url],
1574
+ method: "PUT",
1575
+ path: "billing/profiles/#{URI.encode_uri_component(params[:billing_profile_id].to_s)}/document",
1576
+ body: body,
1577
+ request_options: request_options
1578
+ )
1579
+ begin
1580
+ response = @client.send(request)
1581
+ rescue Net::HTTPRequestTimeout
1582
+ raise Schematic::Errors::TimeoutError
1583
+ end
1584
+ code = response.code.to_i
1585
+ if code.between?(200, 299)
1586
+ (response.body.to_s.empty? ? nil : Schematic::Billing::Types::UploadContractDocumentResponse.load(response.body))
1587
+ else
1588
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
1589
+ error_types = {
1590
+ 400 => Schematic::Types::ApiError,
1591
+ 401 => Schematic::Types::ApiError,
1592
+ 403 => Schematic::Types::ApiError,
1593
+ 404 => Schematic::Types::ApiError,
1594
+ 500 => Schematic::Types::ApiError
1595
+ }
1596
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1597
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1598
+ end
1599
+ end
1600
+
1601
+ # @param request_options [Hash]
1602
+ # @param params [Hash]
1603
+ # @option request_options [String] :base_url
1604
+ # @option request_options [Hash{String => Object}] :additional_headers
1605
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
1606
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
1607
+ # @option request_options [Integer] :timeout_in_seconds
1608
+ # @option params [String] :billing_profile_id
1609
+ #
1610
+ # @example
1611
+ # client.billing.delete_contract_document(billing_profile_id: "billing_profile_id")
1612
+ #
1613
+ # @return [Schematic::Billing::Types::DeleteContractDocumentResponse]
1614
+ def delete_contract_document(request_options: {}, **params)
1615
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
1616
+ request = Schematic::Internal::JSON::Request.new(
1617
+ base_url: request_options[:base_url],
1618
+ method: "DELETE",
1619
+ path: "billing/profiles/#{URI.encode_uri_component(params[:billing_profile_id].to_s)}/document",
1620
+ request_options: request_options
1621
+ )
1622
+ begin
1623
+ response = @client.send(request)
1624
+ rescue Net::HTTPRequestTimeout
1625
+ raise Schematic::Errors::TimeoutError
1626
+ end
1627
+ code = response.code.to_i
1628
+ if code.between?(200, 299)
1629
+ (response.body.to_s.empty? ? nil : Schematic::Billing::Types::DeleteContractDocumentResponse.load(response.body))
1630
+ else
1631
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
1632
+ error_types = {
1633
+ 400 => Schematic::Types::ApiError,
1634
+ 401 => Schematic::Types::ApiError,
1635
+ 403 => Schematic::Types::ApiError,
1636
+ 404 => Schematic::Types::ApiError,
1637
+ 500 => Schematic::Types::ApiError
1638
+ }
1639
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1640
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1460
1641
  end
1461
1642
  end
1462
1643
 
@@ -1496,7 +1677,7 @@ module Schematic
1496
1677
  500 => Schematic::Types::ApiError
1497
1678
  }
1498
1679
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1499
- raise error_class.new(response.body, code: code, body: error_body)
1680
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1500
1681
  end
1501
1682
  end
1502
1683
 
@@ -1539,7 +1720,7 @@ module Schematic
1539
1720
  500 => Schematic::Types::ApiError
1540
1721
  }
1541
1722
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1542
- raise error_class.new(response.body, code: code, body: error_body)
1723
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1543
1724
  end
1544
1725
  end
1545
1726
 
@@ -1604,7 +1785,7 @@ module Schematic
1604
1785
  500 => Schematic::Types::ApiError
1605
1786
  }
1606
1787
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1607
- raise error_class.new(response.body, code: code, body: error_body)
1788
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1608
1789
  end
1609
1790
  end
1610
1791
 
@@ -1646,7 +1827,92 @@ module Schematic
1646
1827
  500 => Schematic::Types::ApiError
1647
1828
  }
1648
1829
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1649
- raise error_class.new(response.body, code: code, body: error_body)
1830
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1831
+ end
1832
+ end
1833
+
1834
+ # @param request_options [Hash]
1835
+ # @param params [Hash]
1836
+ # @option request_options [String] :base_url
1837
+ # @option request_options [Hash{String => Object}] :additional_headers
1838
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
1839
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
1840
+ # @option request_options [Integer] :timeout_in_seconds
1841
+ # @option params [String] :company_id
1842
+ #
1843
+ # @example
1844
+ # client.billing.move_to_default_plan(company_id: "company_id")
1845
+ #
1846
+ # @return [Schematic::Billing::Types::MoveToDefaultPlanResponse]
1847
+ def move_to_default_plan(request_options: {}, **params)
1848
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
1849
+ request = Schematic::Internal::JSON::Request.new(
1850
+ base_url: request_options[:base_url],
1851
+ method: "POST",
1852
+ path: "companies/#{URI.encode_uri_component(params[:company_id].to_s)}/native-subscription/move-to-default-plan",
1853
+ request_options: request_options
1854
+ )
1855
+ begin
1856
+ response = @client.send(request)
1857
+ rescue Net::HTTPRequestTimeout
1858
+ raise Schematic::Errors::TimeoutError
1859
+ end
1860
+ code = response.code.to_i
1861
+ if code.between?(200, 299)
1862
+ (response.body.to_s.empty? ? nil : Schematic::Billing::Types::MoveToDefaultPlanResponse.load(response.body))
1863
+ else
1864
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
1865
+ error_types = {
1866
+ 400 => Schematic::Types::ApiError,
1867
+ 401 => Schematic::Types::ApiError,
1868
+ 403 => Schematic::Types::ApiError,
1869
+ 404 => Schematic::Types::ApiError,
1870
+ 500 => Schematic::Types::ApiError
1871
+ }
1872
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1873
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1874
+ end
1875
+ end
1876
+
1877
+ # @param request_options [Hash]
1878
+ # @param params [Hash]
1879
+ # @option request_options [String] :base_url
1880
+ # @option request_options [Hash{String => Object}] :additional_headers
1881
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
1882
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
1883
+ # @option request_options [Integer] :timeout_in_seconds
1884
+ # @option params [String] :company_id
1885
+ #
1886
+ # @example
1887
+ # client.billing.get_company_upcoming_invoices(company_id: "company_id")
1888
+ #
1889
+ # @return [Schematic::Billing::Types::GetCompanyUpcomingInvoicesResponse]
1890
+ def get_company_upcoming_invoices(request_options: {}, **params)
1891
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
1892
+ request = Schematic::Internal::JSON::Request.new(
1893
+ base_url: request_options[:base_url],
1894
+ method: "GET",
1895
+ path: "companies/#{URI.encode_uri_component(params[:company_id].to_s)}/upcoming-invoices",
1896
+ request_options: request_options
1897
+ )
1898
+ begin
1899
+ response = @client.send(request)
1900
+ rescue Net::HTTPRequestTimeout
1901
+ raise Schematic::Errors::TimeoutError
1902
+ end
1903
+ code = response.code.to_i
1904
+ if code.between?(200, 299)
1905
+ (response.body.to_s.empty? ? nil : Schematic::Billing::Types::GetCompanyUpcomingInvoicesResponse.load(response.body))
1906
+ else
1907
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
1908
+ error_types = {
1909
+ 401 => Schematic::Types::ApiError,
1910
+ 403 => Schematic::Types::ApiError,
1911
+ 404 => Schematic::Types::ApiError,
1912
+ 500 => Schematic::Types::ApiError
1913
+ }
1914
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1915
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1650
1916
  end
1651
1917
  end
1652
1918
 
@@ -1719,7 +1985,7 @@ module Schematic
1719
1985
  500 => Schematic::Types::ApiError
1720
1986
  }
1721
1987
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1722
- raise error_class.new(response.body, code: code, body: error_body)
1988
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1723
1989
  end
1724
1990
  end
1725
1991
 
@@ -1761,7 +2027,50 @@ module Schematic
1761
2027
  500 => Schematic::Types::ApiError
1762
2028
  }
1763
2029
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1764
- raise error_class.new(response.body, code: code, body: error_body)
2030
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
2031
+ end
2032
+ end
2033
+
2034
+ # @param request_options [Hash]
2035
+ # @param params [Hash]
2036
+ # @option request_options [String] :base_url
2037
+ # @option request_options [Hash{String => Object}] :additional_headers
2038
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
2039
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
2040
+ # @option request_options [Integer] :timeout_in_seconds
2041
+ # @option params [String] :invoice_id
2042
+ #
2043
+ # @example
2044
+ # client.billing.charge_native_invoice(invoice_id: "invoice_id")
2045
+ #
2046
+ # @return [Schematic::Billing::Types::ChargeNativeInvoiceResponse]
2047
+ def charge_native_invoice(request_options: {}, **params)
2048
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
2049
+ request = Schematic::Internal::JSON::Request.new(
2050
+ base_url: request_options[:base_url],
2051
+ method: "POST",
2052
+ path: "invoices/#{URI.encode_uri_component(params[:invoice_id].to_s)}/charge",
2053
+ request_options: request_options
2054
+ )
2055
+ begin
2056
+ response = @client.send(request)
2057
+ rescue Net::HTTPRequestTimeout
2058
+ raise Schematic::Errors::TimeoutError
2059
+ end
2060
+ code = response.code.to_i
2061
+ if code.between?(200, 299)
2062
+ (response.body.to_s.empty? ? nil : Schematic::Billing::Types::ChargeNativeInvoiceResponse.load(response.body))
2063
+ else
2064
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
2065
+ error_types = {
2066
+ 400 => Schematic::Types::ApiError,
2067
+ 401 => Schematic::Types::ApiError,
2068
+ 403 => Schematic::Types::ApiError,
2069
+ 404 => Schematic::Types::ApiError,
2070
+ 500 => Schematic::Types::ApiError
2071
+ }
2072
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
2073
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1765
2074
  end
1766
2075
  end
1767
2076
 
@@ -1802,7 +2111,7 @@ module Schematic
1802
2111
  500 => Schematic::Types::ApiError
1803
2112
  }
1804
2113
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1805
- raise error_class.new(response.body, code: code, body: error_body)
2114
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1806
2115
  end
1807
2116
 
1808
2117
  # @param request_options [Hash]
@@ -1844,7 +2153,93 @@ module Schematic
1844
2153
  500 => Schematic::Types::ApiError
1845
2154
  }
1846
2155
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1847
- raise error_class.new(response.body, code: code, body: error_body)
2156
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
2157
+ end
2158
+ end
2159
+
2160
+ # @param request_options [Hash]
2161
+ # @param params [Hash]
2162
+ # @option request_options [String] :base_url
2163
+ # @option request_options [Hash{String => Object}] :additional_headers
2164
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
2165
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
2166
+ # @option request_options [Integer] :timeout_in_seconds
2167
+ # @option params [String] :invoice_id
2168
+ #
2169
+ # @example
2170
+ # client.billing.reissue_native_invoice_link(invoice_id: "invoice_id")
2171
+ #
2172
+ # @return [Schematic::Billing::Types::ReissueNativeInvoiceLinkResponse]
2173
+ def reissue_native_invoice_link(request_options: {}, **params)
2174
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
2175
+ request = Schematic::Internal::JSON::Request.new(
2176
+ base_url: request_options[:base_url],
2177
+ method: "POST",
2178
+ path: "invoices/#{URI.encode_uri_component(params[:invoice_id].to_s)}/link/reissue",
2179
+ request_options: request_options
2180
+ )
2181
+ begin
2182
+ response = @client.send(request)
2183
+ rescue Net::HTTPRequestTimeout
2184
+ raise Schematic::Errors::TimeoutError
2185
+ end
2186
+ code = response.code.to_i
2187
+ if code.between?(200, 299)
2188
+ (response.body.to_s.empty? ? nil : Schematic::Billing::Types::ReissueNativeInvoiceLinkResponse.load(response.body))
2189
+ else
2190
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
2191
+ error_types = {
2192
+ 400 => Schematic::Types::ApiError,
2193
+ 401 => Schematic::Types::ApiError,
2194
+ 403 => Schematic::Types::ApiError,
2195
+ 404 => Schematic::Types::ApiError,
2196
+ 500 => Schematic::Types::ApiError
2197
+ }
2198
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
2199
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
2200
+ end
2201
+ end
2202
+
2203
+ # @param request_options [Hash]
2204
+ # @param params [Hash]
2205
+ # @option request_options [String] :base_url
2206
+ # @option request_options [Hash{String => Object}] :additional_headers
2207
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
2208
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
2209
+ # @option request_options [Integer] :timeout_in_seconds
2210
+ # @option params [String] :invoice_id
2211
+ #
2212
+ # @example
2213
+ # client.billing.revoke_native_invoice_link(invoice_id: "invoice_id")
2214
+ #
2215
+ # @return [Schematic::Billing::Types::RevokeNativeInvoiceLinkResponse]
2216
+ def revoke_native_invoice_link(request_options: {}, **params)
2217
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
2218
+ request = Schematic::Internal::JSON::Request.new(
2219
+ base_url: request_options[:base_url],
2220
+ method: "POST",
2221
+ path: "invoices/#{URI.encode_uri_component(params[:invoice_id].to_s)}/link/revoke",
2222
+ request_options: request_options
2223
+ )
2224
+ begin
2225
+ response = @client.send(request)
2226
+ rescue Net::HTTPRequestTimeout
2227
+ raise Schematic::Errors::TimeoutError
2228
+ end
2229
+ code = response.code.to_i
2230
+ if code.between?(200, 299)
2231
+ (response.body.to_s.empty? ? nil : Schematic::Billing::Types::RevokeNativeInvoiceLinkResponse.load(response.body))
2232
+ else
2233
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
2234
+ error_types = {
2235
+ 400 => Schematic::Types::ApiError,
2236
+ 401 => Schematic::Types::ApiError,
2237
+ 403 => Schematic::Types::ApiError,
2238
+ 404 => Schematic::Types::ApiError,
2239
+ 500 => Schematic::Types::ApiError
2240
+ }
2241
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
2242
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1848
2243
  end
1849
2244
  end
1850
2245
 
@@ -1895,7 +2290,7 @@ module Schematic
1895
2290
  500 => Schematic::Types::ApiError
1896
2291
  }
1897
2292
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1898
- raise error_class.new(response.body, code: code, body: error_body)
2293
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1899
2294
  end
1900
2295
  end
1901
2296
 
@@ -1936,7 +2331,7 @@ module Schematic
1936
2331
  500 => Schematic::Types::ApiError
1937
2332
  }
1938
2333
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1939
- raise error_class.new(response.body, code: code, body: error_body)
2334
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1940
2335
  end
1941
2336
 
1942
2337
  # @param request_options [Hash]
@@ -1978,7 +2373,7 @@ module Schematic
1978
2373
  500 => Schematic::Types::ApiError
1979
2374
  }
1980
2375
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
1981
- raise error_class.new(response.body, code: code, body: error_body)
2376
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
1982
2377
  end
1983
2378
  end
1984
2379
 
@@ -2051,7 +2446,7 @@ module Schematic
2051
2446
  500 => Schematic::Types::ApiError
2052
2447
  }
2053
2448
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
2054
- raise error_class.new(response.body, code: code, body: error_body)
2449
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
2055
2450
  end
2056
2451
  end
2057
2452
  end