schematichq 1.4.16 → 1.4.17
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 +9 -3
- data/WASM_VERSION +1 -1
- data/lib/schematic/accounts/types/update_onboarding_state_request_body.rb +2 -0
- data/lib/schematic/billing/client.rb +96 -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/client.rb +1 -1
- data/lib/schematic/credits/client.rb +266 -0
- 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_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/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/datastream/resource_cache.rb +2 -4
- data/lib/schematic/events/client.rb +101 -0
- 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/integrationsapi/client.rb +169 -0
- 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/schematic_client.rb +11 -2
- 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/credit_spend_policy_response_data.rb +25 -0
- data/lib/schematic/types/credit_spend_policy_scope.rb +13 -0
- data/lib/schematic/types/event_body_inference.rb +2 -0
- data/lib/schematic/types/get_onboarding_state_resp.rb +2 -0
- data/lib/schematic/types/otlp_environment_settings_response_data.rb +23 -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/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/version.rb +1 -1
- data/lib/schematic/wasm/rulesengine.wasm +0 -0
- data/lib/schematic.rb +41 -3
- data/reference.md +1108 -64
- data/testapp/app.rb +5 -1
- metadata +40 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Credits
|
|
5
|
+
module Types
|
|
6
|
+
class DeleteCreditSpendPolicyResponse < 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 Credits
|
|
5
|
+
module Types
|
|
6
|
+
class GetCreditSpendPolicyResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::CreditSpendPolicyResponseData }, 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,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Credits
|
|
5
|
+
module Types
|
|
6
|
+
# Input parameters
|
|
7
|
+
class ListCreditSpendPoliciesParams < Internal::Types::Model
|
|
8
|
+
field :billing_credit_id, -> { String }, optional: true, nullable: false
|
|
9
|
+
|
|
10
|
+
field :company_id, -> { String }, optional: true, nullable: false
|
|
11
|
+
|
|
12
|
+
field :limit, -> { Integer }, optional: true, nullable: false
|
|
13
|
+
|
|
14
|
+
field :offset, -> { Integer }, optional: true, nullable: false
|
|
15
|
+
|
|
16
|
+
field :scope_type, -> { Schematic::Types::CreditSpendPolicyScope }, optional: true, nullable: false
|
|
17
|
+
|
|
18
|
+
field :user_id, -> { String }, optional: true, nullable: false
|
|
19
|
+
|
|
20
|
+
field :user_ids, -> { Internal::Types::Array[String] }, optional: true, nullable: false
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Credits
|
|
5
|
+
module Types
|
|
6
|
+
class ListCreditSpendPoliciesRequest < Internal::Types::Model
|
|
7
|
+
field :billing_credit_id, -> { String }, optional: true, nullable: false
|
|
8
|
+
|
|
9
|
+
field :company_id, -> { String }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :scope_type, -> { Schematic::Types::CreditSpendPolicyScope }, optional: true, nullable: false
|
|
12
|
+
|
|
13
|
+
field :user_id, -> { String }, optional: true, nullable: false
|
|
14
|
+
|
|
15
|
+
field :user_ids, -> { String }, optional: true, nullable: false
|
|
16
|
+
|
|
17
|
+
field :limit, -> { Integer }, optional: true, nullable: false
|
|
18
|
+
|
|
19
|
+
field :offset, -> { Integer }, optional: true, nullable: false
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Credits
|
|
5
|
+
module Types
|
|
6
|
+
class ListCreditSpendPoliciesResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Internal::Types::Array[Schematic::Types::CreditSpendPolicyResponseData] }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :params, -> { Schematic::Credits::Types::ListCreditSpendPoliciesParams }, optional: false, nullable: false
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Credits
|
|
5
|
+
module Types
|
|
6
|
+
class UpdateCreditSpendPolicyRequestBody < Internal::Types::Model
|
|
7
|
+
field :spend_policy_id, -> { String }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :label, -> { String }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :max_per_draw, -> { Integer }, optional: true, 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 Credits
|
|
5
|
+
module Types
|
|
6
|
+
class UpdateCreditSpendPolicyResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::CreditSpendPolicyResponseData }, 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
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
module Schematic
|
|
4
4
|
module DataStream
|
|
5
5
|
class ResourceCache
|
|
6
|
-
CACHE_KEY_PREFIX = "schematic"
|
|
7
|
-
|
|
8
6
|
def initialize(primary_cache:, lookup_cache:, key_prefix:, get_id:, get_keys:, cache_version: nil)
|
|
9
7
|
@primary_cache = primary_cache
|
|
10
8
|
@lookup_cache = lookup_cache
|
|
@@ -65,11 +63,11 @@ module Schematic
|
|
|
65
63
|
private
|
|
66
64
|
|
|
67
65
|
def build_id_key(id)
|
|
68
|
-
"#{
|
|
66
|
+
"#{@key_prefix}:#{@cache_version}:#{id}"
|
|
69
67
|
end
|
|
70
68
|
|
|
71
69
|
def build_lookup_key(key_name, key_value)
|
|
72
|
-
"#{
|
|
70
|
+
"#{@key_prefix}:#{@cache_version}:#{key_name.to_s.downcase}:#{key_value.to_s.downcase}"
|
|
73
71
|
end
|
|
74
72
|
end
|
|
75
73
|
end
|
|
@@ -229,6 +229,107 @@ module Schematic
|
|
|
229
229
|
end
|
|
230
230
|
end
|
|
231
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
|
+
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
|
+
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
|
+
Schematic::Events::Types::DeleteOtlpEnvironmentSettingsResponse.load(response.body)
|
|
327
|
+
else
|
|
328
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
329
|
+
raise error_class.new(response.body, code: code)
|
|
330
|
+
end
|
|
331
|
+
end
|
|
332
|
+
|
|
232
333
|
# @param request_options [Hash]
|
|
233
334
|
# @param _params [Hash]
|
|
234
335
|
# @option request_options [String] :base_url
|
|
@@ -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
|
|
@@ -242,6 +242,107 @@ module Schematic
|
|
|
242
242
|
end
|
|
243
243
|
end
|
|
244
244
|
|
|
245
|
+
# @param request_options [Hash]
|
|
246
|
+
# @param _params [Hash]
|
|
247
|
+
# @option request_options [String] :base_url
|
|
248
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
249
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
250
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
251
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
252
|
+
#
|
|
253
|
+
# @example
|
|
254
|
+
# client.integrationsapi.get_stripe_sandbox_claim_link
|
|
255
|
+
#
|
|
256
|
+
# @return [Schematic::Integrationsapi::Types::GetStripeSandboxClaimLinkResponse]
|
|
257
|
+
def get_stripe_sandbox_claim_link(request_options: {}, **_params)
|
|
258
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
259
|
+
base_url: request_options[:base_url],
|
|
260
|
+
method: "GET",
|
|
261
|
+
path: "integrations/stripe/sandbox/claim-link",
|
|
262
|
+
request_options: request_options
|
|
263
|
+
)
|
|
264
|
+
begin
|
|
265
|
+
response = @client.send(request)
|
|
266
|
+
rescue Net::HTTPRequestTimeout
|
|
267
|
+
raise Schematic::Errors::TimeoutError
|
|
268
|
+
end
|
|
269
|
+
code = response.code.to_i
|
|
270
|
+
if code.between?(200, 299)
|
|
271
|
+
Schematic::Integrationsapi::Types::GetStripeSandboxClaimLinkResponse.load(response.body)
|
|
272
|
+
else
|
|
273
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
274
|
+
raise error_class.new(response.body, code: code)
|
|
275
|
+
end
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# @param request_options [Hash]
|
|
279
|
+
# @param _params [Hash]
|
|
280
|
+
# @option request_options [String] :base_url
|
|
281
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
282
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
283
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
284
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
285
|
+
#
|
|
286
|
+
# @example
|
|
287
|
+
# client.integrationsapi.get_stripe_sandbox_keys
|
|
288
|
+
#
|
|
289
|
+
# @return [Schematic::Integrationsapi::Types::GetStripeSandboxKeysResponse]
|
|
290
|
+
def get_stripe_sandbox_keys(request_options: {}, **_params)
|
|
291
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
292
|
+
base_url: request_options[:base_url],
|
|
293
|
+
method: "GET",
|
|
294
|
+
path: "integrations/stripe/sandbox/keys",
|
|
295
|
+
request_options: request_options
|
|
296
|
+
)
|
|
297
|
+
begin
|
|
298
|
+
response = @client.send(request)
|
|
299
|
+
rescue Net::HTTPRequestTimeout
|
|
300
|
+
raise Schematic::Errors::TimeoutError
|
|
301
|
+
end
|
|
302
|
+
code = response.code.to_i
|
|
303
|
+
if code.between?(200, 299)
|
|
304
|
+
Schematic::Integrationsapi::Types::GetStripeSandboxKeysResponse.load(response.body)
|
|
305
|
+
else
|
|
306
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
307
|
+
raise error_class.new(response.body, code: code)
|
|
308
|
+
end
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
# @param request_options [Hash]
|
|
312
|
+
# @param params [Schematic::Integrationsapi::Types::ClaimStripeSandboxKeysRequestBody]
|
|
313
|
+
# @option request_options [String] :base_url
|
|
314
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
315
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
316
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
317
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
318
|
+
#
|
|
319
|
+
# @example
|
|
320
|
+
# client.integrationsapi.claim_stripe_sandbox_keys(token: "token")
|
|
321
|
+
#
|
|
322
|
+
# @return [Schematic::Integrationsapi::Types::ClaimStripeSandboxKeysResponse]
|
|
323
|
+
def claim_stripe_sandbox_keys(request_options: {}, **params)
|
|
324
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
325
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
326
|
+
base_url: request_options[:base_url],
|
|
327
|
+
method: "POST",
|
|
328
|
+
path: "integrations/stripe/sandbox/keys/claim",
|
|
329
|
+
body: Schematic::Integrationsapi::Types::ClaimStripeSandboxKeysRequestBody.new(params).to_h,
|
|
330
|
+
request_options: request_options
|
|
331
|
+
)
|
|
332
|
+
begin
|
|
333
|
+
response = @client.send(request)
|
|
334
|
+
rescue Net::HTTPRequestTimeout
|
|
335
|
+
raise Schematic::Errors::TimeoutError
|
|
336
|
+
end
|
|
337
|
+
code = response.code.to_i
|
|
338
|
+
if code.between?(200, 299)
|
|
339
|
+
Schematic::Integrationsapi::Types::ClaimStripeSandboxKeysResponse.load(response.body)
|
|
340
|
+
else
|
|
341
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
342
|
+
raise error_class.new(response.body, code: code)
|
|
343
|
+
end
|
|
344
|
+
end
|
|
345
|
+
|
|
245
346
|
# @param request_options [Hash]
|
|
246
347
|
# @param params [Schematic::Types::InstallIntegrationRequestBody]
|
|
247
348
|
# @option request_options [String] :base_url
|
|
@@ -312,6 +413,74 @@ module Schematic
|
|
|
312
413
|
end
|
|
313
414
|
end
|
|
314
415
|
|
|
416
|
+
# @param request_options [Hash]
|
|
417
|
+
# @param params [Schematic::Integrationsapi::Types::InstallStripeSandboxRequestBody]
|
|
418
|
+
# @option request_options [String] :base_url
|
|
419
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
420
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
421
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
422
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
423
|
+
#
|
|
424
|
+
# @example
|
|
425
|
+
# client.integrationsapi.install_stripe_claimable_sandbox(email: "email")
|
|
426
|
+
#
|
|
427
|
+
# @return [Schematic::Integrationsapi::Types::InstallStripeClaimableSandboxResponse]
|
|
428
|
+
def install_stripe_claimable_sandbox(request_options: {}, **params)
|
|
429
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
430
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
431
|
+
base_url: request_options[:base_url],
|
|
432
|
+
method: "POST",
|
|
433
|
+
path: "integrations/stripe/v2/sandbox",
|
|
434
|
+
body: Schematic::Integrationsapi::Types::InstallStripeSandboxRequestBody.new(params).to_h,
|
|
435
|
+
request_options: request_options
|
|
436
|
+
)
|
|
437
|
+
begin
|
|
438
|
+
response = @client.send(request)
|
|
439
|
+
rescue Net::HTTPRequestTimeout
|
|
440
|
+
raise Schematic::Errors::TimeoutError
|
|
441
|
+
end
|
|
442
|
+
code = response.code.to_i
|
|
443
|
+
if code.between?(200, 299)
|
|
444
|
+
Schematic::Integrationsapi::Types::InstallStripeClaimableSandboxResponse.load(response.body)
|
|
445
|
+
else
|
|
446
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
447
|
+
raise error_class.new(response.body, code: code)
|
|
448
|
+
end
|
|
449
|
+
end
|
|
450
|
+
|
|
451
|
+
# @param request_options [Hash]
|
|
452
|
+
# @param _params [Hash]
|
|
453
|
+
# @option request_options [String] :base_url
|
|
454
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
455
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
456
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
457
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
458
|
+
#
|
|
459
|
+
# @example
|
|
460
|
+
# client.integrationsapi.list_stripe_sandbox_countries
|
|
461
|
+
#
|
|
462
|
+
# @return [Schematic::Integrationsapi::Types::ListStripeSandboxCountriesResponse]
|
|
463
|
+
def list_stripe_sandbox_countries(request_options: {}, **_params)
|
|
464
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
465
|
+
base_url: request_options[:base_url],
|
|
466
|
+
method: "GET",
|
|
467
|
+
path: "integrations/stripe/v2/sandbox-countries",
|
|
468
|
+
request_options: request_options
|
|
469
|
+
)
|
|
470
|
+
begin
|
|
471
|
+
response = @client.send(request)
|
|
472
|
+
rescue Net::HTTPRequestTimeout
|
|
473
|
+
raise Schematic::Errors::TimeoutError
|
|
474
|
+
end
|
|
475
|
+
code = response.code.to_i
|
|
476
|
+
if code.between?(200, 299)
|
|
477
|
+
Schematic::Integrationsapi::Types::ListStripeSandboxCountriesResponse.load(response.body)
|
|
478
|
+
else
|
|
479
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
480
|
+
raise error_class.new(response.body, code: code)
|
|
481
|
+
end
|
|
482
|
+
end
|
|
483
|
+
|
|
315
484
|
# @param request_options [Hash]
|
|
316
485
|
# @param params [Hash]
|
|
317
486
|
# @option request_options [String] :base_url
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Integrationsapi
|
|
5
|
+
module Types
|
|
6
|
+
class ClaimStripeSandboxKeysResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::ClaimedStripeSandboxKeysResponseData }, 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 Integrationsapi
|
|
5
|
+
module Types
|
|
6
|
+
class GetStripeSandboxClaimLinkResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::StripeSandboxClaimLink }, 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 Integrationsapi
|
|
5
|
+
module Types
|
|
6
|
+
class GetStripeSandboxKeysResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::ClaimedStripeSandboxKeysResponseData }, 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 Integrationsapi
|
|
5
|
+
module Types
|
|
6
|
+
class InstallStripeClaimableSandboxResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::StripeSandboxInstallResponseData }, 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,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Integrationsapi
|
|
5
|
+
module Types
|
|
6
|
+
class InstallStripeSandboxRequestBody < Internal::Types::Model
|
|
7
|
+
field :country, -> { String }, optional: true, nullable: false
|
|
8
|
+
|
|
9
|
+
field :email, -> { String }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :name, -> { String }, optional: true, nullable: false
|
|
12
|
+
|
|
13
|
+
field :seed_sample_data, -> { Internal::Types::Boolean }, optional: true, nullable: false
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Integrationsapi
|
|
5
|
+
module Types
|
|
6
|
+
class ListStripeSandboxCountriesResponse < Internal::Types::Model
|
|
7
|
+
field :data, -> { Schematic::Types::StripeSandboxCountriesResponseData }, 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
|
|
@@ -202,7 +202,7 @@ module Schematic
|
|
|
202
202
|
cache_key = build_cache_key(key, company, user)
|
|
203
203
|
found = false
|
|
204
204
|
@flag_check_cache_providers.each do |provider|
|
|
205
|
-
cached = provider.get(cache_key)
|
|
205
|
+
cached = coerce_cached_response(provider.get(cache_key))
|
|
206
206
|
next unless cached
|
|
207
207
|
|
|
208
208
|
cached_results[key] = { flag: key, value: cached.value, reason: cached.reason }
|
|
@@ -384,11 +384,20 @@ module Schematic
|
|
|
384
384
|
|
|
385
385
|
# --- Internal Flag Checking ---
|
|
386
386
|
|
|
387
|
+
# Cache providers that serialize (RedisCacheProvider) hand back a Hash, not
|
|
388
|
+
# the CheckFlagResponse that was stored; the in-memory cache returns the
|
|
389
|
+
# object itself. Normalize so callers can use the response API either way.
|
|
390
|
+
def coerce_cached_response(cached)
|
|
391
|
+
return cached unless cached.is_a?(Hash)
|
|
392
|
+
|
|
393
|
+
CheckFlagResponse.new(cached)
|
|
394
|
+
end
|
|
395
|
+
|
|
387
396
|
def check_flag_via_api(flag_key, company, user)
|
|
388
397
|
# Check cache
|
|
389
398
|
cache_key = build_cache_key(flag_key, company, user)
|
|
390
399
|
@flag_check_cache_providers.each do |provider|
|
|
391
|
-
cached = provider.get(cache_key)
|
|
400
|
+
cached = coerce_cached_response(provider.get(cache_key))
|
|
392
401
|
if cached
|
|
393
402
|
@logger.debug("Flag '#{flag_key}' found in cache (value=#{cached.value})")
|
|
394
403
|
return cached
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Types
|
|
5
|
+
class ClaimedStripeSandboxKeysResponseData < Internal::Types::Model
|
|
6
|
+
field :publishable, -> { String }, optional: false, nullable: false
|
|
7
|
+
|
|
8
|
+
field :sandbox_id, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :secret, -> { String }, optional: false, nullable: false
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|