schematichq 1.5.7 → 1.5.9

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 (153) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +5 -5
  3. data/.fern/replay.lock +13 -1
  4. data/README.md +7 -1
  5. data/lib/schematic/accesstokens/client.rb +1 -1
  6. data/lib/schematic/accounts/client.rb +15 -15
  7. data/lib/schematic/billing/client.rb +706 -83
  8. data/lib/schematic/billing/types/charge_native_invoice_response.rb +15 -0
  9. data/lib/schematic/billing/types/convert_company_trial_response.rb +15 -0
  10. data/lib/schematic/billing/types/create_billing_subscription_request_body.rb +6 -0
  11. data/lib/schematic/billing/types/delete_contract_document_response.rb +15 -0
  12. data/lib/schematic/billing/types/end_company_trial_response.rb +15 -0
  13. data/lib/schematic/billing/types/get_company_contract_response.rb +15 -0
  14. data/lib/schematic/billing/types/get_company_trial_response.rb +15 -0
  15. data/lib/schematic/billing/types/get_company_upcoming_invoices_response.rb +15 -0
  16. data/lib/schematic/billing/types/move_to_default_plan_response.rb +15 -0
  17. data/lib/schematic/billing/types/reissue_native_invoice_link_response.rb +15 -0
  18. data/lib/schematic/billing/types/revoke_native_invoice_link_response.rb +15 -0
  19. data/lib/schematic/billing/types/start_company_trial_request_body.rb +21 -0
  20. data/lib/schematic/billing/types/start_company_trial_response.rb +15 -0
  21. data/lib/schematic/billing/types/update_billing_settings_request_body.rb +4 -0
  22. data/lib/schematic/billing/types/update_company_billing_profile_request_body.rb +6 -0
  23. data/lib/schematic/billing/types/update_company_trial_request_body.rb +15 -0
  24. data/lib/schematic/billing/types/update_company_trial_response.rb +15 -0
  25. data/lib/schematic/billing/types/upload_contract_document_request.rb +11 -0
  26. data/lib/schematic/billing/types/upload_contract_document_response.rb +15 -0
  27. data/lib/schematic/cache.rb +19 -2
  28. data/lib/schematic/catalogs/client.rb +16 -16
  29. data/lib/schematic/catalogs/types/update_catalog_configuration_request_body.rb +2 -0
  30. data/lib/schematic/checkout/client.rb +98 -9
  31. data/lib/schematic/checkout/types/checkout_data_request_body.rb +2 -0
  32. data/lib/schematic/checkout/types/pause_subscription_request.rb +15 -0
  33. data/lib/schematic/checkout/types/pause_subscription_response.rb +15 -0
  34. data/lib/schematic/checkout/types/resume_subscription_request.rb +13 -0
  35. data/lib/schematic/checkout/types/resume_subscription_response.rb +15 -0
  36. data/lib/schematic/client.rb +7 -196
  37. data/lib/schematic/companies/client.rb +140 -44
  38. data/lib/schematic/companies/types/get_billing_entity_settings_response.rb +15 -0
  39. data/lib/schematic/companies/types/list_users_params.rb +4 -0
  40. data/lib/schematic/companies/types/list_users_request.rb +4 -0
  41. data/lib/schematic/companies/types/update_billing_entity_settings_request_body.rb +13 -0
  42. data/lib/schematic/companies/types/update_billing_entity_settings_response.rb +15 -0
  43. data/lib/schematic/components/client.rb +8 -8
  44. data/lib/schematic/componentspublic/client.rb +1 -1
  45. data/lib/schematic/credits/client.rb +41 -41
  46. data/lib/schematic/customplangrouprollouts/client.rb +258 -0
  47. data/lib/schematic/customplangrouprollouts/types/copy_custom_plan_request_body.rb +15 -0
  48. data/lib/schematic/customplangrouprollouts/types/copy_custom_plan_response.rb +15 -0
  49. data/lib/schematic/customplangrouprollouts/types/get_group_rollout_response.rb +15 -0
  50. data/lib/schematic/customplangrouprollouts/types/list_group_rollouts_params.rb +14 -0
  51. data/lib/schematic/customplangrouprollouts/types/list_group_rollouts_request.rb +11 -0
  52. data/lib/schematic/customplangrouprollouts/types/list_group_rollouts_response.rb +15 -0
  53. data/lib/schematic/customplangrouprollouts/types/preview_group_rollout_params.rb +16 -0
  54. data/lib/schematic/customplangrouprollouts/types/preview_group_rollout_request.rb +15 -0
  55. data/lib/schematic/customplangrouprollouts/types/preview_group_rollout_response.rb +15 -0
  56. data/lib/schematic/customplangrouprollouts/types/start_group_rollout_request_body.rb +17 -0
  57. data/lib/schematic/customplangrouprollouts/types/start_group_rollout_response.rb +15 -0
  58. data/lib/schematic/dataexports/client.rb +4 -4
  59. data/lib/schematic/datastream/client.rb +52 -22
  60. data/lib/schematic/datastream/resource_cache.rb +13 -3
  61. data/lib/schematic/entitlements/client.rb +28 -28
  62. data/lib/schematic/entitlements/types/create_billing_linked_plan_entitlement_request_body.rb +2 -0
  63. data/lib/schematic/entitlements/types/create_company_override_request_body.rb +2 -0
  64. data/lib/schematic/entitlements/types/create_plan_entitlement_request_body.rb +2 -0
  65. data/lib/schematic/entitlements/types/update_company_override_request_body.rb +2 -0
  66. data/lib/schematic/entitlements/types/update_plan_entitlement_request_body.rb +2 -0
  67. data/lib/schematic/errors/response_error.rb +4 -2
  68. data/lib/schematic/events/client.rb +213 -9
  69. data/lib/schematic/events/types/create_account_inference_cost_rate_request_body.rb +19 -0
  70. data/lib/schematic/events/types/create_account_inference_cost_rate_response.rb +15 -0
  71. data/lib/schematic/events/types/delete_account_inference_cost_rate_response.rb +15 -0
  72. data/lib/schematic/events/types/list_account_inference_cost_rates_params.rb +20 -0
  73. data/lib/schematic/events/types/list_account_inference_cost_rates_request.rb +17 -0
  74. data/lib/schematic/events/types/list_account_inference_cost_rates_response.rb +15 -0
  75. data/lib/schematic/events/types/update_account_inference_cost_rate_request_body.rb +13 -0
  76. data/lib/schematic/events/types/update_account_inference_cost_rate_response.rb +15 -0
  77. data/lib/schematic/features/client.rb +18 -18
  78. data/lib/schematic/insights/client.rb +6 -6
  79. data/lib/schematic/integrationsapi/client.rb +14 -14
  80. data/lib/schematic/internal/http/raw_client.rb +2 -2
  81. data/lib/schematic/internal/iterators/offset_page_iterator.rb +2 -0
  82. data/lib/schematic/licenses/client.rb +3 -3
  83. data/lib/schematic/planbundle/client.rb +3 -3
  84. data/lib/schematic/plangroups/client.rb +3 -3
  85. data/lib/schematic/planmigrations/client.rb +11 -11
  86. data/lib/schematic/plans/client.rb +20 -20
  87. data/lib/schematic/redis_cache.rb +10 -1
  88. data/lib/schematic/scheduledcheckout/client.rb +4 -4
  89. data/lib/schematic/schematic_client.rb +21 -3
  90. data/lib/schematic/types/account_inference_cost_rate_response_data.rb +29 -0
  91. data/lib/schematic/types/billing_customer_subscription.rb +2 -0
  92. data/lib/schematic/types/billing_invoice_billing_details_response_data.rb +2 -0
  93. data/lib/schematic/types/billing_invoice_detail_response_data.rb +2 -0
  94. data/lib/schematic/types/billing_moved_to_default_plan_response_data.rb +15 -0
  95. data/lib/schematic/types/billing_native_subscription_response_data.rb +4 -0
  96. data/lib/schematic/types/billing_product_for_subscription_response_data.rb +2 -0
  97. data/lib/schematic/types/billing_product_plan_response_data.rb +2 -0
  98. data/lib/schematic/types/billing_settings_response_data.rb +4 -0
  99. data/lib/schematic/types/billing_subscription_pause_behavior.rb +15 -0
  100. data/lib/schematic/types/billing_subscription_response_data.rb +6 -0
  101. data/lib/schematic/types/billing_subscription_view.rb +6 -0
  102. data/lib/schematic/types/billing_upcoming_invoice_response_data.rb +43 -0
  103. data/lib/schematic/types/billing_upcoming_invoices_response_data.rb +13 -0
  104. data/lib/schematic/types/catalog_configuration_response_data.rb +2 -0
  105. data/lib/schematic/types/catalog_plan_response_data.rb +4 -0
  106. data/lib/schematic/types/catalog_response_data.rb +2 -0
  107. data/lib/schematic/types/checkout_subscription.rb +6 -0
  108. data/lib/schematic/types/company_billing_entity_settings_response_data.rb +15 -0
  109. data/lib/schematic/types/company_billing_entity_subscription_response_data.rb +10 -0
  110. data/lib/schematic/types/company_billing_profile_contract_response_data.rb +55 -0
  111. data/lib/schematic/types/company_billing_profile_document_response_data.rb +15 -0
  112. data/lib/schematic/types/company_override_response_data.rb +2 -0
  113. data/lib/schematic/types/company_subscription_response_data.rb +10 -0
  114. data/lib/schematic/types/company_trial_response_data.rb +35 -0
  115. data/lib/schematic/types/company_trial_status.rb +16 -0
  116. data/lib/schematic/types/contract_billing_details_request_body.rb +19 -0
  117. data/lib/schematic/types/contract_postpaid_credit_response_data.rb +23 -0
  118. data/lib/schematic/types/contract_postpaid_response_data.rb +15 -0
  119. data/lib/schematic/types/create_entitlement_in_bundle_request_body.rb +2 -0
  120. data/lib/schematic/types/create_entitlement_req_common.rb +2 -0
  121. data/lib/schematic/types/credit_burn_breakdown_line.rb +4 -0
  122. data/lib/schematic/types/credit_ledger_export_metadata.rb +25 -0
  123. data/lib/schematic/types/credit_ledger_export_metadata_event_type.rb +19 -0
  124. data/lib/schematic/types/credit_model_rate.rb +17 -0
  125. data/lib/schematic/types/custom_plan_billing_response_data.rb +2 -0
  126. data/lib/schematic/types/data_export_metadata.rb +2 -0
  127. data/lib/schematic/types/data_export_type.rb +1 -0
  128. data/lib/schematic/types/group_rollout_change_response_data.rb +13 -0
  129. data/lib/schematic/types/group_rollout_changes_response_data.rb +23 -0
  130. data/lib/schematic/types/group_rollout_company_response_data.rb +15 -0
  131. data/lib/schematic/types/group_rollout_company_result_response_data.rb +19 -0
  132. data/lib/schematic/types/group_rollout_preview_response_data.rb +19 -0
  133. data/lib/schematic/types/group_rollout_response_data.rb +25 -0
  134. data/lib/schematic/types/group_rollout_versions_request_body.rb +13 -0
  135. data/lib/schematic/types/manage_plan_request.rb +4 -0
  136. data/lib/schematic/types/manage_plan_response_response_data.rb +2 -0
  137. data/lib/schematic/types/migration_error_code.rb +1 -0
  138. data/lib/schematic/types/plan_change_action.rb +2 -0
  139. data/lib/schematic/types/plan_change_response_data.rb +4 -0
  140. data/lib/schematic/types/plan_entitlement_response_data.rb +2 -0
  141. data/lib/schematic/types/publish_plan_version_request_body.rb +8 -0
  142. data/lib/schematic/types/publish_preview_interval_change_response_data.rb +13 -0
  143. data/lib/schematic/types/publish_preview_response_data.rb +6 -0
  144. data/lib/schematic/types/scheduled_downgrade_response_data.rb +4 -0
  145. data/lib/schematic/types/stripe_integration_config.rb +2 -0
  146. data/lib/schematic/types/trial_source.rb +15 -0
  147. data/lib/schematic/types/update_entitlement_req_common.rb +2 -0
  148. data/lib/schematic/types/web_scheduled_downgrade_webhook_output.rb +2 -0
  149. data/lib/schematic/version.rb +1 -1
  150. data/lib/schematic/webhooks/client.rb +10 -10
  151. data/lib/schematic.rb +79 -5
  152. data/reference.md +5208 -3800
  153. metadata +70 -2
@@ -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
@@ -9,6 +9,8 @@ module Schematic
9
9
  field :currency, -> { Schematic::Types::Currency }, optional: true, nullable: false
10
10
 
11
11
  field :selected_plan_id, -> { String }, optional: true, nullable: false
12
+
13
+ field :selected_plan_version_id, -> { String }, optional: true, nullable: false
12
14
  end
13
15
  end
14
16
  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
@@ -2,200 +2,6 @@
2
2
 
3
3
  module Schematic
4
4
  class Client
5
- # @param request_options [Hash]
6
- # @param _params [Hash]
7
- # @option request_options [String] :base_url
8
- # @option request_options [Hash{String => Object}] :additional_headers
9
- # @option request_options [Hash{String => Object}] :additional_query_parameters
10
- # @option request_options [Hash{String => Object}] :additional_body_parameters
11
- # @option request_options [Integer] :timeout_in_seconds
12
- #
13
- # @example
14
- # client.post_api_keys
15
- #
16
- # @return [untyped]
17
- def post_api_keys(request_options: {}, **_params)
18
- request = Schematic::Internal::JSON::Request.new(
19
- base_url: request_options[:base_url],
20
- method: "POST",
21
- path: "api-keys",
22
- request_options: request_options
23
- )
24
- begin
25
- response = @client.send(request)
26
- rescue Net::HTTPRequestTimeout
27
- raise Schematic::Errors::TimeoutError
28
- end
29
- code = response.code.to_i
30
- return if code.between?(200, 299)
31
-
32
- error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
33
- raise error_class.new(response.body, code: code)
34
- end
35
-
36
- # @param request_options [Hash]
37
- # @param params [Hash]
38
- # @option request_options [String] :base_url
39
- # @option request_options [Hash{String => Object}] :additional_headers
40
- # @option request_options [Hash{String => Object}] :additional_query_parameters
41
- # @option request_options [Hash{String => Object}] :additional_body_parameters
42
- # @option request_options [Integer] :timeout_in_seconds
43
- # @option params [String] :api_key_id
44
- #
45
- # @example
46
- # client.put_api_keys_api_key_id(api_key_id: "api_key_id")
47
- #
48
- # @return [untyped]
49
- def put_api_keys_api_key_id(request_options: {}, **params)
50
- params = Schematic::Internal::Types::Utils.normalize_keys(params)
51
- request = Schematic::Internal::JSON::Request.new(
52
- base_url: request_options[:base_url],
53
- method: "PUT",
54
- path: "api-keys/#{URI.encode_uri_component(params[:api_key_id].to_s)}",
55
- request_options: request_options
56
- )
57
- begin
58
- response = @client.send(request)
59
- rescue Net::HTTPRequestTimeout
60
- raise Schematic::Errors::TimeoutError
61
- end
62
- code = response.code.to_i
63
- return if code.between?(200, 299)
64
-
65
- error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
66
- raise error_class.new(response.body, code: code)
67
- end
68
-
69
- # @param request_options [Hash]
70
- # @param params [Hash]
71
- # @option request_options [String] :base_url
72
- # @option request_options [Hash{String => Object}] :additional_headers
73
- # @option request_options [Hash{String => Object}] :additional_query_parameters
74
- # @option request_options [Hash{String => Object}] :additional_body_parameters
75
- # @option request_options [Integer] :timeout_in_seconds
76
- # @option params [String] :api_key_id
77
- #
78
- # @example
79
- # client.delete_api_keys_api_key_id(api_key_id: "api_key_id")
80
- #
81
- # @return [untyped]
82
- def delete_api_keys_api_key_id(request_options: {}, **params)
83
- params = Schematic::Internal::Types::Utils.normalize_keys(params)
84
- request = Schematic::Internal::JSON::Request.new(
85
- base_url: request_options[:base_url],
86
- method: "DELETE",
87
- path: "api-keys/#{URI.encode_uri_component(params[:api_key_id].to_s)}",
88
- request_options: request_options
89
- )
90
- begin
91
- response = @client.send(request)
92
- rescue Net::HTTPRequestTimeout
93
- raise Schematic::Errors::TimeoutError
94
- end
95
- code = response.code.to_i
96
- return if code.between?(200, 299)
97
-
98
- error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
99
- raise error_class.new(response.body, code: code)
100
- end
101
-
102
- # @param request_options [Hash]
103
- # @param _params [Hash]
104
- # @option request_options [String] :base_url
105
- # @option request_options [Hash{String => Object}] :additional_headers
106
- # @option request_options [Hash{String => Object}] :additional_query_parameters
107
- # @option request_options [Hash{String => Object}] :additional_body_parameters
108
- # @option request_options [Integer] :timeout_in_seconds
109
- #
110
- # @example
111
- # client.post_environments
112
- #
113
- # @return [untyped]
114
- def post_environments(request_options: {}, **_params)
115
- request = Schematic::Internal::JSON::Request.new(
116
- base_url: request_options[:base_url],
117
- method: "POST",
118
- path: "environments",
119
- request_options: request_options
120
- )
121
- begin
122
- response = @client.send(request)
123
- rescue Net::HTTPRequestTimeout
124
- raise Schematic::Errors::TimeoutError
125
- end
126
- code = response.code.to_i
127
- return if code.between?(200, 299)
128
-
129
- error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
130
- raise error_class.new(response.body, code: code)
131
- end
132
-
133
- # @param request_options [Hash]
134
- # @param params [Hash]
135
- # @option request_options [String] :base_url
136
- # @option request_options [Hash{String => Object}] :additional_headers
137
- # @option request_options [Hash{String => Object}] :additional_query_parameters
138
- # @option request_options [Hash{String => Object}] :additional_body_parameters
139
- # @option request_options [Integer] :timeout_in_seconds
140
- # @option params [String] :environment_id
141
- #
142
- # @example
143
- # client.put_environments_environment_id(environment_id: "environment_id")
144
- #
145
- # @return [untyped]
146
- def put_environments_environment_id(request_options: {}, **params)
147
- params = Schematic::Internal::Types::Utils.normalize_keys(params)
148
- request = Schematic::Internal::JSON::Request.new(
149
- base_url: request_options[:base_url],
150
- method: "PUT",
151
- path: "environments/#{URI.encode_uri_component(params[:environment_id].to_s)}",
152
- request_options: request_options
153
- )
154
- begin
155
- response = @client.send(request)
156
- rescue Net::HTTPRequestTimeout
157
- raise Schematic::Errors::TimeoutError
158
- end
159
- code = response.code.to_i
160
- return if code.between?(200, 299)
161
-
162
- error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
163
- raise error_class.new(response.body, code: code)
164
- end
165
-
166
- # @param request_options [Hash]
167
- # @param params [Hash]
168
- # @option request_options [String] :base_url
169
- # @option request_options [Hash{String => Object}] :additional_headers
170
- # @option request_options [Hash{String => Object}] :additional_query_parameters
171
- # @option request_options [Hash{String => Object}] :additional_body_parameters
172
- # @option request_options [Integer] :timeout_in_seconds
173
- # @option params [String] :environment_id
174
- #
175
- # @example
176
- # client.delete_environments_environment_id(environment_id: "environment_id")
177
- #
178
- # @return [untyped]
179
- def delete_environments_environment_id(request_options: {}, **params)
180
- params = Schematic::Internal::Types::Utils.normalize_keys(params)
181
- request = Schematic::Internal::JSON::Request.new(
182
- base_url: request_options[:base_url],
183
- method: "DELETE",
184
- path: "environments/#{URI.encode_uri_component(params[:environment_id].to_s)}",
185
- request_options: request_options
186
- )
187
- begin
188
- response = @client.send(request)
189
- rescue Net::HTTPRequestTimeout
190
- raise Schematic::Errors::TimeoutError
191
- end
192
- code = response.code.to_i
193
- return if code.between?(200, 299)
194
-
195
- error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
196
- raise error_class.new(response.body, code: code)
197
- end
198
-
199
5
  # @param request_options [Hash]
200
6
  # @param _params [Hash]
201
7
  # @option request_options [String] :base_url
@@ -224,7 +30,7 @@ module Schematic
224
30
  return if code.between?(200, 299)
225
31
 
226
32
  error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
227
- raise error_class.new(response.body, code: code)
33
+ raise error_class.new(response.body, code: code, headers: response.to_hash)
228
34
  end
229
35
 
230
36
  # @param api_key [String]
@@ -237,7 +43,7 @@ module Schematic
237
43
  @raw_client = Schematic::Internal::Http::RawClient.new(
238
44
  base_url: base_url || Schematic::Environment::DEFAULT,
239
45
  headers: {
240
- "User-Agent" => "schematichq/1.5.7",
46
+ "User-Agent" => "schematichq/1.5.9",
241
47
  "X-Fern-Language" => "Ruby",
242
48
  "X-Schematic-Api-Key" => api_key.to_s
243
49
  },
@@ -296,6 +102,11 @@ module Schematic
296
102
  @planbundle ||= Schematic::Planbundle::Client.new(client: @raw_client)
297
103
  end
298
104
 
105
+ # @return [Schematic::Customplangrouprollouts::Client]
106
+ def customplangrouprollouts
107
+ @customplangrouprollouts ||= Schematic::Customplangrouprollouts::Client.new(client: @raw_client)
108
+ end
109
+
299
110
  # @return [Schematic::Dataexports::Client]
300
111
  def dataexports
301
112
  @dataexports ||= Schematic::Dataexports::Client.new(client: @raw_client)