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
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../schematic"
4
+
5
+ module Schematic
6
+ module Billing
7
+ module Types
8
+ class ChargeNativeInvoiceResponse < Internal::Types::Model
9
+ field :data, -> { Schematic::Types::BillingInvoiceDetailResponseData }, optional: false, nullable: false
10
+
11
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -28,6 +28,10 @@ module Schematic
28
28
 
29
29
  field :metadata, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false
30
30
 
31
+ field :pause_behavior, -> { Schematic::Types::BillingSubscriptionPauseBehavior }, optional: true, nullable: false
32
+
33
+ field :pause_resumes_at, -> { Integer }, optional: true, nullable: false
34
+
31
35
  field :period_end, -> { Integer }, optional: true, nullable: false
32
36
 
33
37
  field :period_start, -> { Integer }, optional: true, nullable: false
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../schematic"
4
+
5
+ module Schematic
6
+ module Billing
7
+ module Types
8
+ class DeleteContractDocumentResponse < Internal::Types::Model
9
+ field :data, -> { Schematic::Types::DeleteResponse }, optional: false, nullable: false
10
+
11
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../schematic"
4
+
5
+ module Schematic
6
+ module Billing
7
+ module Types
8
+ class GetCompanyContractResponse < Internal::Types::Model
9
+ field :data, -> { Schematic::Types::CompanyBillingProfileContractResponseData }, optional: false, nullable: false
10
+
11
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../schematic"
4
+
5
+ module Schematic
6
+ module Billing
7
+ module Types
8
+ class GetCompanyUpcomingInvoicesResponse < Internal::Types::Model
9
+ field :data, -> { Schematic::Types::BillingUpcomingInvoicesResponseData }, optional: false, nullable: false
10
+
11
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../schematic"
4
+
5
+ module Schematic
6
+ module Billing
7
+ module Types
8
+ class MoveToDefaultPlanResponse < Internal::Types::Model
9
+ field :data, -> { Schematic::Types::BillingMovedToDefaultPlanResponseData }, optional: false, nullable: false
10
+
11
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../schematic"
4
+
5
+ module Schematic
6
+ module Billing
7
+ module Types
8
+ class ReissueNativeInvoiceLinkResponse < Internal::Types::Model
9
+ field :data, -> { Schematic::Types::BillingInvoiceDetailResponseData }, optional: false, nullable: false
10
+
11
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../schematic"
4
+
5
+ module Schematic
6
+ module Billing
7
+ module Types
8
+ class RevokeNativeInvoiceLinkResponse < Internal::Types::Model
9
+ field :data, -> { Schematic::Types::BillingInvoiceDetailResponseData }, optional: false, nullable: false
10
+
11
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -4,7 +4,11 @@ module Schematic
4
4
  module Billing
5
5
  module Types
6
6
  class UpdateBillingSettingsRequestBody < Internal::Types::Model
7
+ field :default_collector, -> { Schematic::Types::Collector }, optional: true, nullable: false
8
+
7
9
  field :default_provider_type, -> { Schematic::Types::BillingProviderType }, optional: true, nullable: false
10
+
11
+ field :invoice_reply_to_email, -> { String }, optional: true, nullable: false
8
12
  end
9
13
  end
10
14
  end
@@ -6,8 +6,12 @@ module Schematic
6
6
  class UpdateCompanyBillingProfileRequestBody < Internal::Types::Model
7
7
  field :billing_profile_id, -> { String }, optional: false, nullable: false
8
8
 
9
+ field :billing_details, -> { Schematic::Types::ContractBillingDetailsRequestBody }, optional: true, nullable: false
10
+
9
11
  field :collection_method, -> { Schematic::Types::BillingCollectionMethod }, optional: false, nullable: false
10
12
 
13
+ field :collector, -> { Schematic::Types::Collector }, optional: true, nullable: false
14
+
11
15
  field :currency, -> { Schematic::Types::Currency }, optional: true, nullable: false
12
16
 
13
17
  field :days_until_due, -> { Integer }, optional: true, nullable: false
@@ -25,6 +29,8 @@ module Schematic
25
29
  field :payment_method_id, -> { String }, optional: true, nullable: false
26
30
 
27
31
  field :proration_behavior, -> { Schematic::Types::ProrationBehavior }, optional: true, nullable: false
32
+
33
+ field :purchase_order, -> { String }, optional: true, nullable: false
28
34
  end
29
35
  end
30
36
  end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Billing
5
+ module Types
6
+ class UploadContractDocumentRequest < Internal::Types::Model
7
+ field :billing_profile_id, -> { String }, optional: false, nullable: false
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../schematic"
4
+
5
+ module Schematic
6
+ module Billing
7
+ module Types
8
+ class UploadContractDocumentResponse < Internal::Types::Model
9
+ field :data, -> { Schematic::Types::CompanyBillingProfileContractResponseData }, optional: false, nullable: false
10
+
11
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -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
 
@@ -107,7 +107,7 @@ module Schematic
107
107
  500 => Schematic::Types::ApiError
108
108
  }
109
109
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
110
- raise error_class.new(response.body, code: code, body: error_body)
110
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
111
111
  end
112
112
  end
113
113
 
@@ -149,7 +149,7 @@ module Schematic
149
149
  500 => Schematic::Types::ApiError
150
150
  }
151
151
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
152
- raise error_class.new(response.body, code: code, body: error_body)
152
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
153
153
  end
154
154
  end
155
155
 
@@ -197,7 +197,7 @@ module Schematic
197
197
  500 => Schematic::Types::ApiError
198
198
  }
199
199
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
200
- raise error_class.new(response.body, code: code, body: error_body)
200
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
201
201
  end
202
202
  end
203
203
 
@@ -240,7 +240,7 @@ module Schematic
240
240
  500 => Schematic::Types::ApiError
241
241
  }
242
242
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
243
- raise error_class.new(response.body, code: code, body: error_body)
243
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
244
244
  end
245
245
  end
246
246
 
@@ -282,7 +282,7 @@ module Schematic
282
282
  500 => Schematic::Types::ApiError
283
283
  }
284
284
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
285
- raise error_class.new(response.body, code: code, body: error_body)
285
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
286
286
  end
287
287
  end
288
288
 
@@ -330,7 +330,7 @@ module Schematic
330
330
  500 => Schematic::Types::ApiError
331
331
  }
332
332
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
333
- raise error_class.new(response.body, code: code, body: error_body)
333
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
334
334
  end
335
335
  end
336
336
 
@@ -372,7 +372,7 @@ module Schematic
372
372
  500 => Schematic::Types::ApiError
373
373
  }
374
374
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
375
- raise error_class.new(response.body, code: code, body: error_body)
375
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
376
376
  end
377
377
  end
378
378
 
@@ -418,7 +418,7 @@ module Schematic
418
418
  500 => Schematic::Types::ApiError
419
419
  }
420
420
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
421
- raise error_class.new(response.body, code: code, body: error_body)
421
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
422
422
  end
423
423
 
424
424
  # @param request_options [Hash]
@@ -463,7 +463,7 @@ module Schematic
463
463
  500 => Schematic::Types::ApiError
464
464
  }
465
465
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
466
- raise error_class.new(response.body, code: code, body: error_body)
466
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
467
467
  end
468
468
 
469
469
  # @param request_options [Hash]
@@ -504,7 +504,7 @@ module Schematic
504
504
  500 => Schematic::Types::ApiError
505
505
  }
506
506
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
507
- raise error_class.new(response.body, code: code, body: error_body)
507
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
508
508
  end
509
509
  end
510
510
 
@@ -546,7 +546,7 @@ module Schematic
546
546
  500 => Schematic::Types::ApiError
547
547
  }
548
548
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
549
- raise error_class.new(response.body, code: code, body: error_body)
549
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
550
550
  end
551
551
  end
552
552
 
@@ -592,7 +592,7 @@ module Schematic
592
592
  500 => Schematic::Types::ApiError
593
593
  }
594
594
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
595
- raise error_class.new(response.body, code: code, body: error_body)
595
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
596
596
  end
597
597
 
598
598
  # @param request_options [Hash]
@@ -637,7 +637,7 @@ module Schematic
637
637
  500 => Schematic::Types::ApiError
638
638
  }
639
639
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
640
- raise error_class.new(response.body, code: code, body: error_body)
640
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
641
641
  end
642
642
 
643
643
  # @param request_options [Hash]
@@ -676,7 +676,7 @@ module Schematic
676
676
  500 => Schematic::Types::ApiError
677
677
  }
678
678
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
679
- raise error_class.new(response.body, code: code, body: error_body)
679
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
680
680
  end
681
681
  end
682
682
 
@@ -718,7 +718,7 @@ module Schematic
718
718
  500 => Schematic::Types::ApiError
719
719
  }
720
720
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
721
- raise error_class.new(response.body, code: code, body: error_body)
721
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
722
722
  end
723
723
  end
724
724
  end
@@ -10,6 +10,8 @@ module Schematic
10
10
 
11
11
  field :custom_plan_cta_url, -> { String }, optional: true, nullable: false
12
12
 
13
+ field :custom_plan_id, -> { String }, optional: true, nullable: false
14
+
13
15
  field :custom_plan_price_text, -> { String }, optional: true, nullable: false
14
16
 
15
17
  field :custom_plans_visible, -> { Internal::Types::Boolean }, optional: true, nullable: false
@@ -73,7 +73,7 @@ module Schematic
73
73
  500 => Schematic::Types::ApiError
74
74
  }
75
75
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
76
- raise error_class.new(response.body, code: code, body: error_body)
76
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
77
77
  end
78
78
  end
79
79
 
@@ -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
 
@@ -183,7 +183,7 @@ module Schematic
183
183
  500 => Schematic::Types::ApiError
184
184
  }
185
185
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
186
- raise error_class.new(response.body, code: code, body: error_body)
186
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
187
187
  end
188
188
  end
189
189
 
@@ -225,7 +225,7 @@ module Schematic
225
225
  500 => Schematic::Types::ApiError
226
226
  }
227
227
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
228
- raise error_class.new(response.body, code: code, body: error_body)
228
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
229
229
  end
230
230
  end
231
231
 
@@ -279,7 +279,7 @@ module Schematic
279
279
  500 => Schematic::Types::ApiError
280
280
  }
281
281
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
282
- raise error_class.new(response.body, code: code, body: error_body)
282
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
283
283
  end
284
284
  end
285
285
 
@@ -339,7 +339,7 @@ module Schematic
339
339
  500 => Schematic::Types::ApiError
340
340
  }
341
341
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
342
- raise error_class.new(response.body, code: code, body: error_body)
342
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
343
343
  end
344
344
  end
345
345
 
@@ -399,7 +399,7 @@ module Schematic
399
399
  500 => Schematic::Types::ApiError
400
400
  }
401
401
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
402
- raise error_class.new(response.body, code: code, body: error_body)
402
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
403
403
  end
404
404
  end
405
405
 
@@ -442,7 +442,96 @@ module Schematic
442
442
  500 => Schematic::Types::ApiError
443
443
  }
444
444
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
445
- raise error_class.new(response.body, code: code, body: error_body)
445
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
446
+ end
447
+ end
448
+
449
+ # @param request_options [Hash]
450
+ # @param params [Schematic::Checkout::Types::PauseSubscriptionRequest]
451
+ # @option request_options [String] :base_url
452
+ # @option request_options [Hash{String => Object}] :additional_headers
453
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
454
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
455
+ # @option request_options [Integer] :timeout_in_seconds
456
+ #
457
+ # @example
458
+ # client.checkout.pause_subscription(
459
+ # company_id: "company_id",
460
+ # months: 1000000
461
+ # )
462
+ #
463
+ # @return [Schematic::Checkout::Types::PauseSubscriptionResponse]
464
+ def pause_subscription(request_options: {}, **params)
465
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
466
+ request = Schematic::Internal::JSON::Request.new(
467
+ base_url: request_options[:base_url],
468
+ method: "POST",
469
+ path: "manage-plan/subscription/pause",
470
+ body: Schematic::Checkout::Types::PauseSubscriptionRequest.new(params).to_h,
471
+ request_options: request_options
472
+ )
473
+ begin
474
+ response = @client.send(request)
475
+ rescue Net::HTTPRequestTimeout
476
+ raise Schematic::Errors::TimeoutError
477
+ end
478
+ code = response.code.to_i
479
+ if code.between?(200, 299)
480
+ (response.body.to_s.empty? ? nil : Schematic::Checkout::Types::PauseSubscriptionResponse.load(response.body))
481
+ else
482
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
483
+ error_types = {
484
+ 400 => Schematic::Types::ApiError,
485
+ 401 => Schematic::Types::ApiError,
486
+ 403 => Schematic::Types::ApiError,
487
+ 404 => Schematic::Types::ApiError,
488
+ 500 => Schematic::Types::ApiError
489
+ }
490
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
491
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
492
+ end
493
+ end
494
+
495
+ # @param request_options [Hash]
496
+ # @param params [Schematic::Checkout::Types::ResumeSubscriptionRequest]
497
+ # @option request_options [String] :base_url
498
+ # @option request_options [Hash{String => Object}] :additional_headers
499
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
500
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
501
+ # @option request_options [Integer] :timeout_in_seconds
502
+ #
503
+ # @example
504
+ # client.checkout.resume_subscription(company_id: "company_id")
505
+ #
506
+ # @return [Schematic::Checkout::Types::ResumeSubscriptionResponse]
507
+ def resume_subscription(request_options: {}, **params)
508
+ params = Schematic::Internal::Types::Utils.normalize_keys(params)
509
+ request = Schematic::Internal::JSON::Request.new(
510
+ base_url: request_options[:base_url],
511
+ method: "POST",
512
+ path: "manage-plan/subscription/resume",
513
+ body: Schematic::Checkout::Types::ResumeSubscriptionRequest.new(params).to_h,
514
+ request_options: request_options
515
+ )
516
+ begin
517
+ response = @client.send(request)
518
+ rescue Net::HTTPRequestTimeout
519
+ raise Schematic::Errors::TimeoutError
520
+ end
521
+ code = response.code.to_i
522
+ if code.between?(200, 299)
523
+ (response.body.to_s.empty? ? nil : Schematic::Checkout::Types::ResumeSubscriptionResponse.load(response.body))
524
+ else
525
+ error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
526
+ error_types = {
527
+ 400 => Schematic::Types::ApiError,
528
+ 401 => Schematic::Types::ApiError,
529
+ 403 => Schematic::Types::ApiError,
530
+ 404 => Schematic::Types::ApiError,
531
+ 500 => Schematic::Types::ApiError
532
+ }
533
+ error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
534
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
446
535
  end
447
536
  end
448
537
 
@@ -490,7 +579,7 @@ module Schematic
490
579
  500 => Schematic::Types::ApiError
491
580
  }
492
581
  error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
493
- raise error_class.new(response.body, code: code, body: error_body)
582
+ raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
494
583
  end
495
584
  end
496
585
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Checkout
5
+ module Types
6
+ class PauseSubscriptionRequest < Internal::Types::Model
7
+ field :company_id, -> { String }, optional: false, nullable: false
8
+
9
+ field :months, -> { Integer }, optional: false, nullable: false
10
+
11
+ field :subscription_external_id, -> { String }, optional: true, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../schematic"
4
+
5
+ module Schematic
6
+ module Checkout
7
+ module Types
8
+ class PauseSubscriptionResponse < Internal::Types::Model
9
+ field :data, -> { Schematic::Types::ManagePlanResponseResponseData }, optional: false, nullable: false
10
+
11
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Schematic
4
+ module Checkout
5
+ module Types
6
+ class ResumeSubscriptionRequest < Internal::Types::Model
7
+ field :company_id, -> { String }, optional: false, nullable: false
8
+
9
+ field :subscription_external_id, -> { String }, optional: true, nullable: false
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../schematic"
4
+
5
+ module Schematic
6
+ module Checkout
7
+ module Types
8
+ class ResumeSubscriptionResponse < Internal::Types::Model
9
+ field :data, -> { Schematic::Types::ManagePlanResponseResponseData }, optional: false, nullable: false
10
+
11
+ field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
12
+ end
13
+ end
14
+ end
15
+ end