schematichq 1.5.9 → 1.5.10
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 +3 -3
- data/.fern/replay.lock +7 -1
- data/README.md +6 -2
- data/lib/schematic/accesstokens/types/issue_temporary_access_token_request_body.rb +2 -0
- data/lib/schematic/accounts/client.rb +6 -0
- data/lib/schematic/accounts/types/count_audit_logs_params.rb +2 -0
- data/lib/schematic/accounts/types/count_audit_logs_request.rb +2 -0
- data/lib/schematic/accounts/types/list_audit_logs_params.rb +2 -0
- data/lib/schematic/accounts/types/list_audit_logs_request.rb +2 -0
- data/lib/schematic/client.rb +1 -1
- data/lib/schematic/credits/leases/check.rb +1 -1
- data/lib/schematic/events/client.rb +112 -0
- data/lib/schematic/events/types/get_inference_cost_params.rb +16 -0
- data/lib/schematic/events/types/get_inference_cost_request.rb +13 -0
- data/lib/schematic/events/types/get_inference_cost_response.rb +15 -0
- data/lib/schematic/events/types/list_inference_cost_rates_params.rb +22 -0
- data/lib/schematic/events/types/list_inference_cost_rates_request.rb +19 -0
- data/lib/schematic/events/types/list_inference_cost_rates_response.rb +15 -0
- data/lib/schematic/integrationsapi/client.rb +40 -0
- data/lib/schematic/integrationsapi/types/get_zuora_connection_health_response.rb +15 -0
- data/lib/schematic/planbundle/types/create_custom_plan_bundle_request_body.rb +2 -0
- data/lib/schematic/planbundle/types/update_plan_bundle_request_body.rb +2 -0
- data/lib/schematic/schematic_client.rb +6 -1
- data/lib/schematic/types/audit_log_end_user_response_data.rb +13 -0
- data/lib/schematic/types/audit_log_list_response_data.rb +4 -0
- data/lib/schematic/types/audit_log_response_data.rb +4 -0
- data/lib/schematic/types/company_billing_entity_subscription_response_data.rb +2 -0
- data/lib/schematic/types/company_subscription_response_data.rb +2 -0
- data/lib/schematic/types/credit_balance_export_metadata.rb +17 -0
- data/lib/schematic/types/data_export_metadata.rb +4 -0
- data/lib/schematic/types/data_export_type.rb +2 -0
- data/lib/schematic/types/inference_cost_rate_response_data.rb +31 -0
- data/lib/schematic/types/inference_cost_rate_scope.rb +14 -0
- data/lib/schematic/types/inference_cost_response_data.rb +21 -0
- data/lib/schematic/types/integration_config.rb +2 -0
- data/lib/schematic/types/integration_type.rb +1 -0
- data/lib/schematic/types/issue_temporary_access_token_response_data.rb +2 -0
- data/lib/schematic/types/plan_version_response_data.rb +2 -0
- data/lib/schematic/types/preview_subscription_change_response_data.rb +2 -0
- data/lib/schematic/types/publish_preview_response_data.rb +2 -0
- data/lib/schematic/types/renewal_destination_request_body.rb +13 -0
- data/lib/schematic/types/renewal_destination_response_data.rb +13 -0
- data/lib/schematic/types/renewal_policy.rb +1 -0
- data/lib/schematic/types/scheduled_checkout_response_data.rb +2 -0
- data/lib/schematic/types/temporary_access_token_response_data.rb +2 -0
- data/lib/schematic/types/user_export_metadata.rb +24 -0
- data/lib/schematic/types/webhook_request_type.rb +2 -0
- data/lib/schematic/types/zuora_connection_health.rb +15 -0
- data/lib/schematic/types/zuora_integration_config.rb +13 -0
- data/lib/schematic/version.rb +1 -1
- data/lib/schematic.rb +17 -0
- data/reference.md +231 -4
- metadata +19 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c78bb47017b2c0fd54a2c3ccca4f9bd2391b74cb20888e16ae70d7d2a45a7669
|
|
4
|
+
data.tar.gz: 8137897db8c90e3df203795de515df733399aee068d851d1a85ea8e9a8bc2e41
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e62bb51c5948c1541cdcc0ce47857d091c73c3127a09394061f7ee10d65af2702c5858b05dda2a6b0a17bd62b3971dd7ebc3e58aefd1ef0fc7e980c85bffa989
|
|
7
|
+
data.tar.gz: d1220c0df6c6ffccd9ddf123b08a3d9c9f1188e26a3073ffc9e9c0879122a53df1641d069861750ea62bb5d890e8b8a52b35b46fd833cbafff8dbfe35ef6f72d
|
data/.fern/metadata.json
CHANGED
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"webrick": ">= 1.0"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
|
-
"originGitCommit": "
|
|
16
|
+
"originGitCommit": "3d9efd5b60b30d53cb9c28b85c6a10448f7498d5",
|
|
17
17
|
"originGitCommitIsDirty": false,
|
|
18
18
|
"invokedBy": "ci",
|
|
19
|
-
"requestedVersion": "1.5.
|
|
19
|
+
"requestedVersion": "1.5.10",
|
|
20
20
|
"ciProvider": "github",
|
|
21
|
-
"sdkVersion": "1.5.
|
|
21
|
+
"sdkVersion": "1.5.10"
|
|
22
22
|
}
|
data/.fern/replay.lock
CHANGED
|
@@ -156,5 +156,11 @@ generations:
|
|
|
156
156
|
cli_version: unknown
|
|
157
157
|
generator_versions:
|
|
158
158
|
fernapi/fern-ruby-sdk: 1.43.1
|
|
159
|
-
|
|
159
|
+
- commit_sha: 52949ae017eb601227805cf6bc0f11b68cdc096c
|
|
160
|
+
tree_hash: a6ba5fc52b21d4e0c49ef60655a3715145580867
|
|
161
|
+
timestamp: 2026-11-23T10:02:28.974Z
|
|
162
|
+
cli_version: unknown
|
|
163
|
+
generator_versions:
|
|
164
|
+
fernapi/fern-ruby-sdk: 1.43.1
|
|
165
|
+
current_generation: 52949ae017eb601227805cf6bc0f11b68cdc096c
|
|
160
166
|
patches: []
|
data/README.md
CHANGED
|
@@ -439,7 +439,7 @@ else
|
|
|
439
439
|
end
|
|
440
440
|
```
|
|
441
441
|
|
|
442
|
-
A check can allow without reserving credits (the feature is not credit-metered, `usage` is 0,
|
|
442
|
+
A check can allow without reserving credits (the feature is not credit-metered, `usage` is 0, the check failed open, or in Replicator Mode the cache is not ready yet), and that usage still has to be tracked.
|
|
443
443
|
|
|
444
444
|
Without `credit_leases` configured, or without a `usage`, `check` falls through to a plain flag check with no reservation. `usage` is still sent as a preflight, locally or to the API, so the verdict accounts for what the call is about to spend. Preflighted verdicts are not cached.
|
|
445
445
|
|
|
@@ -732,7 +732,11 @@ When running in Replicator Mode, the client will:
|
|
|
732
732
|
|
|
733
733
|
The client serves flag checks from the cache only once the replicator reports that its cache is ready. The replicator's health endpoint returns `ready: true` once it has fully loaded the cache for its current `cache_version`, and `ready: false` (HTTP 503) before that. Until the client sees `ready: true`, `check_flag`, `check_flag_with_entitlement` and `check_flags` all skip the cache and call the Schematic API, falling back to your flag defaults if the API call fails. Single and bulk checks follow the same rule. Only an explicit answer changes readiness. If the health endpoint can't be reached, times out, or returns a body without a `ready` field the client can read, the client keeps the readiness and `cache_version` from the last answer it got. Before the first answer, the cache counts as not ready.
|
|
734
734
|
|
|
735
|
-
Once the cache is ready, flag checks evaluate locally from the cache. A flag that isn't in the cache still falls back to the API.
|
|
735
|
+
Once the cache is ready, flag checks evaluate locally from the cache. A flag that isn't in the cache still falls back to the API.
|
|
736
|
+
|
|
737
|
+
The same gate applies to `check` with `usage` in client credit-lease mode: while the cache is not ready, it runs as a plain check through the API and holds no credits, the same as when the flag or company is missing from the cache. Prewarming leases is not a flag check and still resolves companies without waiting for readiness.
|
|
738
|
+
|
|
739
|
+
The DataStream client's `cache_ready?` reports the same readiness the flag checks use.
|
|
736
740
|
|
|
737
741
|
## Testing
|
|
738
742
|
|
|
@@ -7,6 +7,8 @@ module Schematic
|
|
|
7
7
|
field :lookup, -> { Internal::Types::Hash[String, String] }, optional: false, nullable: false
|
|
8
8
|
|
|
9
9
|
field :resource_type, -> { String }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :user_lookup, -> { Internal::Types::Hash[String, String] }, optional: true, nullable: false
|
|
10
12
|
end
|
|
11
13
|
end
|
|
12
14
|
end
|
|
@@ -342,6 +342,7 @@ module Schematic
|
|
|
342
342
|
# @option params [Schematic::Types::ActorType, nil] :actor_type
|
|
343
343
|
# @option params [String, nil] :company_id
|
|
344
344
|
# @option params [String, nil] :end_time
|
|
345
|
+
# @option params [String, nil] :end_user_id
|
|
345
346
|
# @option params [String, nil] :environment_id
|
|
346
347
|
# @option params [String, nil] :q
|
|
347
348
|
# @option params [String, nil] :start_time
|
|
@@ -353,6 +354,7 @@ module Schematic
|
|
|
353
354
|
# actor_type: "api_key",
|
|
354
355
|
# company_id: "company_id",
|
|
355
356
|
# end_time: "2024-01-15T09:30:00Z",
|
|
357
|
+
# end_user_id: "end_user_id",
|
|
356
358
|
# environment_id: "environment_id",
|
|
357
359
|
# q: "q",
|
|
358
360
|
# start_time: "2024-01-15T09:30:00Z",
|
|
@@ -367,6 +369,7 @@ module Schematic
|
|
|
367
369
|
query_params["actor_type"] = params[:actor_type] if params.key?(:actor_type)
|
|
368
370
|
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
|
|
369
371
|
query_params["end_time"] = params[:end_time] if params.key?(:end_time)
|
|
372
|
+
query_params["end_user_id"] = params[:end_user_id] if params.key?(:end_user_id)
|
|
370
373
|
query_params["environment_id"] = params[:environment_id] if params.key?(:environment_id)
|
|
371
374
|
query_params["q"] = params[:q] if params.key?(:q)
|
|
372
375
|
query_params["start_time"] = params[:start_time] if params.key?(:start_time)
|
|
@@ -454,6 +457,7 @@ module Schematic
|
|
|
454
457
|
# @option params [Schematic::Types::ActorType, nil] :actor_type
|
|
455
458
|
# @option params [String, nil] :company_id
|
|
456
459
|
# @option params [String, nil] :end_time
|
|
460
|
+
# @option params [String, nil] :end_user_id
|
|
457
461
|
# @option params [String, nil] :environment_id
|
|
458
462
|
# @option params [String, nil] :q
|
|
459
463
|
# @option params [String, nil] :start_time
|
|
@@ -465,6 +469,7 @@ module Schematic
|
|
|
465
469
|
# actor_type: "api_key",
|
|
466
470
|
# company_id: "company_id",
|
|
467
471
|
# end_time: "2024-01-15T09:30:00Z",
|
|
472
|
+
# end_user_id: "end_user_id",
|
|
468
473
|
# environment_id: "environment_id",
|
|
469
474
|
# q: "q",
|
|
470
475
|
# start_time: "2024-01-15T09:30:00Z",
|
|
@@ -479,6 +484,7 @@ module Schematic
|
|
|
479
484
|
query_params["actor_type"] = params[:actor_type] if params.key?(:actor_type)
|
|
480
485
|
query_params["company_id"] = params[:company_id] if params.key?(:company_id)
|
|
481
486
|
query_params["end_time"] = params[:end_time] if params.key?(:end_time)
|
|
487
|
+
query_params["end_user_id"] = params[:end_user_id] if params.key?(:end_user_id)
|
|
482
488
|
query_params["environment_id"] = params[:environment_id] if params.key?(:environment_id)
|
|
483
489
|
query_params["q"] = params[:q] if params.key?(:q)
|
|
484
490
|
query_params["start_time"] = params[:start_time] if params.key?(:start_time)
|
|
@@ -13,6 +13,8 @@ module Schematic
|
|
|
13
13
|
|
|
14
14
|
field :end_time, -> { String }, optional: true, nullable: false
|
|
15
15
|
|
|
16
|
+
field :end_user_id, -> { String }, optional: true, nullable: false
|
|
17
|
+
|
|
16
18
|
field :environment_id, -> { String }, optional: true, nullable: false
|
|
17
19
|
|
|
18
20
|
field :limit, -> { Integer }, optional: true, nullable: false
|
|
@@ -10,6 +10,8 @@ module Schematic
|
|
|
10
10
|
|
|
11
11
|
field :end_time, -> { String }, optional: true, nullable: false
|
|
12
12
|
|
|
13
|
+
field :end_user_id, -> { String }, optional: true, nullable: false
|
|
14
|
+
|
|
13
15
|
field :environment_id, -> { String }, optional: true, nullable: false
|
|
14
16
|
|
|
15
17
|
field :q, -> { String }, optional: true, nullable: false
|
|
@@ -13,6 +13,8 @@ module Schematic
|
|
|
13
13
|
|
|
14
14
|
field :end_time, -> { String }, optional: true, nullable: false
|
|
15
15
|
|
|
16
|
+
field :end_user_id, -> { String }, optional: true, nullable: false
|
|
17
|
+
|
|
16
18
|
field :environment_id, -> { String }, optional: true, nullable: false
|
|
17
19
|
|
|
18
20
|
field :limit, -> { Integer }, optional: true, nullable: false
|
|
@@ -10,6 +10,8 @@ module Schematic
|
|
|
10
10
|
|
|
11
11
|
field :end_time, -> { String }, optional: true, nullable: false
|
|
12
12
|
|
|
13
|
+
field :end_user_id, -> { String }, optional: true, nullable: false
|
|
14
|
+
|
|
13
15
|
field :environment_id, -> { String }, optional: true, nullable: false
|
|
14
16
|
|
|
15
17
|
field :q, -> { String }, optional: true, nullable: false
|
data/lib/schematic/client.rb
CHANGED
|
@@ -43,7 +43,7 @@ module Schematic
|
|
|
43
43
|
@raw_client = Schematic::Internal::Http::RawClient.new(
|
|
44
44
|
base_url: base_url || Schematic::Environment::DEFAULT,
|
|
45
45
|
headers: {
|
|
46
|
-
"User-Agent" => "schematichq/1.5.
|
|
46
|
+
"User-Agent" => "schematichq/1.5.10",
|
|
47
47
|
"X-Fern-Language" => "Ruby",
|
|
48
48
|
"X-Schematic-Api-Key" => api_key.to_s
|
|
49
49
|
},
|
|
@@ -149,7 +149,7 @@ module Schematic
|
|
|
149
149
|
def datastream_unavailable?
|
|
150
150
|
return false if @deps.datastream
|
|
151
151
|
|
|
152
|
-
@logger.debug("Credit-lease check requested without
|
|
152
|
+
@logger.debug("Credit-lease check requested without a ready DataStream cache, falling back to plain check")
|
|
153
153
|
true
|
|
154
154
|
end
|
|
155
155
|
|
|
@@ -268,6 +268,118 @@ module Schematic
|
|
|
268
268
|
end
|
|
269
269
|
end
|
|
270
270
|
|
|
271
|
+
# @param request_options [Hash]
|
|
272
|
+
# @param params [Hash]
|
|
273
|
+
# @option request_options [String] :base_url
|
|
274
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
275
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
276
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
277
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
278
|
+
# @option params [String, nil] :end_time
|
|
279
|
+
# @option params [String, nil] :start_time
|
|
280
|
+
#
|
|
281
|
+
# @example
|
|
282
|
+
# client.events.get_inference_cost(
|
|
283
|
+
# end_time: "2024-01-15T09:30:00Z",
|
|
284
|
+
# start_time: "2024-01-15T09:30:00Z"
|
|
285
|
+
# )
|
|
286
|
+
#
|
|
287
|
+
# @return [Schematic::Events::Types::GetInferenceCostResponse]
|
|
288
|
+
def get_inference_cost(request_options: {}, **params)
|
|
289
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
290
|
+
query_params = {}
|
|
291
|
+
query_params["end_time"] = params[:end_time] if params.key?(:end_time)
|
|
292
|
+
query_params["start_time"] = params[:start_time] if params.key?(:start_time)
|
|
293
|
+
|
|
294
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
295
|
+
base_url: request_options[:base_url],
|
|
296
|
+
method: "GET",
|
|
297
|
+
path: "inference-cost",
|
|
298
|
+
query: query_params,
|
|
299
|
+
request_options: request_options
|
|
300
|
+
)
|
|
301
|
+
begin
|
|
302
|
+
response = @client.send(request)
|
|
303
|
+
rescue Net::HTTPRequestTimeout
|
|
304
|
+
raise Schematic::Errors::TimeoutError
|
|
305
|
+
end
|
|
306
|
+
code = response.code.to_i
|
|
307
|
+
if code.between?(200, 299)
|
|
308
|
+
(response.body.to_s.empty? ? nil : Schematic::Events::Types::GetInferenceCostResponse.load(response.body))
|
|
309
|
+
else
|
|
310
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
311
|
+
error_types = {
|
|
312
|
+
401 => Schematic::Types::ApiError,
|
|
313
|
+
403 => Schematic::Types::ApiError,
|
|
314
|
+
404 => Schematic::Types::ApiError,
|
|
315
|
+
500 => Schematic::Types::ApiError
|
|
316
|
+
}
|
|
317
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
318
|
+
raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
|
|
319
|
+
end
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
# @param request_options [Hash]
|
|
323
|
+
# @param params [Hash]
|
|
324
|
+
# @option request_options [String] :base_url
|
|
325
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
326
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
327
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
328
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
329
|
+
# @option params [String, nil] :provider
|
|
330
|
+
# @option params [String, nil] :response_model
|
|
331
|
+
# @option params [Schematic::Types::InferenceCostRateScope, nil] :scope
|
|
332
|
+
# @option params [Integer, nil] :limit
|
|
333
|
+
# @option params [Integer, nil] :offset
|
|
334
|
+
#
|
|
335
|
+
# @example
|
|
336
|
+
# client.events.list_inference_cost_rates(
|
|
337
|
+
# provider: "provider",
|
|
338
|
+
# response_model: "response_model",
|
|
339
|
+
# scope: "account",
|
|
340
|
+
# limit: 1000000,
|
|
341
|
+
# offset: 1000000
|
|
342
|
+
# )
|
|
343
|
+
#
|
|
344
|
+
# @return [Schematic::Events::Types::ListInferenceCostRatesResponse]
|
|
345
|
+
def list_inference_cost_rates(request_options: {}, **params)
|
|
346
|
+
params = Schematic::Internal::Types::Utils.normalize_keys(params)
|
|
347
|
+
query_params = {}
|
|
348
|
+
query_params["provider"] = params[:provider] if params.key?(:provider)
|
|
349
|
+
query_params["response_model"] = params[:response_model] if params.key?(:response_model)
|
|
350
|
+
query_params["scope"] = params[:scope] if params.key?(:scope)
|
|
351
|
+
query_params["limit"] = params[:limit] if params.key?(:limit)
|
|
352
|
+
query_params["offset"] = params[:offset] if params.key?(:offset)
|
|
353
|
+
|
|
354
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
355
|
+
base_url: request_options[:base_url],
|
|
356
|
+
method: "GET",
|
|
357
|
+
path: "inference-cost-rates",
|
|
358
|
+
query: query_params,
|
|
359
|
+
request_options: request_options
|
|
360
|
+
)
|
|
361
|
+
begin
|
|
362
|
+
response = @client.send(request)
|
|
363
|
+
rescue Net::HTTPRequestTimeout
|
|
364
|
+
raise Schematic::Errors::TimeoutError
|
|
365
|
+
end
|
|
366
|
+
code = response.code.to_i
|
|
367
|
+
if code.between?(200, 299)
|
|
368
|
+
(response.body.to_s.empty? ? nil : Schematic::Events::Types::ListInferenceCostRatesResponse.load(response.body))
|
|
369
|
+
else
|
|
370
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
371
|
+
error_types = {
|
|
372
|
+
400 => Schematic::Types::ApiError,
|
|
373
|
+
401 => Schematic::Types::ApiError,
|
|
374
|
+
403 => Schematic::Types::ApiError,
|
|
375
|
+
404 => Schematic::Types::ApiError,
|
|
376
|
+
500 => Schematic::Types::ApiError
|
|
377
|
+
}
|
|
378
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
379
|
+
raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
|
|
380
|
+
end
|
|
381
|
+
end
|
|
382
|
+
|
|
271
383
|
# @param request_options [Hash]
|
|
272
384
|
# @param params [Hash]
|
|
273
385
|
# @option request_options [String] :base_url
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../../../schematic"
|
|
4
|
+
|
|
5
|
+
module Schematic
|
|
6
|
+
module Events
|
|
7
|
+
module Types
|
|
8
|
+
# Input parameters
|
|
9
|
+
class GetInferenceCostParams < Internal::Types::Model
|
|
10
|
+
field :end_time, -> { String }, optional: true, nullable: false
|
|
11
|
+
|
|
12
|
+
field :start_time, -> { String }, optional: true, nullable: false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Events
|
|
5
|
+
module Types
|
|
6
|
+
class GetInferenceCostRequest < Internal::Types::Model
|
|
7
|
+
field :end_time, -> { String }, optional: true, nullable: false
|
|
8
|
+
|
|
9
|
+
field :start_time, -> { String }, optional: true, nullable: false
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../../../schematic"
|
|
4
|
+
|
|
5
|
+
module Schematic
|
|
6
|
+
module Events
|
|
7
|
+
module Types
|
|
8
|
+
class GetInferenceCostResponse < Internal::Types::Model
|
|
9
|
+
field :data, -> { Schematic::Types::InferenceCostResponseData }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :params, -> { Schematic::Events::Types::GetInferenceCostParams }, optional: false, nullable: false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../../../schematic"
|
|
4
|
+
|
|
5
|
+
module Schematic
|
|
6
|
+
module Events
|
|
7
|
+
module Types
|
|
8
|
+
# Input parameters
|
|
9
|
+
class ListInferenceCostRatesParams < Internal::Types::Model
|
|
10
|
+
field :limit, -> { Integer }, optional: true, nullable: false
|
|
11
|
+
|
|
12
|
+
field :offset, -> { Integer }, optional: true, nullable: false
|
|
13
|
+
|
|
14
|
+
field :provider, -> { String }, optional: true, nullable: false
|
|
15
|
+
|
|
16
|
+
field :response_model, -> { String }, optional: true, nullable: false
|
|
17
|
+
|
|
18
|
+
field :scope, -> { Schematic::Types::InferenceCostRateScope }, optional: true, nullable: false
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Schematic
|
|
4
|
+
module Events
|
|
5
|
+
module Types
|
|
6
|
+
class ListInferenceCostRatesRequest < Internal::Types::Model
|
|
7
|
+
field :provider, -> { String }, optional: true, nullable: false
|
|
8
|
+
|
|
9
|
+
field :response_model, -> { String }, optional: true, nullable: false
|
|
10
|
+
|
|
11
|
+
field :scope, -> { Schematic::Types::InferenceCostRateScope }, optional: true, nullable: false
|
|
12
|
+
|
|
13
|
+
field :limit, -> { Integer }, optional: true, nullable: false
|
|
14
|
+
|
|
15
|
+
field :offset, -> { Integer }, optional: true, nullable: false
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../../../schematic"
|
|
4
|
+
|
|
5
|
+
module Schematic
|
|
6
|
+
module Events
|
|
7
|
+
module Types
|
|
8
|
+
class ListInferenceCostRatesResponse < Internal::Types::Model
|
|
9
|
+
field :data, -> { Internal::Types::Array[Schematic::Types::InferenceCostRateResponseData] }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :params, -> { Schematic::Events::Types::ListInferenceCostRatesParams }, optional: false, nullable: false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -621,6 +621,46 @@ module Schematic
|
|
|
621
621
|
raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
|
|
622
622
|
end
|
|
623
623
|
end
|
|
624
|
+
|
|
625
|
+
# @param request_options [Hash]
|
|
626
|
+
# @param _params [Hash]
|
|
627
|
+
# @option request_options [String] :base_url
|
|
628
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
629
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
630
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
631
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
632
|
+
#
|
|
633
|
+
# @example
|
|
634
|
+
# client.integrationsapi.get_zuora_connection_health
|
|
635
|
+
#
|
|
636
|
+
# @return [Schematic::Integrationsapi::Types::GetZuoraConnectionHealthResponse]
|
|
637
|
+
def get_zuora_connection_health(request_options: {}, **_params)
|
|
638
|
+
request = Schematic::Internal::JSON::Request.new(
|
|
639
|
+
base_url: request_options[:base_url],
|
|
640
|
+
method: "GET",
|
|
641
|
+
path: "integrations/zuora/health",
|
|
642
|
+
request_options: request_options
|
|
643
|
+
)
|
|
644
|
+
begin
|
|
645
|
+
response = @client.send(request)
|
|
646
|
+
rescue Net::HTTPRequestTimeout
|
|
647
|
+
raise Schematic::Errors::TimeoutError
|
|
648
|
+
end
|
|
649
|
+
code = response.code.to_i
|
|
650
|
+
if code.between?(200, 299)
|
|
651
|
+
(response.body.to_s.empty? ? nil : Schematic::Integrationsapi::Types::GetZuoraConnectionHealthResponse.load(response.body))
|
|
652
|
+
else
|
|
653
|
+
error_class = Schematic::Errors::ResponseError.subclass_for_code(code)
|
|
654
|
+
error_types = {
|
|
655
|
+
401 => Schematic::Types::ApiError,
|
|
656
|
+
403 => Schematic::Types::ApiError,
|
|
657
|
+
404 => Schematic::Types::ApiError,
|
|
658
|
+
500 => Schematic::Types::ApiError
|
|
659
|
+
}
|
|
660
|
+
error_body = Schematic::Errors::ResponseError.load_error_body(code, response.body, error_types)
|
|
661
|
+
raise error_class.new(response.body, code: code, body: error_body, headers: response.to_hash)
|
|
662
|
+
end
|
|
663
|
+
end
|
|
624
664
|
end
|
|
625
665
|
end
|
|
626
666
|
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../../../schematic"
|
|
4
|
+
|
|
5
|
+
module Schematic
|
|
6
|
+
module Integrationsapi
|
|
7
|
+
module Types
|
|
8
|
+
class GetZuoraConnectionHealthResponse < Internal::Types::Model
|
|
9
|
+
field :data, -> { Schematic::Types::ZuoraConnectionHealth }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :params, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -12,6 +12,8 @@ module Schematic
|
|
|
12
12
|
|
|
13
13
|
field :plan, -> { Schematic::Types::CreateCustomPlanBundlePlanRequestBody }, optional: false, nullable: false
|
|
14
14
|
|
|
15
|
+
field :renewal_destination, -> { Schematic::Types::RenewalDestinationRequestBody }, optional: true, nullable: false
|
|
16
|
+
|
|
15
17
|
field :renewal_policy, -> { Schematic::Types::RenewalPolicy }, optional: true, nullable: false
|
|
16
18
|
end
|
|
17
19
|
end
|
|
@@ -16,6 +16,8 @@ module Schematic
|
|
|
16
16
|
|
|
17
17
|
field :plan_version_id, -> { String }, optional: true, nullable: false
|
|
18
18
|
|
|
19
|
+
field :renewal_destination, -> { Schematic::Types::RenewalDestinationRequestBody }, optional: true, nullable: false
|
|
20
|
+
|
|
19
21
|
field :renewal_policy, -> { Schematic::Types::RenewalPolicy }, optional: true, nullable: false
|
|
20
22
|
end
|
|
21
23
|
end
|
|
@@ -394,7 +394,12 @@ module Schematic
|
|
|
394
394
|
Credits::Leases.check_with_lease(
|
|
395
395
|
Credits::Leases::CheckDeps.new(
|
|
396
396
|
lease_store: @lease_store, reservations: @reservations, manager: @credit_lease_manager,
|
|
397
|
-
|
|
397
|
+
# The lease flow reads the flag, company and user from the DataStream
|
|
398
|
+
# cache, so it waits on the same readiness as the plain flag checks.
|
|
399
|
+
# Until the replicator reports its cache ready, it gets no DataStream
|
|
400
|
+
# and runs the plain check, as it does on a cache miss, holding
|
|
401
|
+
# nothing.
|
|
402
|
+
datastream: @datastream_client&.cache_ready? ? @datastream_client : nil, logger: @logger,
|
|
398
403
|
# Lease-path checks must stay visible to flag-check analytics and
|
|
399
404
|
# company last-seen, the same as every plain check path.
|
|
400
405
|
enqueue_flag_check_event: ->(body) { enqueue_lease_flag_check_event(body) }
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../../schematic"
|
|
4
|
+
|
|
5
|
+
module Schematic
|
|
6
|
+
module Types
|
|
7
|
+
class AuditLogEndUserResponseData < Internal::Types::Model
|
|
8
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :name, -> { String }, optional: false, nullable: false
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -15,6 +15,10 @@ module Schematic
|
|
|
15
15
|
|
|
16
16
|
field :company_id, -> { String }, optional: true, nullable: false
|
|
17
17
|
|
|
18
|
+
field :end_user, -> { Schematic::Types::AuditLogEndUserResponseData }, optional: true, nullable: false
|
|
19
|
+
|
|
20
|
+
field :end_user_id, -> { String }, optional: true, nullable: false
|
|
21
|
+
|
|
18
22
|
field :ended_at, -> { String }, optional: true, nullable: false
|
|
19
23
|
|
|
20
24
|
field :environment, -> { Schematic::Types::EnvironmentResponseData }, optional: true, nullable: false
|
|
@@ -17,6 +17,10 @@ module Schematic
|
|
|
17
17
|
|
|
18
18
|
field :company_id, -> { String }, optional: true, nullable: false
|
|
19
19
|
|
|
20
|
+
field :end_user, -> { Schematic::Types::AuditLogEndUserResponseData }, optional: true, nullable: false
|
|
21
|
+
|
|
22
|
+
field :end_user_id, -> { String }, optional: true, nullable: false
|
|
23
|
+
|
|
20
24
|
field :ended_at, -> { String }, optional: true, nullable: false
|
|
21
25
|
|
|
22
26
|
field :environment, -> { Schematic::Types::EnvironmentResponseData }, optional: true, nullable: false
|
|
@@ -21,6 +21,8 @@ module Schematic
|
|
|
21
21
|
|
|
22
22
|
field :interval, -> { String }, optional: false, nullable: false
|
|
23
23
|
|
|
24
|
+
field :interval_count, -> { Integer }, optional: true, nullable: false
|
|
25
|
+
|
|
24
26
|
field :is_initial, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
25
27
|
|
|
26
28
|
field :latest_invoice, -> { Schematic::Types::InvoiceResponseData }, optional: true, nullable: false
|
|
@@ -19,6 +19,8 @@ module Schematic
|
|
|
19
19
|
|
|
20
20
|
field :interval, -> { String }, optional: false, nullable: false
|
|
21
21
|
|
|
22
|
+
field :interval_count, -> { Integer }, optional: true, nullable: false
|
|
23
|
+
|
|
22
24
|
field :is_initial, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
23
25
|
|
|
24
26
|
field :latest_invoice, -> { Schematic::Types::InvoiceResponseData }, optional: true, nullable: false
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../../schematic"
|
|
4
|
+
|
|
5
|
+
module Schematic
|
|
6
|
+
module Types
|
|
7
|
+
# Rows are consistent within a page of 250 companies. The As Of column marks when the export started; in a large
|
|
8
|
+
# environment, later pages may include usage recorded after that time.
|
|
9
|
+
class CreditBalanceExportMetadata < Internal::Types::Model
|
|
10
|
+
field :billing_credit_id, -> { String }, optional: true, nullable: false
|
|
11
|
+
|
|
12
|
+
field :company_id, -> { String }, optional: true, nullable: false
|
|
13
|
+
|
|
14
|
+
field :notification_email_recipient_email_addresses, -> { Internal::Types::Array[String] }, optional: true, nullable: false
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -13,9 +13,13 @@ module Schematic
|
|
|
13
13
|
|
|
14
14
|
member -> { Schematic::Types::CompanyFeatureUsageExportMetadata }, key: "COMPANY_FEATURE_USAGE"
|
|
15
15
|
|
|
16
|
+
member -> { Schematic::Types::CreditBalanceExportMetadata }, key: "CREDIT_BALANCE"
|
|
17
|
+
|
|
16
18
|
member -> { Schematic::Types::CreditLedgerExportMetadata }, key: "CREDIT_LEDGER"
|
|
17
19
|
|
|
18
20
|
member -> { Schematic::Types::EventExportMetadata }, key: "EVENT"
|
|
21
|
+
|
|
22
|
+
member -> { Schematic::Types::UserExportMetadata }, key: "USER"
|
|
19
23
|
end
|
|
20
24
|
end
|
|
21
25
|
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../../schematic"
|
|
4
|
+
|
|
5
|
+
module Schematic
|
|
6
|
+
module Types
|
|
7
|
+
class InferenceCostRateResponseData < Internal::Types::Model
|
|
8
|
+
field :created_at, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :currency, -> { String }, optional: false, nullable: false
|
|
11
|
+
|
|
12
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
13
|
+
|
|
14
|
+
field :pinned, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
15
|
+
|
|
16
|
+
field :provider, -> { String }, optional: false, nullable: false
|
|
17
|
+
|
|
18
|
+
field :rates, -> { Internal::Types::Hash[String, Float] }, optional: false, nullable: false
|
|
19
|
+
|
|
20
|
+
field :repriced_at, -> { String }, optional: true, nullable: false
|
|
21
|
+
|
|
22
|
+
field :response_model, -> { String }, optional: false, nullable: false
|
|
23
|
+
|
|
24
|
+
field :scope, -> { Schematic::Types::InferenceCostRateScope }, optional: false, nullable: false
|
|
25
|
+
|
|
26
|
+
field :starting_at, -> { String }, optional: false, nullable: false
|
|
27
|
+
|
|
28
|
+
field :updated_at, -> { String }, optional: false, nullable: false
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|