schematichq 1.5.4 → 1.5.6

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 (131) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +4 -4
  3. data/.fern/replay.lock +13 -1
  4. data/WASM_VERSION +1 -1
  5. data/lib/schematic/accounts/client.rb +0 -271
  6. data/lib/schematic/billing/client.rb +447 -0
  7. data/lib/schematic/billing/types/count_billing_invoices_params.rb +28 -0
  8. data/lib/schematic/billing/types/count_billing_invoices_request.rb +27 -0
  9. data/lib/schematic/billing/types/count_billing_invoices_response.rb +13 -0
  10. data/lib/schematic/billing/types/create_payment_method_request_body.rb +2 -0
  11. data/lib/schematic/billing/types/finalize_native_invoice_response.rb +13 -0
  12. data/lib/schematic/{accounts/types/delete_environment_response.rb → billing/types/get_billing_invoice_response.rb} +3 -3
  13. data/lib/schematic/billing/types/get_company_native_subscription_response.rb +13 -0
  14. data/lib/schematic/billing/types/list_billing_invoices_params.rb +28 -0
  15. data/lib/schematic/billing/types/list_billing_invoices_request.rb +27 -0
  16. data/lib/schematic/billing/types/list_billing_invoices_response.rb +13 -0
  17. data/lib/schematic/billing/types/mark_billing_invoice_paid_response.rb +13 -0
  18. data/lib/schematic/billing/types/mark_invoice_paid_request_body.rb +19 -0
  19. data/lib/schematic/billing/types/void_native_invoice_response.rb +13 -0
  20. data/lib/schematic/catalogs/client.rb +82 -0
  21. data/lib/schematic/{accounts/types/create_api_key_response.rb → catalogs/types/get_public_catalog_by_id_response.rb} +3 -3
  22. data/lib/schematic/{accounts/types/delete_api_key_response.rb → catalogs/types/get_public_catalog_response.rb} +3 -3
  23. data/lib/schematic/client.rb +195 -1
  24. data/lib/schematic/credits/client.rb +48 -0
  25. data/lib/schematic/credits/types/count_credit_event_ledger_params.rb +2 -0
  26. data/lib/schematic/credits/types/count_credit_event_ledger_request.rb +2 -0
  27. data/lib/schematic/{accounts/types/create_environment_response.rb → credits/types/get_credit_event_ledger_entry_response.rb} +3 -3
  28. data/lib/schematic/credits/types/list_credit_event_ledger_params.rb +2 -0
  29. data/lib/schematic/credits/types/list_credit_event_ledger_request.rb +2 -0
  30. data/lib/schematic/features/client.rb +0 -2
  31. data/lib/schematic/internal/iterators/cursor_item_iterator.rb +2 -2
  32. data/lib/schematic/internal/iterators/cursor_page_iterator.rb +11 -2
  33. data/lib/schematic/internal/iterators/item_iterator.rb +11 -2
  34. data/lib/schematic/internal/iterators/offset_item_iterator.rb +2 -2
  35. data/lib/schematic/internal/iterators/offset_page_iterator.rb +15 -6
  36. data/lib/schematic/internal/types/model.rb +17 -1
  37. data/lib/schematic/planbundle/types/create_custom_plan_bundle_request_body.rb +2 -0
  38. data/lib/schematic/planbundle/types/create_plan_bundle_request_body.rb +2 -0
  39. data/lib/schematic/planbundle/types/update_plan_bundle_request_body.rb +2 -0
  40. data/lib/schematic/plans/client.rb +61 -5
  41. data/lib/schematic/plans/types/list_custom_plan_billings_params.rb +4 -0
  42. data/lib/schematic/plans/types/list_custom_plan_billings_request.rb +4 -0
  43. data/lib/schematic/plans/types/preview_publish_plan_version_response.rb +13 -0
  44. data/lib/schematic/plans/types/retry_custom_plan_billing_request_body.rb +2 -0
  45. data/lib/schematic/types/amendment_proration_lands_on.rb +13 -0
  46. data/lib/schematic/types/billing_invoice_address_response_data.rb +19 -0
  47. data/lib/schematic/types/billing_invoice_billing_details_response_data.rb +15 -0
  48. data/lib/schematic/types/billing_invoice_detail_response_data.rb +65 -0
  49. data/lib/schematic/types/billing_invoice_line_response_data.rb +31 -0
  50. data/lib/schematic/types/billing_invoice_response_data.rb +51 -0
  51. data/lib/schematic/types/billing_invoice_settlement_response_data.rb +17 -0
  52. data/lib/schematic/types/billing_invoice_tax_id_response_data.rb +11 -0
  53. data/lib/schematic/types/billing_invoice_terms_response_data.rb +21 -0
  54. data/lib/schematic/types/billing_native_subscription_change_response_data.rb +15 -0
  55. data/lib/schematic/types/billing_native_subscription_line_response_data.rb +47 -0
  56. data/lib/schematic/types/billing_native_subscription_response_data.rb +31 -0
  57. data/lib/schematic/types/billing_plan_credit_grant_response_data.rb +2 -0
  58. data/lib/schematic/types/billing_plan_credit_grant_warning_tier_response_data.rb +13 -0
  59. data/lib/schematic/types/billing_statement_line_response_data.rb +21 -0
  60. data/lib/schematic/types/billing_statement_response_data.rb +19 -0
  61. data/lib/schematic/types/catalog_bundle_currency_price_response_data.rb +13 -0
  62. data/lib/schematic/types/catalog_capabilities_response_data.rb +11 -0
  63. data/lib/schematic/types/catalog_credit_bundle_response_data.rb +39 -0
  64. data/lib/schematic/types/catalog_credit_grant_response_data.rb +29 -0
  65. data/lib/schematic/types/catalog_currency_prices_response_data.rb +17 -0
  66. data/lib/schematic/types/catalog_custom_plan_cta_response_data.rb +13 -0
  67. data/lib/schematic/types/catalog_detail_response_data.rb +23 -0
  68. data/lib/schematic/types/catalog_entitlement_response_data.rb +61 -0
  69. data/lib/schematic/types/catalog_plan_entitlement_response_data.rb +63 -0
  70. data/lib/schematic/types/catalog_plan_response_data.rb +41 -0
  71. data/lib/schematic/types/catalog_price_response_data.rb +29 -0
  72. data/lib/schematic/types/catalog_price_tier_response_data.rb +17 -0
  73. data/lib/schematic/types/charge_timing.rb +12 -0
  74. data/lib/schematic/types/checkout_charge_timing.rb +13 -0
  75. data/lib/schematic/types/checkout_problem_code.rb +4 -0
  76. data/lib/schematic/types/collector.rb +13 -0
  77. data/lib/schematic/types/company_billing_profile_response_data.rb +12 -0
  78. data/lib/schematic/types/company_credit_balance.rb +4 -0
  79. data/lib/schematic/types/create_billing_plan_credit_grant_request_body.rb +2 -0
  80. data/lib/schematic/types/create_flag_request_body.rb +1 -1
  81. data/lib/schematic/types/create_or_update_flag_request_body.rb +1 -1
  82. data/lib/schematic/types/credit_spend_policy.rb +2 -0
  83. data/lib/schematic/types/credit_spend_window_unit.rb +2 -0
  84. data/lib/schematic/types/custom_plan_billing_response_data.rb +2 -0
  85. data/lib/schematic/types/entitlement_type.rb +1 -0
  86. data/lib/schematic/types/event_body.rb +3 -3
  87. data/lib/schematic/types/event_body_inference.rb +4 -0
  88. data/lib/schematic/types/flag_detail_response_data.rb +1 -1
  89. data/lib/schematic/types/flag_in_plan_response_data.rb +1 -1
  90. data/lib/schematic/types/flag_response_data.rb +1 -1
  91. data/lib/schematic/types/invoice_collection_state.rb +17 -0
  92. data/lib/schematic/types/invoice_document_state.rb +14 -0
  93. data/lib/schematic/types/invoice_line_kind.rb +15 -0
  94. data/lib/schematic/types/line_kind.rb +13 -0
  95. data/lib/schematic/types/payment_gating.rb +12 -0
  96. data/lib/schematic/types/payment_method_billing_details_request_body.rb +13 -0
  97. data/lib/schematic/types/plan_credit_grant_warning_tier_request_body.rb +11 -0
  98. data/lib/schematic/types/plan_version_migration_preview_company_response_data.rb +2 -0
  99. data/lib/schematic/types/plan_version_migration_preview_note_response_data.rb +13 -0
  100. data/lib/schematic/types/plan_version_response_data.rb +2 -0
  101. data/lib/schematic/types/preflight_event_quantities_request_body.rb +13 -0
  102. data/lib/schematic/types/preflight_request_body.rb +2 -0
  103. data/lib/schematic/types/preview_subscription_finance_response_data.rb +6 -0
  104. data/lib/schematic/types/preview_subscription_proration_line_response_data.rb +21 -0
  105. data/lib/schematic/types/preview_subscription_proration_response_data.rb +21 -0
  106. data/lib/schematic/types/proration_line_kind.rb +12 -0
  107. data/lib/schematic/types/public_catalog_response_data.rb +29 -0
  108. data/lib/schematic/types/publish_plan_version_request_body.rb +45 -0
  109. data/lib/schematic/types/publish_preview_pay_in_advance_response_data.rb +15 -0
  110. data/lib/schematic/types/publish_preview_payment_method_response_data.rb +15 -0
  111. data/lib/schematic/types/publish_preview_proration_line_response_data.rb +19 -0
  112. data/lib/schematic/types/publish_preview_response_data.rb +55 -0
  113. data/lib/schematic/types/renewal_policy.rb +13 -0
  114. data/lib/schematic/types/rulesengine_credit_spend_policy.rb +2 -0
  115. data/lib/schematic/types/subscription_change_action.rb +14 -0
  116. data/lib/schematic/types/update_billing_plan_credit_grant_request_body.rb +2 -0
  117. data/lib/schematic/types/webhook_request_type.rb +1 -0
  118. data/lib/schematic/version.rb +1 -1
  119. data/lib/schematic/wasm/rulesengine.wasm +0 -0
  120. data/lib/schematic.rb +71 -18
  121. data/reference.md +1148 -506
  122. metadata +68 -15
  123. data/lib/schematic/accounts/types/create_api_key_request_body.rb +0 -19
  124. data/lib/schematic/accounts/types/create_environment_request_body.rb +0 -13
  125. data/lib/schematic/accounts/types/update_api_key_request_body.rb +0 -17
  126. data/lib/schematic/accounts/types/update_api_key_response.rb +0 -13
  127. data/lib/schematic/accounts/types/update_environment_request_body.rb +0 -17
  128. data/lib/schematic/accounts/types/update_environment_response.rb +0 -13
  129. data/lib/schematic/plans/types/publish_plan_version_request_body.rb +0 -47
  130. data/lib/schematic/types/api_key_create_response_data.rb +0 -33
  131. data/lib/schematic/types/environment_detail_response_data.rb +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a09b3fd4444f8804b0435423457f1333f592ffe618ff57488b15174d141c35a2
4
- data.tar.gz: 0da14e3105628a9695d10fffaea98e6a7a61e2662b182596dba860219dc77527
3
+ metadata.gz: a862b878399698534b16a1bf79ccebb298be7977d82d29520d29c0420ae741b4
4
+ data.tar.gz: 8b60a87a97fcf41ad5630836ff24f24848cd91866976f5ae6caf26315660c736
5
5
  SHA512:
6
- metadata.gz: fb2f546051bcdc3a425df3364dd7f52a4b5cf72fb02a1d048c629871a507ea269d8ce081a1d2674e59b1c4bb2b6ba810eb03cb522e4a593a968727ab8e77dd26
7
- data.tar.gz: '08a7e55cac3897c9907716ee2d3125c65417187e0dbd4dc07595d7a498f7f0e8c023b02a846b0cd7898709a23c70078da86769c9229c8c49f05fe5e935afee83'
6
+ metadata.gz: 0241c716dd93ee78db02b86efd958da5d72f81e80b9882d8091873772b1301eed2aefb2106c39cee58489aa3aa820ff32696edbb341835c85765dab1e577dd64
7
+ data.tar.gz: 2beb58f1af4fc20c54ece7e83c81ebf54caa583777ff6aaa34ed4df9ee83b631cf13ec136d720ba4c853cc563540231346c0f5686404d132bf2f06c7eeba30dd
data/.fern/metadata.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "cliVersion": "5.50.0",
3
3
  "generatorName": "fernapi/fern-ruby-sdk",
4
- "generatorVersion": "1.38.1",
4
+ "generatorVersion": "1.39.2",
5
5
  "generatorConfig": {
6
6
  "module": "SchematicHQ",
7
7
  "rubocopVariableNumberStyle": "disabled",
@@ -13,10 +13,10 @@
13
13
  "webrick": ">= 1.0"
14
14
  }
15
15
  },
16
- "originGitCommit": "32d45f2e03c55876e040549ec59d6cdd7a39625a",
16
+ "originGitCommit": "9c3d404a6ed3ff63811ecbef9e2814ea8607f22d",
17
17
  "originGitCommitIsDirty": false,
18
18
  "invokedBy": "ci",
19
- "requestedVersion": "1.5.4",
19
+ "requestedVersion": "1.5.6",
20
20
  "ciProvider": "github",
21
- "sdkVersion": "1.5.4"
21
+ "sdkVersion": "1.5.6"
22
22
  }
data/.fern/replay.lock CHANGED
@@ -126,5 +126,17 @@ generations:
126
126
  cli_version: unknown
127
127
  generator_versions:
128
128
  fernapi/fern-ruby-sdk: 1.38.1
129
- current_generation: 0ee9b7004b9ec21c5c07e28948b2d2a3798235e7
129
+ - commit_sha: 60825ceebf79189539133a284ec196b6fbf2288a
130
+ tree_hash: a16b642da4f1a16eb902cc855ed189a7bf0cb1d0
131
+ timestamp: 2026-10-19T10:02:37.303Z
132
+ cli_version: unknown
133
+ generator_versions:
134
+ fernapi/fern-ruby-sdk: 1.39.1
135
+ - commit_sha: 0da986ad01727b881dd7be3de79dbb7875b69689
136
+ tree_hash: 73e72e0093a7ddc623e8455f10ccbb32a00547be
137
+ timestamp: 2026-10-26T10:06:03.015Z
138
+ cli_version: unknown
139
+ generator_versions:
140
+ fernapi/fern-ruby-sdk: 1.39.2
141
+ current_generation: 0da986ad01727b881dd7be3de79dbb7875b69689
130
142
  patches: []
data/WASM_VERSION CHANGED
@@ -1 +1 @@
1
- 0.10.0
1
+ 0.11.0
@@ -232,49 +232,6 @@ module Schematic
232
232
  end
233
233
  end
234
234
 
235
- # @param request_options [Hash]
236
- # @param params [Schematic::Accounts::Types::CreateApiKeyRequestBody]
237
- # @option request_options [String] :base_url
238
- # @option request_options [Hash{String => Object}] :additional_headers
239
- # @option request_options [Hash{String => Object}] :additional_query_parameters
240
- # @option request_options [Hash{String => Object}] :additional_body_parameters
241
- # @option request_options [Integer] :timeout_in_seconds
242
- #
243
- # @example
244
- # client.accounts.create_api_key(name: "name")
245
- #
246
- # @return [Schematic::Accounts::Types::CreateApiKeyResponse]
247
- def create_api_key(request_options: {}, **params)
248
- params = Schematic::Internal::Types::Utils.normalize_keys(params)
249
- request = Schematic::Internal::JSON::Request.new(
250
- base_url: request_options[:base_url],
251
- method: "POST",
252
- path: "api-keys",
253
- body: Schematic::Accounts::Types::CreateApiKeyRequestBody.new(params).to_h,
254
- request_options: request_options
255
- )
256
- begin
257
- response = @client.send(request)
258
- rescue Net::HTTPRequestTimeout
259
- raise Schematic::Errors::TimeoutError
260
- end
261
- code = response.code.to_i
262
- if code.between?(200, 299)
263
- (response.body.to_s.empty? ? nil : Schematic::Accounts::Types::CreateApiKeyResponse.load(response.body))
264
- else
265
- error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
266
- error_types = {
267
- 400 => Schematic::Types::ApiError,
268
- 401 => Schematic::Types::ApiError,
269
- 403 => Schematic::Types::ApiError,
270
- 404 => Schematic::Types::ApiError,
271
- 500 => Schematic::Types::ApiError
272
- }
273
- error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
274
- raise error_class.new(response.body, code: code, body: error_body)
275
- end
276
- end
277
-
278
235
  # @param request_options [Hash]
279
236
  # @param params [Hash]
280
237
  # @option request_options [String] :base_url
@@ -317,97 +274,6 @@ module Schematic
317
274
  end
318
275
  end
319
276
 
320
- # @param request_options [Hash]
321
- # @param params [Schematic::Accounts::Types::UpdateApiKeyRequestBody]
322
- # @option request_options [String] :base_url
323
- # @option request_options [Hash{String => Object}] :additional_headers
324
- # @option request_options [Hash{String => Object}] :additional_query_parameters
325
- # @option request_options [Hash{String => Object}] :additional_body_parameters
326
- # @option request_options [Integer] :timeout_in_seconds
327
- # @option params [String] :api_key_id
328
- #
329
- # @example
330
- # client.accounts.update_api_key(api_key_id: "api_key_id")
331
- #
332
- # @return [Schematic::Accounts::Types::UpdateApiKeyResponse]
333
- def update_api_key(request_options: {}, **params)
334
- params = Schematic::Internal::Types::Utils.normalize_keys(params)
335
- request_data = Schematic::Accounts::Types::UpdateApiKeyRequestBody.new(params).to_h
336
- non_body_param_names = %w[api_key_id]
337
- body = request_data.except(*non_body_param_names)
338
-
339
- request = Schematic::Internal::JSON::Request.new(
340
- base_url: request_options[:base_url],
341
- method: "PUT",
342
- path: "api-keys/#{URI.encode_uri_component(params[:api_key_id].to_s)}",
343
- body: body,
344
- request_options: request_options
345
- )
346
- begin
347
- response = @client.send(request)
348
- rescue Net::HTTPRequestTimeout
349
- raise Schematic::Errors::TimeoutError
350
- end
351
- code = response.code.to_i
352
- if code.between?(200, 299)
353
- (response.body.to_s.empty? ? nil : Schematic::Accounts::Types::UpdateApiKeyResponse.load(response.body))
354
- else
355
- error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
356
- error_types = {
357
- 400 => Schematic::Types::ApiError,
358
- 401 => Schematic::Types::ApiError,
359
- 403 => Schematic::Types::ApiError,
360
- 404 => Schematic::Types::ApiError,
361
- 500 => Schematic::Types::ApiError
362
- }
363
- error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
364
- raise error_class.new(response.body, code: code, body: error_body)
365
- end
366
- end
367
-
368
- # @param request_options [Hash]
369
- # @param params [Hash]
370
- # @option request_options [String] :base_url
371
- # @option request_options [Hash{String => Object}] :additional_headers
372
- # @option request_options [Hash{String => Object}] :additional_query_parameters
373
- # @option request_options [Hash{String => Object}] :additional_body_parameters
374
- # @option request_options [Integer] :timeout_in_seconds
375
- # @option params [String] :api_key_id
376
- #
377
- # @example
378
- # client.accounts.delete_api_key(api_key_id: "api_key_id")
379
- #
380
- # @return [Schematic::Accounts::Types::DeleteApiKeyResponse]
381
- def delete_api_key(request_options: {}, **params)
382
- params = Schematic::Internal::Types::Utils.normalize_keys(params)
383
- request = Schematic::Internal::JSON::Request.new(
384
- base_url: request_options[:base_url],
385
- method: "DELETE",
386
- path: "api-keys/#{URI.encode_uri_component(params[:api_key_id].to_s)}",
387
- request_options: request_options
388
- )
389
- begin
390
- response = @client.send(request)
391
- rescue Net::HTTPRequestTimeout
392
- raise Schematic::Errors::TimeoutError
393
- end
394
- code = response.code.to_i
395
- if code.between?(200, 299)
396
- (response.body.to_s.empty? ? nil : Schematic::Accounts::Types::DeleteApiKeyResponse.load(response.body))
397
- else
398
- error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
399
- error_types = {
400
- 400 => Schematic::Types::ApiError,
401
- 401 => Schematic::Types::ApiError,
402
- 403 => Schematic::Types::ApiError,
403
- 404 => Schematic::Types::ApiError,
404
- 500 => Schematic::Types::ApiError
405
- }
406
- error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
407
- raise error_class.new(response.body, code: code, body: error_body)
408
- end
409
- end
410
-
411
277
  # @param request_options [Hash]
412
278
  # @param params [Hash]
413
279
  # @option request_options [String] :base_url
@@ -697,52 +563,6 @@ module Schematic
697
563
  end
698
564
  end
699
565
 
700
- # @param request_options [Hash]
701
- # @param params [Schematic::Accounts::Types::CreateEnvironmentRequestBody]
702
- # @option request_options [String] :base_url
703
- # @option request_options [Hash{String => Object}] :additional_headers
704
- # @option request_options [Hash{String => Object}] :additional_query_parameters
705
- # @option request_options [Hash{String => Object}] :additional_body_parameters
706
- # @option request_options [Integer] :timeout_in_seconds
707
- #
708
- # @example
709
- # client.accounts.create_environment(
710
- # environment_type: "development",
711
- # name: "name"
712
- # )
713
- #
714
- # @return [Schematic::Accounts::Types::CreateEnvironmentResponse]
715
- def create_environment(request_options: {}, **params)
716
- params = Schematic::Internal::Types::Utils.normalize_keys(params)
717
- request = Schematic::Internal::JSON::Request.new(
718
- base_url: request_options[:base_url],
719
- method: "POST",
720
- path: "environments",
721
- body: Schematic::Accounts::Types::CreateEnvironmentRequestBody.new(params).to_h,
722
- request_options: request_options
723
- )
724
- begin
725
- response = @client.send(request)
726
- rescue Net::HTTPRequestTimeout
727
- raise Schematic::Errors::TimeoutError
728
- end
729
- code = response.code.to_i
730
- if code.between?(200, 299)
731
- (response.body.to_s.empty? ? nil : Schematic::Accounts::Types::CreateEnvironmentResponse.load(response.body))
732
- else
733
- error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
734
- error_types = {
735
- 400 => Schematic::Types::ApiError,
736
- 401 => Schematic::Types::ApiError,
737
- 403 => Schematic::Types::ApiError,
738
- 404 => Schematic::Types::ApiError,
739
- 500 => Schematic::Types::ApiError
740
- }
741
- error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
742
- raise error_class.new(response.body, code: code, body: error_body)
743
- end
744
- end
745
-
746
566
  # @param request_options [Hash]
747
567
  # @param params [Hash]
748
568
  # @option request_options [String] :base_url
@@ -785,97 +605,6 @@ module Schematic
785
605
  end
786
606
  end
787
607
 
788
- # @param request_options [Hash]
789
- # @param params [Schematic::Accounts::Types::UpdateEnvironmentRequestBody]
790
- # @option request_options [String] :base_url
791
- # @option request_options [Hash{String => Object}] :additional_headers
792
- # @option request_options [Hash{String => Object}] :additional_query_parameters
793
- # @option request_options [Hash{String => Object}] :additional_body_parameters
794
- # @option request_options [Integer] :timeout_in_seconds
795
- # @option params [String] :environment_id
796
- #
797
- # @example
798
- # client.accounts.update_environment(environment_id: "environment_id")
799
- #
800
- # @return [Schematic::Accounts::Types::UpdateEnvironmentResponse]
801
- def update_environment(request_options: {}, **params)
802
- params = Schematic::Internal::Types::Utils.normalize_keys(params)
803
- request_data = Schematic::Accounts::Types::UpdateEnvironmentRequestBody.new(params).to_h
804
- non_body_param_names = %w[environment_id]
805
- body = request_data.except(*non_body_param_names)
806
-
807
- request = Schematic::Internal::JSON::Request.new(
808
- base_url: request_options[:base_url],
809
- method: "PUT",
810
- path: "environments/#{URI.encode_uri_component(params[:environment_id].to_s)}",
811
- body: body,
812
- request_options: request_options
813
- )
814
- begin
815
- response = @client.send(request)
816
- rescue Net::HTTPRequestTimeout
817
- raise Schematic::Errors::TimeoutError
818
- end
819
- code = response.code.to_i
820
- if code.between?(200, 299)
821
- (response.body.to_s.empty? ? nil : Schematic::Accounts::Types::UpdateEnvironmentResponse.load(response.body))
822
- else
823
- error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
824
- error_types = {
825
- 400 => Schematic::Types::ApiError,
826
- 401 => Schematic::Types::ApiError,
827
- 403 => Schematic::Types::ApiError,
828
- 404 => Schematic::Types::ApiError,
829
- 500 => Schematic::Types::ApiError
830
- }
831
- error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
832
- raise error_class.new(response.body, code: code, body: error_body)
833
- end
834
- end
835
-
836
- # @param request_options [Hash]
837
- # @param params [Hash]
838
- # @option request_options [String] :base_url
839
- # @option request_options [Hash{String => Object}] :additional_headers
840
- # @option request_options [Hash{String => Object}] :additional_query_parameters
841
- # @option request_options [Hash{String => Object}] :additional_body_parameters
842
- # @option request_options [Integer] :timeout_in_seconds
843
- # @option params [String] :environment_id
844
- #
845
- # @example
846
- # client.accounts.delete_environment(environment_id: "environment_id")
847
- #
848
- # @return [Schematic::Accounts::Types::DeleteEnvironmentResponse]
849
- def delete_environment(request_options: {}, **params)
850
- params = Schematic::Internal::Types::Utils.normalize_keys(params)
851
- request = Schematic::Internal::JSON::Request.new(
852
- base_url: request_options[:base_url],
853
- method: "DELETE",
854
- path: "environments/#{URI.encode_uri_component(params[:environment_id].to_s)}",
855
- request_options: request_options
856
- )
857
- begin
858
- response = @client.send(request)
859
- rescue Net::HTTPRequestTimeout
860
- raise Schematic::Errors::TimeoutError
861
- end
862
- code = response.code.to_i
863
- if code.between?(200, 299)
864
- (response.body.to_s.empty? ? nil : Schematic::Accounts::Types::DeleteEnvironmentResponse.load(response.body))
865
- else
866
- error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
867
- error_types = {
868
- 400 => Schematic::Types::ApiError,
869
- 401 => Schematic::Types::ApiError,
870
- 403 => Schematic::Types::ApiError,
871
- 404 => Schematic::Types::ApiError,
872
- 500 => Schematic::Types::ApiError
873
- }
874
- error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
875
- raise error_class.new(response.body, code: code, body: error_body)
876
- end
877
- end
878
-
879
608
  # @param request_options [Hash]
880
609
  # @param _params [Hash]
881
610
  # @option request_options [String] :base_url