schematichq 1.4.16 → 1.5.0
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 +21 -3
- data/.fernignore +1 -0
- data/CONTRIBUTING.md +2 -2
- data/README.md +23 -0
- data/WASM_VERSION +1 -1
- data/lib/schematic/accesstokens/client.rb +1 -1
- data/lib/schematic/accounts/client.rb +21 -21
- data/lib/schematic/accounts/types/update_onboarding_state_request_body.rb +2 -0
- data/lib/schematic/billing/client.rb +120 -24
- data/lib/schematic/billing/types/create_billing_subscription_request_body.rb +2 -0
- data/lib/schematic/billing/types/list_company_billing_profiles_params.rb +20 -0
- data/lib/schematic/billing/types/list_company_billing_profiles_request.rb +19 -0
- data/lib/schematic/billing/types/list_company_billing_profiles_response.rb +13 -0
- data/lib/schematic/billing/types/update_company_billing_profile_request_body.rb +23 -0
- data/lib/schematic/billing/types/update_company_billing_profile_response.rb +13 -0
- data/lib/schematic/catalogs/client.rb +10 -10
- data/lib/schematic/checkout/client.rb +9 -9
- data/lib/schematic/client.rb +1 -1
- data/lib/schematic/companies/client.rb +43 -43
- data/lib/schematic/components/client.rb +8 -8
- data/lib/schematic/componentspublic/client.rb +1 -1
- data/lib/schematic/credits/client.rb +372 -41
- data/lib/schematic/credits/types/count_credit_spend_policies_params.rb +24 -0
- data/lib/schematic/credits/types/count_credit_spend_policies_request.rb +23 -0
- data/lib/schematic/credits/types/count_credit_spend_policies_response.rb +13 -0
- data/lib/schematic/credits/types/create_company_credit_grant.rb +2 -0
- data/lib/schematic/credits/types/create_credit_spend_policy_request_body.rb +19 -0
- data/lib/schematic/credits/types/create_credit_spend_policy_response.rb +13 -0
- data/lib/schematic/credits/types/delete_credit_spend_policy_response.rb +13 -0
- data/lib/schematic/credits/types/get_credit_spend_policy_response.rb +13 -0
- data/lib/schematic/credits/types/list_credit_spend_policies_params.rb +24 -0
- data/lib/schematic/credits/types/list_credit_spend_policies_request.rb +23 -0
- data/lib/schematic/credits/types/list_credit_spend_policies_response.rb +13 -0
- data/lib/schematic/credits/types/release_credit_reservation_response.rb +13 -0
- data/lib/schematic/credits/types/reserve_credits_request_body.rb +19 -0
- data/lib/schematic/credits/types/reserve_credits_response.rb +13 -0
- data/lib/schematic/credits/types/update_credit_spend_policy_request_body.rb +15 -0
- data/lib/schematic/credits/types/update_credit_spend_policy_response.rb +13 -0
- data/lib/schematic/dataexports/client.rb +3 -3
- data/lib/schematic/datastream/client.rb +5 -2
- data/lib/schematic/datastream/resource_cache.rb +2 -4
- data/lib/schematic/datastream/websocket_client.rb +59 -1
- data/lib/schematic/entitlements/client.rb +25 -25
- data/lib/schematic/events/client.rb +107 -6
- data/lib/schematic/events/types/delete_otlp_environment_settings_response.rb +13 -0
- data/lib/schematic/events/types/get_otlp_environment_settings_response.rb +13 -0
- data/lib/schematic/events/types/upsert_otlp_environment_settings_request_body.rb +19 -0
- data/lib/schematic/events/types/upsert_otlp_environment_settings_response.rb +13 -0
- data/lib/schematic/features/client.rb +57 -17
- data/lib/schematic/features/types/check_and_reserve_flag_request_body.rb +21 -0
- data/lib/schematic/features/types/check_and_reserve_flag_response.rb +13 -0
- data/lib/schematic/insights/client.rb +6 -6
- data/lib/schematic/integrationsapi/client.rb +178 -9
- data/lib/schematic/integrationsapi/types/claim_stripe_sandbox_keys_request_body.rb +11 -0
- data/lib/schematic/integrationsapi/types/claim_stripe_sandbox_keys_response.rb +13 -0
- data/lib/schematic/integrationsapi/types/get_stripe_sandbox_claim_link_response.rb +13 -0
- data/lib/schematic/integrationsapi/types/get_stripe_sandbox_keys_response.rb +13 -0
- data/lib/schematic/integrationsapi/types/install_stripe_claimable_sandbox_response.rb +13 -0
- data/lib/schematic/integrationsapi/types/install_stripe_sandbox_request_body.rb +17 -0
- data/lib/schematic/integrationsapi/types/list_stripe_sandbox_countries_response.rb +13 -0
- data/lib/schematic/internal/multipart/multipart_form_data.rb +8 -3
- data/lib/schematic/internal/types/model.rb +14 -6
- data/lib/schematic/licenses/client.rb +3 -3
- data/lib/schematic/planbundle/client.rb +3 -3
- data/lib/schematic/plangroups/client.rb +3 -3
- data/lib/schematic/plangroups/types/create_plan_group_request_body.rb +2 -0
- data/lib/schematic/plangroups/types/update_plan_group_request_body.rb +2 -0
- data/lib/schematic/planmigrations/client.rb +11 -11
- data/lib/schematic/plans/client.rb +24 -18
- data/lib/schematic/plans/types/count_plans_params.rb +2 -0
- data/lib/schematic/plans/types/count_plans_request.rb +2 -0
- data/lib/schematic/plans/types/list_plans_params.rb +2 -0
- data/lib/schematic/plans/types/list_plans_request.rb +2 -0
- data/lib/schematic/scheduledcheckout/client.rb +4 -4
- data/lib/schematic/schematic_client.rb +15 -2
- data/lib/schematic/types/billing_arrears_anchor.rb +12 -0
- data/lib/schematic/types/billing_arrears_cadence.rb +12 -0
- data/lib/schematic/types/billing_credit_grant_response_data.rb +8 -0
- data/lib/schematic/types/billing_plan_credit_grant_response_data.rb +12 -0
- data/lib/schematic/types/check_and_reserve_flag_response_data.rb +39 -0
- data/lib/schematic/types/checkout_data_response_data.rb +4 -0
- data/lib/schematic/types/claimed_stripe_sandbox_keys_response_data.rb +13 -0
- data/lib/schematic/types/company_billing_profile_response_data.rb +35 -0
- data/lib/schematic/types/company_detail_response_data.rb +4 -0
- data/lib/schematic/types/company_override_response_data.rb +4 -0
- data/lib/schematic/types/company_plan_credit_grant_view.rb +12 -0
- data/lib/schematic/types/create_billing_plan_credit_grant_request_body.rb +12 -0
- data/lib/schematic/types/credit_company_grant_view.rb +14 -0
- data/lib/schematic/types/credit_reservation_response_data.rb +25 -0
- data/lib/schematic/types/credit_spend_policy_response_data.rb +25 -0
- data/lib/schematic/types/credit_spend_policy_scope.rb +13 -0
- data/lib/schematic/types/credit_usage_reason.rb +2 -0
- data/lib/schematic/types/event_body_inference.rb +2 -0
- data/lib/schematic/types/event_body_track.rb +2 -0
- data/lib/schematic/types/event_detail_response_data.rb +2 -0
- data/lib/schematic/types/event_response_data.rb +2 -0
- data/lib/schematic/types/flag_check_reservation_response_data.rb +23 -0
- data/lib/schematic/types/get_onboarding_state_resp.rb +6 -0
- data/lib/schematic/types/issue_temporary_access_token_response_data.rb +3 -1
- data/lib/schematic/types/onboarding_requirement.rb +1 -0
- data/lib/schematic/types/onboarding_roadmap_view.rb +11 -0
- data/lib/schematic/types/otlp_environment_settings_response_data.rb +23 -0
- data/lib/schematic/types/plan_credit_grant_view.rb +12 -0
- data/lib/schematic/types/plan_group_detail_response_data.rb +2 -0
- data/lib/schematic/types/plan_group_response_data.rb +2 -0
- data/lib/schematic/types/rule_condition_detail_response_data.rb +2 -0
- data/lib/schematic/types/rule_condition_plan_version_response_data.rb +15 -0
- data/lib/schematic/types/rules_engine_schema_version.rb +1 -1
- data/lib/schematic/types/rulesengine_company.rb +2 -0
- data/lib/schematic/types/rulesengine_credit_postpaid_config.rb +9 -0
- data/lib/schematic/types/slack_connect_invite_status.rb +15 -0
- data/lib/schematic/types/slack_connect_invite_view.rb +15 -0
- data/lib/schematic/types/stripe_integration_config.rb +6 -0
- data/lib/schematic/types/stripe_sandbox_claim_link.rb +15 -0
- data/lib/schematic/types/stripe_sandbox_countries_response_data.rb +9 -0
- data/lib/schematic/types/stripe_sandbox_install_response_data.rb +21 -0
- data/lib/schematic/types/stripe_sandbox_keys_response_data.rb +13 -0
- data/lib/schematic/types/temporary_access_token_issuer_type.rb +12 -0
- data/lib/schematic/types/temporary_access_token_response_data.rb +3 -1
- data/lib/schematic/types/update_billing_plan_credit_grant_request_body.rb +12 -0
- data/lib/schematic/types/webhook_event_detail_response_data.rb +2 -0
- data/lib/schematic/types/webhook_event_response_data.rb +2 -0
- data/lib/schematic/version.rb +1 -1
- data/lib/schematic/wasm/rulesengine.wasm +0 -0
- data/lib/schematic/webhooks/client.rb +10 -10
- data/lib/schematic.rb +56 -4
- data/reference.md +1345 -44
- data/testapp/app.rb +13 -2
- metadata +55 -3
- data/lib/schematic/types/release_credit_lease_request_body.rb +0 -23
|
@@ -40,7 +40,7 @@ module Schematic
|
|
|
40
40
|
end
|
|
41
41
|
code = response.code.to_i
|
|
42
42
|
if code.between?(200, 299)
|
|
43
|
-
Schematic::Events::Types::CreateEventBatchResponse.load(response.body)
|
|
43
|
+
(response.body.to_s.empty? ? nil : Schematic::Events::Types::CreateEventBatchResponse.load(response.body))
|
|
44
44
|
else
|
|
45
45
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
46
46
|
raise error_class.new(response.body, code: code)
|
|
@@ -90,7 +90,7 @@ module Schematic
|
|
|
90
90
|
end
|
|
91
91
|
code = response.code.to_i
|
|
92
92
|
if code.between?(200, 299)
|
|
93
|
-
Schematic::Events::Types::GetEventSummariesResponse.load(response.body)
|
|
93
|
+
(response.body.to_s.empty? ? nil : Schematic::Events::Types::GetEventSummariesResponse.load(response.body))
|
|
94
94
|
else
|
|
95
95
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
96
96
|
raise error_class.new(response.body, code: code)
|
|
@@ -152,7 +152,7 @@ module Schematic
|
|
|
152
152
|
end
|
|
153
153
|
code = response.code.to_i
|
|
154
154
|
if code.between?(200, 299)
|
|
155
|
-
Schematic::Events::Types::ListEventsResponse.load(response.body)
|
|
155
|
+
(response.body.to_s.empty? ? nil : Schematic::Events::Types::ListEventsResponse.load(response.body))
|
|
156
156
|
else
|
|
157
157
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
158
158
|
raise error_class.new(response.body, code: code)
|
|
@@ -187,7 +187,7 @@ module Schematic
|
|
|
187
187
|
end
|
|
188
188
|
code = response.code.to_i
|
|
189
189
|
if code.between?(200, 299)
|
|
190
|
-
Schematic::Events::Types::CreateEventResponse.load(response.body)
|
|
190
|
+
(response.body.to_s.empty? ? nil : Schematic::Events::Types::CreateEventResponse.load(response.body))
|
|
191
191
|
else
|
|
192
192
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
193
193
|
raise error_class.new(response.body, code: code)
|
|
@@ -222,7 +222,108 @@ module Schematic
|
|
|
222
222
|
end
|
|
223
223
|
code = response.code.to_i
|
|
224
224
|
if code.between?(200, 299)
|
|
225
|
-
Schematic::Events::Types::GetEventResponse.load(response.body)
|
|
225
|
+
(response.body.to_s.empty? ? nil : Schematic::Events::Types::GetEventResponse.load(response.body))
|
|
226
|
+
else
|
|
227
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
228
|
+
raise error_class.new(response.body, code: code)
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
# @param request_options [Hash]
|
|
233
|
+
# @param _params [Hash]
|
|
234
|
+
# @option request_options [String] :base_url
|
|
235
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
236
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
237
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
238
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
239
|
+
#
|
|
240
|
+
# @example
|
|
241
|
+
# client.events.get_otlp_environment_settings
|
|
242
|
+
#
|
|
243
|
+
# @return [Schematic::Events::Types::GetOtlpEnvironmentSettingsResponse]
|
|
244
|
+
def get_otlp_environment_settings(request_options: {}, **_params)
|
|
245
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
246
|
+
base_url: request_options[:base_url],
|
|
247
|
+
method: "GET",
|
|
248
|
+
path: "otlp/settings",
|
|
249
|
+
request_options: request_options
|
|
250
|
+
)
|
|
251
|
+
begin
|
|
252
|
+
response = @client.send(request)
|
|
253
|
+
rescue Net::HTTPRequestTimeout
|
|
254
|
+
raise Schematic::Errors::TimeoutError
|
|
255
|
+
end
|
|
256
|
+
code = response.code.to_i
|
|
257
|
+
if code.between?(200, 299)
|
|
258
|
+
(response.body.to_s.empty? ? nil : Schematic::Events::Types::GetOtlpEnvironmentSettingsResponse.load(response.body))
|
|
259
|
+
else
|
|
260
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
261
|
+
raise error_class.new(response.body, code: code)
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# @param request_options [Hash]
|
|
266
|
+
# @param params [Schematic::Events::Types::UpsertOtlpEnvironmentSettingsRequestBody]
|
|
267
|
+
# @option request_options [String] :base_url
|
|
268
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
269
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
270
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
271
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
272
|
+
#
|
|
273
|
+
# @example
|
|
274
|
+
# client.events.upsert_otlp_environment_settings(tool_events_enabled: true)
|
|
275
|
+
#
|
|
276
|
+
# @return [Schematic::Events::Types::UpsertOtlpEnvironmentSettingsResponse]
|
|
277
|
+
def upsert_otlp_environment_settings(request_options: {}, **params)
|
|
278
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
279
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
280
|
+
base_url: request_options[:base_url],
|
|
281
|
+
method: "POST",
|
|
282
|
+
path: "otlp/settings",
|
|
283
|
+
body: Schematic::Events::Types::UpsertOtlpEnvironmentSettingsRequestBody.new(params).to_h,
|
|
284
|
+
request_options: request_options
|
|
285
|
+
)
|
|
286
|
+
begin
|
|
287
|
+
response = @client.send(request)
|
|
288
|
+
rescue Net::HTTPRequestTimeout
|
|
289
|
+
raise Schematic::Errors::TimeoutError
|
|
290
|
+
end
|
|
291
|
+
code = response.code.to_i
|
|
292
|
+
if code.between?(200, 299)
|
|
293
|
+
(response.body.to_s.empty? ? nil : Schematic::Events::Types::UpsertOtlpEnvironmentSettingsResponse.load(response.body))
|
|
294
|
+
else
|
|
295
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
296
|
+
raise error_class.new(response.body, code: code)
|
|
297
|
+
end
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
# @param request_options [Hash]
|
|
301
|
+
# @param _params [Hash]
|
|
302
|
+
# @option request_options [String] :base_url
|
|
303
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
304
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
305
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
306
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
307
|
+
#
|
|
308
|
+
# @example
|
|
309
|
+
# client.events.delete_otlp_environment_settings
|
|
310
|
+
#
|
|
311
|
+
# @return [Schematic::Events::Types::DeleteOtlpEnvironmentSettingsResponse]
|
|
312
|
+
def delete_otlp_environment_settings(request_options: {}, **_params)
|
|
313
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
314
|
+
base_url: request_options[:base_url],
|
|
315
|
+
method: "DELETE",
|
|
316
|
+
path: "otlp/settings",
|
|
317
|
+
request_options: request_options
|
|
318
|
+
)
|
|
319
|
+
begin
|
|
320
|
+
response = @client.send(request)
|
|
321
|
+
rescue Net::HTTPRequestTimeout
|
|
322
|
+
raise Schematic::Errors::TimeoutError
|
|
323
|
+
end
|
|
324
|
+
code = response.code.to_i
|
|
325
|
+
if code.between?(200, 299)
|
|
326
|
+
(response.body.to_s.empty? ? nil : Schematic::Events::Types::DeleteOtlpEnvironmentSettingsResponse.load(response.body))
|
|
226
327
|
else
|
|
227
328
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
228
329
|
raise error_class.new(response.body, code: code)
|
|
@@ -255,7 +356,7 @@ module Schematic
|
|
|
255
356
|
end
|
|
256
357
|
code = response.code.to_i
|
|
257
358
|
if code.between?(200, 299)
|
|
258
|
-
Schematic::Events::Types::GetSegmentIntegrationStatusResponse.load(response.body)
|
|
359
|
+
(response.body.to_s.empty? ? nil : Schematic::Events::Types::GetSegmentIntegrationStatusResponse.load(response.body))
|
|
259
360
|
else
|
|
260
361
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
261
362
|
raise error_class.new(response.body, code: code)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Events
|
|
5
|
+
module Types
|
|
6
|
+
class DeleteOtlpEnvironmentSettingsResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::DeleteResponse }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Events
|
|
5
|
+
module Types
|
|
6
|
+
class GetOtlpEnvironmentSettingsResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::OtlpEnvironmentSettingsResponseData }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Events
|
|
5
|
+
module Types
|
|
6
|
+
class UpsertOtlpEnvironmentSettingsRequestBody < Internal::Types::Model
|
|
7
|
+
field :company_attribute, -> { String }, optional: true, nullable: false
|
|
8
|
+
|
|
9
|
+
field :company_key, -> { String }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :tool_events_enabled, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
12
|
+
|
|
13
|
+
field :user_attribute, -> { String }, optional: true, nullable: false
|
|
14
|
+
|
|
15
|
+
field :user_key, -> { String }, optional: true, nullable: false
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Events
|
|
5
|
+
module Types
|
|
6
|
+
class UpsertOtlpEnvironmentSettingsResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::OtlpEnvironmentSettingsResponseData }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -71,7 +71,7 @@ module Schematic
|
|
|
71
71
|
end
|
|
72
72
|
code = response.code.to_i
|
|
73
73
|
if code.between?(200, 299)
|
|
74
|
-
Schematic::Features::Types::ListFeaturesResponse.load(response.body)
|
|
74
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::ListFeaturesResponse.load(response.body))
|
|
75
75
|
else
|
|
76
76
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
77
77
|
raise error_class.new(response.body, code: code)
|
|
@@ -110,7 +110,7 @@ module Schematic
|
|
|
110
110
|
end
|
|
111
111
|
code = response.code.to_i
|
|
112
112
|
if code.between?(200, 299)
|
|
113
|
-
Schematic::Features::Types::CreateFeatureResponse.load(response.body)
|
|
113
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::CreateFeatureResponse.load(response.body))
|
|
114
114
|
else
|
|
115
115
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
116
116
|
raise error_class.new(response.body, code: code)
|
|
@@ -145,7 +145,7 @@ module Schematic
|
|
|
145
145
|
end
|
|
146
146
|
code = response.code.to_i
|
|
147
147
|
if code.between?(200, 299)
|
|
148
|
-
Schematic::Features::Types::GetFeatureResponse.load(response.body)
|
|
148
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::GetFeatureResponse.load(response.body))
|
|
149
149
|
else
|
|
150
150
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
151
151
|
raise error_class.new(response.body, code: code)
|
|
@@ -185,7 +185,7 @@ module Schematic
|
|
|
185
185
|
end
|
|
186
186
|
code = response.code.to_i
|
|
187
187
|
if code.between?(200, 299)
|
|
188
|
-
Schematic::Features::Types::UpdateFeatureResponse.load(response.body)
|
|
188
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::UpdateFeatureResponse.load(response.body))
|
|
189
189
|
else
|
|
190
190
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
191
191
|
raise error_class.new(response.body, code: code)
|
|
@@ -220,7 +220,7 @@ module Schematic
|
|
|
220
220
|
end
|
|
221
221
|
code = response.code.to_i
|
|
222
222
|
if code.between?(200, 299)
|
|
223
|
-
Schematic::Features::Types::DeleteFeatureResponse.load(response.body)
|
|
223
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::DeleteFeatureResponse.load(response.body))
|
|
224
224
|
else
|
|
225
225
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
226
226
|
raise error_class.new(response.body, code: code)
|
|
@@ -261,7 +261,7 @@ module Schematic
|
|
|
261
261
|
end
|
|
262
262
|
code = response.code.to_i
|
|
263
263
|
if code.between?(200, 299)
|
|
264
|
-
Schematic::Features::Types::UpsertFeatureForBillingProductResponse.load(response.body)
|
|
264
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::UpsertFeatureForBillingProductResponse.load(response.body))
|
|
265
265
|
else
|
|
266
266
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
267
267
|
raise error_class.new(response.body, code: code)
|
|
@@ -329,7 +329,7 @@ module Schematic
|
|
|
329
329
|
end
|
|
330
330
|
code = response.code.to_i
|
|
331
331
|
if code.between?(200, 299)
|
|
332
|
-
Schematic::Features::Types::CountFeaturesResponse.load(response.body)
|
|
332
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::CountFeaturesResponse.load(response.body))
|
|
333
333
|
else
|
|
334
334
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
335
335
|
raise error_class.new(response.body, code: code)
|
|
@@ -382,7 +382,7 @@ module Schematic
|
|
|
382
382
|
end
|
|
383
383
|
code = response.code.to_i
|
|
384
384
|
if code.between?(200, 299)
|
|
385
|
-
Schematic::Features::Types::ListFlagsResponse.load(response.body)
|
|
385
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::ListFlagsResponse.load(response.body))
|
|
386
386
|
else
|
|
387
387
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
388
388
|
raise error_class.new(response.body, code: code)
|
|
@@ -423,7 +423,7 @@ module Schematic
|
|
|
423
423
|
end
|
|
424
424
|
code = response.code.to_i
|
|
425
425
|
if code.between?(200, 299)
|
|
426
|
-
Schematic::Features::Types::CreateFlagResponse.load(response.body)
|
|
426
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::CreateFlagResponse.load(response.body))
|
|
427
427
|
else
|
|
428
428
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
429
429
|
raise error_class.new(response.body, code: code)
|
|
@@ -458,7 +458,7 @@ module Schematic
|
|
|
458
458
|
end
|
|
459
459
|
code = response.code.to_i
|
|
460
460
|
if code.between?(200, 299)
|
|
461
|
-
Schematic::Features::Types::GetFlagResponse.load(response.body)
|
|
461
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::GetFlagResponse.load(response.body))
|
|
462
462
|
else
|
|
463
463
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
464
464
|
raise error_class.new(response.body, code: code)
|
|
@@ -504,7 +504,7 @@ module Schematic
|
|
|
504
504
|
end
|
|
505
505
|
code = response.code.to_i
|
|
506
506
|
if code.between?(200, 299)
|
|
507
|
-
Schematic::Features::Types::UpdateFlagResponse.load(response.body)
|
|
507
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::UpdateFlagResponse.load(response.body))
|
|
508
508
|
else
|
|
509
509
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
510
510
|
raise error_class.new(response.body, code: code)
|
|
@@ -539,7 +539,7 @@ module Schematic
|
|
|
539
539
|
end
|
|
540
540
|
code = response.code.to_i
|
|
541
541
|
if code.between?(200, 299)
|
|
542
|
-
Schematic::Features::Types::DeleteFlagResponse.load(response.body)
|
|
542
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::DeleteFlagResponse.load(response.body))
|
|
543
543
|
else
|
|
544
544
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
545
545
|
raise error_class.new(response.body, code: code)
|
|
@@ -598,7 +598,7 @@ module Schematic
|
|
|
598
598
|
end
|
|
599
599
|
code = response.code.to_i
|
|
600
600
|
if code.between?(200, 299)
|
|
601
|
-
Schematic::Features::Types::UpdateFlagRulesResponse.load(response.body)
|
|
601
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::UpdateFlagRulesResponse.load(response.body))
|
|
602
602
|
else
|
|
603
603
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
604
604
|
raise error_class.new(response.body, code: code)
|
|
@@ -637,7 +637,47 @@ module Schematic
|
|
|
637
637
|
end
|
|
638
638
|
code = response.code.to_i
|
|
639
639
|
if code.between?(200, 299)
|
|
640
|
-
Schematic::Features::Types::CheckFlagResponse.load(response.body)
|
|
640
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::CheckFlagResponse.load(response.body))
|
|
641
|
+
else
|
|
642
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
643
|
+
raise error_class.new(response.body, code: code)
|
|
644
|
+
end
|
|
645
|
+
end
|
|
646
|
+
|
|
647
|
+
# @param request_options [Hash]
|
|
648
|
+
# @param params [Schematic::Features::Types::CheckAndReserveFlagRequestBody]
|
|
649
|
+
# @option request_options [String] :base_url
|
|
650
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
651
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
652
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
653
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
654
|
+
# @option params [String] :key
|
|
655
|
+
#
|
|
656
|
+
# @example
|
|
657
|
+
# client.features.check_and_reserve_flag(key: "key")
|
|
658
|
+
#
|
|
659
|
+
# @return [Schematic::Features::Types::CheckAndReserveFlagResponse]
|
|
660
|
+
def check_and_reserve_flag(request_options: {}, **params)
|
|
661
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
662
|
+
request_data = Schematic::Features::Types::CheckAndReserveFlagRequestBody.new(params).to_h
|
|
663
|
+
non_body_param_names = %w[key]
|
|
664
|
+
body = request_data.except(*non_body_param_names)
|
|
665
|
+
|
|
666
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
667
|
+
base_url: request_options[:base_url],
|
|
668
|
+
method: "POST",
|
|
669
|
+
path: "flags/#{URI.encode_uri_component(params[:key].to_s)}/check-and-reserve",
|
|
670
|
+
body: body,
|
|
671
|
+
request_options: request_options
|
|
672
|
+
)
|
|
673
|
+
begin
|
|
674
|
+
response = @client.send(request)
|
|
675
|
+
rescue Net::HTTPRequestTimeout
|
|
676
|
+
raise Schematic::Errors::TimeoutError
|
|
677
|
+
end
|
|
678
|
+
code = response.code.to_i
|
|
679
|
+
if code.between?(200, 299)
|
|
680
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::CheckAndReserveFlagResponse.load(response.body))
|
|
641
681
|
else
|
|
642
682
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
643
683
|
raise error_class.new(response.body, code: code)
|
|
@@ -672,7 +712,7 @@ module Schematic
|
|
|
672
712
|
end
|
|
673
713
|
code = response.code.to_i
|
|
674
714
|
if code.between?(200, 299)
|
|
675
|
-
Schematic::Features::Types::CheckFlagsResponse.load(response.body)
|
|
715
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::CheckFlagsResponse.load(response.body))
|
|
676
716
|
else
|
|
677
717
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
678
718
|
raise error_class.new(response.body, code: code)
|
|
@@ -707,7 +747,7 @@ module Schematic
|
|
|
707
747
|
end
|
|
708
748
|
code = response.code.to_i
|
|
709
749
|
if code.between?(200, 299)
|
|
710
|
-
Schematic::Features::Types::CheckFlagsBulkResponse.load(response.body)
|
|
750
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::CheckFlagsBulkResponse.load(response.body))
|
|
711
751
|
else
|
|
712
752
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
713
753
|
raise error_class.new(response.body, code: code)
|
|
@@ -760,7 +800,7 @@ module Schematic
|
|
|
760
800
|
end
|
|
761
801
|
code = response.code.to_i
|
|
762
802
|
if code.between?(200, 299)
|
|
763
|
-
Schematic::Features::Types::CountFlagsResponse.load(response.body)
|
|
803
|
+
(response.body.to_s.empty? ? nil : Schematic::Features::Types::CountFlagsResponse.load(response.body))
|
|
764
804
|
else
|
|
765
805
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
766
806
|
raise error_class.new(response.body, code: code)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Features
|
|
5
|
+
module Types
|
|
6
|
+
class CheckAndReserveFlagRequestBody < Internal::Types::Model
|
|
7
|
+
field :key, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :company, -> { Internal::Types::Hash[String, String] }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :expires_at, -> { String }, optional: true, nullable: false
|
|
12
|
+
|
|
13
|
+
field :preflight, -> { Schematic::Types::PreflightRequestBody }, optional: true, nullable: false
|
|
14
|
+
|
|
15
|
+
field :quantity, -> { Integer }, optional: true, nullable: false
|
|
16
|
+
|
|
17
|
+
field :user, -> { Internal::Types::Hash[String, String] }, optional: true, nullable: false
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Features
|
|
5
|
+
module Types
|
|
6
|
+
class CheckAndReserveFlagResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::CheckAndReserveFlagResponseData }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -42,7 +42,7 @@ module Schematic
|
|
|
42
42
|
end
|
|
43
43
|
code = response.code.to_i
|
|
44
44
|
if code.between?(200, 299)
|
|
45
|
-
Schematic::Insights::Types::GetActivityResponse.load(response.body)
|
|
45
|
+
(response.body.to_s.empty? ? nil : Schematic::Insights::Types::GetActivityResponse.load(response.body))
|
|
46
46
|
else
|
|
47
47
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
48
48
|
raise error_class.new(response.body, code: code)
|
|
@@ -92,7 +92,7 @@ module Schematic
|
|
|
92
92
|
end
|
|
93
93
|
code = response.code.to_i
|
|
94
94
|
if code.between?(200, 299)
|
|
95
|
-
Schematic::Insights::Types::GetEnvironmentFeatureUsageTimeSeriesResponse.load(response.body)
|
|
95
|
+
(response.body.to_s.empty? ? nil : Schematic::Insights::Types::GetEnvironmentFeatureUsageTimeSeriesResponse.load(response.body))
|
|
96
96
|
else
|
|
97
97
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
98
98
|
raise error_class.new(response.body, code: code)
|
|
@@ -131,7 +131,7 @@ module Schematic
|
|
|
131
131
|
end
|
|
132
132
|
code = response.code.to_i
|
|
133
133
|
if code.between?(200, 299)
|
|
134
|
-
Schematic::Insights::Types::GetPlanGrowthResponse.load(response.body)
|
|
134
|
+
(response.body.to_s.empty? ? nil : Schematic::Insights::Types::GetPlanGrowthResponse.load(response.body))
|
|
135
135
|
else
|
|
136
136
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
137
137
|
raise error_class.new(response.body, code: code)
|
|
@@ -164,7 +164,7 @@ module Schematic
|
|
|
164
164
|
end
|
|
165
165
|
code = response.code.to_i
|
|
166
166
|
if code.between?(200, 299)
|
|
167
|
-
Schematic::Insights::Types::GetSummaryResponse.load(response.body)
|
|
167
|
+
(response.body.to_s.empty? ? nil : Schematic::Insights::Types::GetSummaryResponse.load(response.body))
|
|
168
168
|
else
|
|
169
169
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
170
170
|
raise error_class.new(response.body, code: code)
|
|
@@ -211,7 +211,7 @@ module Schematic
|
|
|
211
211
|
end
|
|
212
212
|
code = response.code.to_i
|
|
213
213
|
if code.between?(200, 299)
|
|
214
|
-
Schematic::Insights::Types::GetTopFeaturesByUsageResponse.load(response.body)
|
|
214
|
+
(response.body.to_s.empty? ? nil : Schematic::Insights::Types::GetTopFeaturesByUsageResponse.load(response.body))
|
|
215
215
|
else
|
|
216
216
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
217
217
|
raise error_class.new(response.body, code: code)
|
|
@@ -261,7 +261,7 @@ module Schematic
|
|
|
261
261
|
end
|
|
262
262
|
code = response.code.to_i
|
|
263
263
|
if code.between?(200, 299)
|
|
264
|
-
Schematic::Insights::Types::GetEnvironmentTraitUsageTimeSeriesResponse.load(response.body)
|
|
264
|
+
(response.body.to_s.empty? ? nil : Schematic::Insights::Types::GetEnvironmentTraitUsageTimeSeriesResponse.load(response.body))
|
|
265
265
|
else
|
|
266
266
|
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
267
267
|
raise error_class.new(response.body, code: code)
|