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.
- checksums.yaml +4 -4
- data/.fern/metadata.json +4 -4
- data/.fern/replay.lock +13 -1
- data/WASM_VERSION +1 -1
- data/lib/schematic/accounts/client.rb +0 -271
- data/lib/schematic/billing/client.rb +447 -0
- data/lib/schematic/billing/types/count_billing_invoices_params.rb +28 -0
- data/lib/schematic/billing/types/count_billing_invoices_request.rb +27 -0
- data/lib/schematic/billing/types/count_billing_invoices_response.rb +13 -0
- data/lib/schematic/billing/types/create_payment_method_request_body.rb +2 -0
- data/lib/schematic/billing/types/finalize_native_invoice_response.rb +13 -0
- data/lib/schematic/{accounts/types/delete_environment_response.rb → billing/types/get_billing_invoice_response.rb} +3 -3
- data/lib/schematic/billing/types/get_company_native_subscription_response.rb +13 -0
- data/lib/schematic/billing/types/list_billing_invoices_params.rb +28 -0
- data/lib/schematic/billing/types/list_billing_invoices_request.rb +27 -0
- data/lib/schematic/billing/types/list_billing_invoices_response.rb +13 -0
- data/lib/schematic/billing/types/mark_billing_invoice_paid_response.rb +13 -0
- data/lib/schematic/billing/types/mark_invoice_paid_request_body.rb +19 -0
- data/lib/schematic/billing/types/void_native_invoice_response.rb +13 -0
- data/lib/schematic/catalogs/client.rb +82 -0
- data/lib/schematic/{accounts/types/create_api_key_response.rb → catalogs/types/get_public_catalog_by_id_response.rb} +3 -3
- data/lib/schematic/{accounts/types/delete_api_key_response.rb → catalogs/types/get_public_catalog_response.rb} +3 -3
- data/lib/schematic/client.rb +195 -1
- data/lib/schematic/credits/client.rb +48 -0
- data/lib/schematic/credits/types/count_credit_event_ledger_params.rb +2 -0
- data/lib/schematic/credits/types/count_credit_event_ledger_request.rb +2 -0
- data/lib/schematic/{accounts/types/create_environment_response.rb → credits/types/get_credit_event_ledger_entry_response.rb} +3 -3
- data/lib/schematic/credits/types/list_credit_event_ledger_params.rb +2 -0
- data/lib/schematic/credits/types/list_credit_event_ledger_request.rb +2 -0
- data/lib/schematic/features/client.rb +0 -2
- data/lib/schematic/internal/iterators/cursor_item_iterator.rb +2 -2
- data/lib/schematic/internal/iterators/cursor_page_iterator.rb +11 -2
- data/lib/schematic/internal/iterators/item_iterator.rb +11 -2
- data/lib/schematic/internal/iterators/offset_item_iterator.rb +2 -2
- data/lib/schematic/internal/iterators/offset_page_iterator.rb +15 -6
- data/lib/schematic/internal/types/model.rb +17 -1
- data/lib/schematic/planbundle/types/create_custom_plan_bundle_request_body.rb +2 -0
- data/lib/schematic/planbundle/types/create_plan_bundle_request_body.rb +2 -0
- data/lib/schematic/planbundle/types/update_plan_bundle_request_body.rb +2 -0
- data/lib/schematic/plans/client.rb +61 -5
- data/lib/schematic/plans/types/list_custom_plan_billings_params.rb +4 -0
- data/lib/schematic/plans/types/list_custom_plan_billings_request.rb +4 -0
- data/lib/schematic/plans/types/preview_publish_plan_version_response.rb +13 -0
- data/lib/schematic/plans/types/retry_custom_plan_billing_request_body.rb +2 -0
- data/lib/schematic/types/amendment_proration_lands_on.rb +13 -0
- data/lib/schematic/types/billing_invoice_address_response_data.rb +19 -0
- data/lib/schematic/types/billing_invoice_billing_details_response_data.rb +15 -0
- data/lib/schematic/types/billing_invoice_detail_response_data.rb +65 -0
- data/lib/schematic/types/billing_invoice_line_response_data.rb +31 -0
- data/lib/schematic/types/billing_invoice_response_data.rb +51 -0
- data/lib/schematic/types/billing_invoice_settlement_response_data.rb +17 -0
- data/lib/schematic/types/billing_invoice_tax_id_response_data.rb +11 -0
- data/lib/schematic/types/billing_invoice_terms_response_data.rb +21 -0
- data/lib/schematic/types/billing_native_subscription_change_response_data.rb +15 -0
- data/lib/schematic/types/billing_native_subscription_line_response_data.rb +47 -0
- data/lib/schematic/types/billing_native_subscription_response_data.rb +31 -0
- data/lib/schematic/types/billing_plan_credit_grant_response_data.rb +2 -0
- data/lib/schematic/types/billing_plan_credit_grant_warning_tier_response_data.rb +13 -0
- data/lib/schematic/types/billing_statement_line_response_data.rb +21 -0
- data/lib/schematic/types/billing_statement_response_data.rb +19 -0
- data/lib/schematic/types/catalog_bundle_currency_price_response_data.rb +13 -0
- data/lib/schematic/types/catalog_capabilities_response_data.rb +11 -0
- data/lib/schematic/types/catalog_credit_bundle_response_data.rb +39 -0
- data/lib/schematic/types/catalog_credit_grant_response_data.rb +29 -0
- data/lib/schematic/types/catalog_currency_prices_response_data.rb +17 -0
- data/lib/schematic/types/catalog_custom_plan_cta_response_data.rb +13 -0
- data/lib/schematic/types/catalog_detail_response_data.rb +23 -0
- data/lib/schematic/types/catalog_entitlement_response_data.rb +61 -0
- data/lib/schematic/types/catalog_plan_entitlement_response_data.rb +63 -0
- data/lib/schematic/types/catalog_plan_response_data.rb +41 -0
- data/lib/schematic/types/catalog_price_response_data.rb +29 -0
- data/lib/schematic/types/catalog_price_tier_response_data.rb +17 -0
- data/lib/schematic/types/charge_timing.rb +12 -0
- data/lib/schematic/types/checkout_charge_timing.rb +13 -0
- data/lib/schematic/types/checkout_problem_code.rb +4 -0
- data/lib/schematic/types/collector.rb +13 -0
- data/lib/schematic/types/company_billing_profile_response_data.rb +12 -0
- data/lib/schematic/types/company_credit_balance.rb +4 -0
- data/lib/schematic/types/create_billing_plan_credit_grant_request_body.rb +2 -0
- data/lib/schematic/types/create_flag_request_body.rb +1 -1
- data/lib/schematic/types/create_or_update_flag_request_body.rb +1 -1
- data/lib/schematic/types/credit_spend_policy.rb +2 -0
- data/lib/schematic/types/credit_spend_window_unit.rb +2 -0
- data/lib/schematic/types/custom_plan_billing_response_data.rb +2 -0
- data/lib/schematic/types/entitlement_type.rb +1 -0
- data/lib/schematic/types/event_body.rb +3 -3
- data/lib/schematic/types/event_body_inference.rb +4 -0
- data/lib/schematic/types/flag_detail_response_data.rb +1 -1
- data/lib/schematic/types/flag_in_plan_response_data.rb +1 -1
- data/lib/schematic/types/flag_response_data.rb +1 -1
- data/lib/schematic/types/invoice_collection_state.rb +17 -0
- data/lib/schematic/types/invoice_document_state.rb +14 -0
- data/lib/schematic/types/invoice_line_kind.rb +15 -0
- data/lib/schematic/types/line_kind.rb +13 -0
- data/lib/schematic/types/payment_gating.rb +12 -0
- data/lib/schematic/types/payment_method_billing_details_request_body.rb +13 -0
- data/lib/schematic/types/plan_credit_grant_warning_tier_request_body.rb +11 -0
- data/lib/schematic/types/plan_version_migration_preview_company_response_data.rb +2 -0
- data/lib/schematic/types/plan_version_migration_preview_note_response_data.rb +13 -0
- data/lib/schematic/types/plan_version_response_data.rb +2 -0
- data/lib/schematic/types/preflight_event_quantities_request_body.rb +13 -0
- data/lib/schematic/types/preflight_request_body.rb +2 -0
- data/lib/schematic/types/preview_subscription_finance_response_data.rb +6 -0
- data/lib/schematic/types/preview_subscription_proration_line_response_data.rb +21 -0
- data/lib/schematic/types/preview_subscription_proration_response_data.rb +21 -0
- data/lib/schematic/types/proration_line_kind.rb +12 -0
- data/lib/schematic/types/public_catalog_response_data.rb +29 -0
- data/lib/schematic/types/publish_plan_version_request_body.rb +45 -0
- data/lib/schematic/types/publish_preview_pay_in_advance_response_data.rb +15 -0
- data/lib/schematic/types/publish_preview_payment_method_response_data.rb +15 -0
- data/lib/schematic/types/publish_preview_proration_line_response_data.rb +19 -0
- data/lib/schematic/types/publish_preview_response_data.rb +55 -0
- data/lib/schematic/types/renewal_policy.rb +13 -0
- data/lib/schematic/types/rulesengine_credit_spend_policy.rb +2 -0
- data/lib/schematic/types/subscription_change_action.rb +14 -0
- data/lib/schematic/types/update_billing_plan_credit_grant_request_body.rb +2 -0
- data/lib/schematic/types/webhook_request_type.rb +1 -0
- data/lib/schematic/version.rb +1 -1
- data/lib/schematic/wasm/rulesengine.wasm +0 -0
- data/lib/schematic.rb +71 -18
- data/reference.md +1148 -506
- metadata +68 -15
- data/lib/schematic/accounts/types/create_api_key_request_body.rb +0 -19
- data/lib/schematic/accounts/types/create_environment_request_body.rb +0 -13
- data/lib/schematic/accounts/types/update_api_key_request_body.rb +0 -17
- data/lib/schematic/accounts/types/update_api_key_response.rb +0 -13
- data/lib/schematic/accounts/types/update_environment_request_body.rb +0 -17
- data/lib/schematic/accounts/types/update_environment_response.rb +0 -13
- data/lib/schematic/plans/types/publish_plan_version_request_body.rb +0 -47
- data/lib/schematic/types/api_key_create_response_data.rb +0 -33
- 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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a862b878399698534b16a1bf79ccebb298be7977d82d29520d29c0420ae741b4
|
|
4
|
+
data.tar.gz: 8b60a87a97fcf41ad5630836ff24f24848cd91866976f5ae6caf26315660c736
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
|
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": "
|
|
16
|
+
"originGitCommit": "9c3d404a6ed3ff63811ecbef9e2814ea8607f22d",
|
|
17
17
|
"originGitCommitIsDirty": false,
|
|
18
18
|
"invokedBy": "ci",
|
|
19
|
-
"requestedVersion": "1.5.
|
|
19
|
+
"requestedVersion": "1.5.6",
|
|
20
20
|
"ciProvider": "github",
|
|
21
|
-
"sdkVersion": "1.5.
|
|
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
|
-
|
|
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.
|
|
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
|