decthings_api/client/rpc/spawned/
request.rs1use crate::client::rpc::ExecutionLocationProvider;
2use serde::Serialize;
3
4#[derive(Debug, Clone, Serialize)]
5#[serde(rename_all = "camelCase")]
6pub struct SpawnedCommandOptions {
7 #[serde(skip_serializing_if = "Option::is_none")]
9 pub timeout_seconds: Option<u32>,
10 #[serde(skip_serializing_if = "Option::is_none")]
13 pub timeout_after_inactive_seconds: Option<u32>,
14}
15
16#[derive(Debug, Clone, Serialize)]
17#[serde(rename_all = "camelCase")]
18pub struct SpawnCommandParams<'a, S: AsRef<str>> {
19 pub execution_location: ExecutionLocationProvider<'a>,
21 pub command: &'a str,
23 #[serde(serialize_with = "super::super::serialize_asref_str_seq")]
25 pub args: &'a [S],
26 #[serde(skip_serializing_if = "Option::is_none")]
27 pub options: Option<SpawnedCommandOptions>,
28 #[cfg(feature = "events")]
31 #[serde(skip_serializing_if = "Option::is_none")]
32 pub subscribe_to_events: Option<bool>,
33}
34
35#[derive(Debug, Clone, Serialize)]
36#[serde(rename_all = "camelCase")]
37pub struct FilesystemAccess<'a> {
38 pub model_id: &'a str,
39}
40
41#[derive(Debug, Clone, Serialize)]
42#[serde(rename_all = "camelCase")]
43#[serde(bound(serialize = ""))]
44pub struct SpawnCommandForModelParams<'a, S: AsRef<str>> {
45 pub model_id: &'a str,
47 pub execution_location: ExecutionLocationProvider<'a>,
49 pub command: &'a str,
51 #[serde(serialize_with = "super::super::serialize_asref_str_seq")]
53 pub args: &'a [S],
54 #[serde(skip_serializing_if = "Option::is_none")]
55 pub options: Option<SpawnedCommandOptions>,
56 #[cfg(feature = "events")]
59 #[serde(skip_serializing_if = "Option::is_none")]
60 pub subscribe_to_events: Option<bool>,
61}
62
63#[derive(Debug, Clone, Serialize)]
64#[serde(rename_all = "camelCase")]
65pub struct TerminateSpawnedCommandParams<'a> {
66 pub spawned_command_id: &'a str,
68}
69
70#[derive(Debug, Clone, Serialize)]
71#[serde(rename_all = "camelCase")]
72pub struct GetSpawnedCommandsParams<'a, S: AsRef<str>> {
73 #[serde(serialize_with = "super::super::serialize_option_asref_str_seq")]
75 #[serde(skip_serializing_if = "Option::is_none")]
76 pub spawned_command_ids: Option<&'a [S]>,
77}
78
79#[derive(Debug, Clone, Serialize)]
80#[serde(rename_all = "camelCase")]
81pub struct WriteToSpawnedCommandParams<'a, T: AsRef<[u8]>> {
82 pub spawned_command_id: &'a str,
84 #[serde(skip_serializing)]
85 pub data: T,
86}
87
88#[cfg(feature = "events")]
89#[derive(Debug, Clone, Serialize)]
90#[serde(rename_all = "camelCase")]
91pub struct SpawnedSubscribeToEventsParams<'a> {
92 pub spawned_command_id: &'a str,
94}
95
96#[cfg(feature = "events")]
97#[derive(Debug, Clone, Serialize)]
98#[serde(rename_all = "camelCase")]
99pub struct SpawnedUnsubscribeFromEventsParams<'a> {
100 pub spawned_command_id: &'a str,
102}