fix spacetime-client runtime tracking batch mapper
This commit is contained in:
@@ -158,9 +158,9 @@ pub(crate) use self::runtime::{
|
|||||||
build_creation_entry_config_record_from_rows, map_creation_entry_config_procedure_result,
|
build_creation_entry_config_record_from_rows, map_creation_entry_config_procedure_result,
|
||||||
map_runtime_setting_procedure_result, map_runtime_snapshot_delete_procedure_result,
|
map_runtime_setting_procedure_result, map_runtime_snapshot_delete_procedure_result,
|
||||||
map_runtime_snapshot_procedure_result, map_runtime_snapshot_required_procedure_result,
|
map_runtime_snapshot_procedure_result, map_runtime_snapshot_required_procedure_result,
|
||||||
map_runtime_tracking_event_procedure_result, map_runtime_tracking_scope_kind,
|
map_runtime_tracking_event_batch_procedure_result, map_runtime_tracking_event_procedure_result,
|
||||||
map_runtime_tracking_scope_kind_back, parse_json_array, parse_json_string_array,
|
map_runtime_tracking_scope_kind, map_runtime_tracking_scope_kind_back, parse_json_array,
|
||||||
parse_json_value, parse_supported_actions_json,
|
parse_json_string_array, parse_json_value, parse_supported_actions_json,
|
||||||
};
|
};
|
||||||
pub(crate) use self::runtime_profile::{
|
pub(crate) use self::runtime_profile::{
|
||||||
map_analytics_metric_query_procedure_result, map_runtime_profile_dashboard_procedure_result,
|
map_analytics_metric_query_procedure_result, map_runtime_profile_dashboard_procedure_result,
|
||||||
|
|||||||
@@ -92,6 +92,23 @@ impl From<module_runtime::RuntimeSnapshotDeleteInput> for RuntimeSnapshotDeleteI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<module_runtime::RuntimeTrackingEventInput> for RuntimeTrackingEventInput {
|
||||||
|
fn from(input: module_runtime::RuntimeTrackingEventInput) -> Self {
|
||||||
|
Self {
|
||||||
|
event_id: input.event_id,
|
||||||
|
event_key: input.event_key,
|
||||||
|
scope_kind: map_runtime_tracking_scope_kind(input.scope_kind),
|
||||||
|
scope_id: input.scope_id,
|
||||||
|
user_id: input.user_id,
|
||||||
|
owner_user_id: input.owner_user_id,
|
||||||
|
profile_id: input.profile_id,
|
||||||
|
module_key: input.module_key,
|
||||||
|
metadata_json: input.metadata_json,
|
||||||
|
occurred_at_micros: input.occurred_at_micros,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub type CreationEntryConfigRecord =
|
pub type CreationEntryConfigRecord =
|
||||||
shared_contracts::creation_entry_config::CreationEntryConfigResponse;
|
shared_contracts::creation_entry_config::CreationEntryConfigResponse;
|
||||||
|
|
||||||
@@ -213,6 +230,16 @@ pub(crate) fn map_runtime_tracking_event_procedure_result(
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn map_runtime_tracking_event_batch_procedure_result(
|
||||||
|
result: RuntimeTrackingEventBatchProcedureResult,
|
||||||
|
) -> Result<u32, SpacetimeClientError> {
|
||||||
|
if !result.ok {
|
||||||
|
return Err(SpacetimeClientError::procedure_failed(result.error_message));
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(result.accepted_count)
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) fn map_runtime_snapshot_procedure_result(
|
pub(crate) fn map_runtime_snapshot_procedure_result(
|
||||||
result: RuntimeSnapshotProcedureResult,
|
result: RuntimeSnapshotProcedureResult,
|
||||||
) -> Result<Option<RuntimeSnapshotRecord>, SpacetimeClientError> {
|
) -> Result<Option<RuntimeSnapshotRecord>, SpacetimeClientError> {
|
||||||
|
|||||||
Reference in New Issue
Block a user