Skip to main content

nominal_api/conjure/clients/scout/compute/api/
compute_service.rs

1use conjure_http::endpoint;
2/// The Compute Service provides the ability to compute the output of compute graphs.
3#[conjure_http::conjure_client(name = "ComputeService")]
4pub trait ComputeService<
5    #[response_body]
6    I: Iterator<
7            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
8        >,
9> {
10    /// Computes the output of the compute graph specified by a ComputeNodeRequest.
11    #[endpoint(
12        method = POST,
13        path = "/compute/v2/compute",
14        name = "compute",
15        accept = conjure_http::client::StdResponseDeserializer
16    )]
17    fn compute(
18        &self,
19        #[auth]
20        auth_: &conjure_object::BearerToken,
21        #[body(serializer = conjure_http::client::StdRequestSerializer)]
22        request: &super::super::super::super::super::objects::scout::compute::api::ComputeNodeRequest,
23    ) -> Result<
24        super::super::super::super::super::objects::scout::compute::api::ComputeNodeResponse,
25        conjure_http::private::Error,
26    >;
27    /// Computes the output of the compute graph specified by a ParameterizedComputeNodeRequest. A parameterized
28    /// compute request supports multiple values for a single variable, supplied by the ParameterizedContext.
29    /// Results are returned in the same order of the request.
30    #[endpoint(
31        method = POST,
32        path = "/compute/v2/compute/parameterized",
33        name = "parameterizedCompute",
34        accept = conjure_http::client::StdResponseDeserializer
35    )]
36    fn parameterized_compute(
37        &self,
38        #[auth]
39        auth_: &conjure_object::BearerToken,
40        #[body(serializer = conjure_http::client::StdRequestSerializer)]
41        request: &super::super::super::super::super::objects::scout::compute::api::ParameterizedComputeNodeRequest,
42    ) -> Result<
43        super::super::super::super::super::objects::scout::compute::api::ParameterizedComputeNodeResponse,
44        conjure_http::private::Error,
45    >;
46    /// Returns the resulting unit for the output of a compute graph. If the resulting unit is equivalent to exactly
47    /// one existing unit in the system, it will be returned (for example, a series in Coulombs divided by a series
48    /// in Volts will return an output of Farads). If the output does not have units (for example, a range output,)
49    /// the unit result will return noUnitAvailable, and if the computation was not successful, corresponding errors
50    /// are returned.
51    #[endpoint(
52        method = POST,
53        path = "/compute/v2/compute/units",
54        name = "computeUnits",
55        accept = conjure_http::client::StdResponseDeserializer
56    )]
57    fn compute_units(
58        &self,
59        #[auth]
60        auth_: &conjure_object::BearerToken,
61        #[body(serializer = conjure_http::client::StdRequestSerializer)]
62        request: &super::super::super::super::super::objects::scout::compute::api::ComputeUnitsRequest,
63    ) -> Result<
64        super::super::super::super::super::objects::scout::compute::api::ComputeUnitResult,
65        conjure_http::private::Error,
66    >;
67    /// Computes the output of compute graphs specified by BatchComputeNodeRequest. Results are returned in the same
68    /// order as the request.
69    #[endpoint(
70        method = POST,
71        path = "/compute/v2/compute/batch",
72        name = "batchComputeWithUnits",
73        accept = conjure_http::client::StdResponseDeserializer
74    )]
75    fn batch_compute_with_units(
76        &self,
77        #[auth]
78        auth_: &conjure_object::BearerToken,
79        #[body(serializer = conjure_http::client::StdRequestSerializer)]
80        request: &super::super::super::super::super::objects::scout::compute::api::BatchComputeWithUnitsRequest,
81    ) -> Result<
82        super::super::super::super::super::objects::scout::compute::api::BatchComputeWithUnitsResponse,
83        conjure_http::private::Error,
84    >;
85    /// Same as computeUnits, however this endpoint functions on a batch of requests for wire efficiency purposes. An
86    /// extra note is that this method will serialize underlying conjure errors into the BatchComputeUnitResult type,
87    /// meaning callers are required to check for errors explicitly (rather than relying on exceptions being thrown).
88    #[endpoint(
89        method = POST,
90        path = "/compute/v2/compute/batch-units",
91        name = "batchComputeUnits",
92        accept = conjure_http::client::StdResponseDeserializer
93    )]
94    fn batch_compute_units(
95        &self,
96        #[auth]
97        auth_: &conjure_object::BearerToken,
98        #[body(serializer = conjure_http::client::StdRequestSerializer)]
99        request: &super::super::super::super::super::objects::scout::compute::api::BatchComputeUnitsRequest,
100    ) -> Result<
101        super::super::super::super::super::objects::scout::compute::api::BatchComputeUnitResult,
102        conjure_http::private::Error,
103    >;
104    /// Computes the output of the compute graph specified by a ComputeNodeRequest, as well as providing the resulting
105    /// unit for the output of a compute graph. If the resulting unit is equivalent to exactly one existing unit in the
106    /// system, it will be returned (for example, a series in Coulombs divided by a series in Volts will return an
107    /// output of Farads). If the output does not have units (for example, a range output,) the unit result will return
108    /// noUnitAvailable, and if the computation was not successful, corresponding errors are returned.
109    #[endpoint(
110        method = POST,
111        path = "/compute/v2/computeWithUnits",
112        name = "computeWithUnits",
113        accept = conjure_http::client::StdResponseDeserializer
114    )]
115    fn compute_with_units(
116        &self,
117        #[auth]
118        auth_: &conjure_object::BearerToken,
119        #[body(serializer = conjure_http::client::StdRequestSerializer)]
120        request: &super::super::super::super::super::objects::scout::compute::api::ComputeWithUnitsRequest,
121    ) -> Result<
122        super::super::super::super::super::objects::scout::compute::api::ComputeWithUnitsResponse,
123        conjure_http::private::Error,
124    >;
125    /// Best-effort cancellation of active compute requests. Each ID should be the request ID that
126    /// the client originally passed when starting the request. A single request may correspond to
127    /// one or more underlying operations, all of which will be cancelled.
128    #[endpoint(
129        method = POST,
130        path = "/compute/v2/compute/batch/kill",
131        name = "batchKillRequests",
132        accept = conjure_http::client::conjure::EmptyResponseDeserializer
133    )]
134    fn batch_kill_requests(
135        &self,
136        #[auth]
137        auth_: &conjure_object::BearerToken,
138        #[body(serializer = conjure_http::client::StdRequestSerializer)]
139        request: &super::super::super::super::super::objects::scout::compute::api::BatchKillRequestsRequest,
140    ) -> Result<(), conjure_http::private::Error>;
141}
142/// The Compute Service provides the ability to compute the output of compute graphs.
143#[conjure_http::conjure_client(name = "ComputeService")]
144pub trait AsyncComputeService<
145    #[response_body]
146    I: conjure_http::private::Stream<
147            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
148        >,
149> {
150    /// Computes the output of the compute graph specified by a ComputeNodeRequest.
151    #[endpoint(
152        method = POST,
153        path = "/compute/v2/compute",
154        name = "compute",
155        accept = conjure_http::client::StdResponseDeserializer
156    )]
157    async fn compute(
158        &self,
159        #[auth]
160        auth_: &conjure_object::BearerToken,
161        #[body(serializer = conjure_http::client::StdRequestSerializer)]
162        request: &super::super::super::super::super::objects::scout::compute::api::ComputeNodeRequest,
163    ) -> Result<
164        super::super::super::super::super::objects::scout::compute::api::ComputeNodeResponse,
165        conjure_http::private::Error,
166    >;
167    /// Computes the output of the compute graph specified by a ParameterizedComputeNodeRequest. A parameterized
168    /// compute request supports multiple values for a single variable, supplied by the ParameterizedContext.
169    /// Results are returned in the same order of the request.
170    #[endpoint(
171        method = POST,
172        path = "/compute/v2/compute/parameterized",
173        name = "parameterizedCompute",
174        accept = conjure_http::client::StdResponseDeserializer
175    )]
176    async fn parameterized_compute(
177        &self,
178        #[auth]
179        auth_: &conjure_object::BearerToken,
180        #[body(serializer = conjure_http::client::StdRequestSerializer)]
181        request: &super::super::super::super::super::objects::scout::compute::api::ParameterizedComputeNodeRequest,
182    ) -> Result<
183        super::super::super::super::super::objects::scout::compute::api::ParameterizedComputeNodeResponse,
184        conjure_http::private::Error,
185    >;
186    /// Returns the resulting unit for the output of a compute graph. If the resulting unit is equivalent to exactly
187    /// one existing unit in the system, it will be returned (for example, a series in Coulombs divided by a series
188    /// in Volts will return an output of Farads). If the output does not have units (for example, a range output,)
189    /// the unit result will return noUnitAvailable, and if the computation was not successful, corresponding errors
190    /// are returned.
191    #[endpoint(
192        method = POST,
193        path = "/compute/v2/compute/units",
194        name = "computeUnits",
195        accept = conjure_http::client::StdResponseDeserializer
196    )]
197    async fn compute_units(
198        &self,
199        #[auth]
200        auth_: &conjure_object::BearerToken,
201        #[body(serializer = conjure_http::client::StdRequestSerializer)]
202        request: &super::super::super::super::super::objects::scout::compute::api::ComputeUnitsRequest,
203    ) -> Result<
204        super::super::super::super::super::objects::scout::compute::api::ComputeUnitResult,
205        conjure_http::private::Error,
206    >;
207    /// Computes the output of compute graphs specified by BatchComputeNodeRequest. Results are returned in the same
208    /// order as the request.
209    #[endpoint(
210        method = POST,
211        path = "/compute/v2/compute/batch",
212        name = "batchComputeWithUnits",
213        accept = conjure_http::client::StdResponseDeserializer
214    )]
215    async fn batch_compute_with_units(
216        &self,
217        #[auth]
218        auth_: &conjure_object::BearerToken,
219        #[body(serializer = conjure_http::client::StdRequestSerializer)]
220        request: &super::super::super::super::super::objects::scout::compute::api::BatchComputeWithUnitsRequest,
221    ) -> Result<
222        super::super::super::super::super::objects::scout::compute::api::BatchComputeWithUnitsResponse,
223        conjure_http::private::Error,
224    >;
225    /// Same as computeUnits, however this endpoint functions on a batch of requests for wire efficiency purposes. An
226    /// extra note is that this method will serialize underlying conjure errors into the BatchComputeUnitResult type,
227    /// meaning callers are required to check for errors explicitly (rather than relying on exceptions being thrown).
228    #[endpoint(
229        method = POST,
230        path = "/compute/v2/compute/batch-units",
231        name = "batchComputeUnits",
232        accept = conjure_http::client::StdResponseDeserializer
233    )]
234    async fn batch_compute_units(
235        &self,
236        #[auth]
237        auth_: &conjure_object::BearerToken,
238        #[body(serializer = conjure_http::client::StdRequestSerializer)]
239        request: &super::super::super::super::super::objects::scout::compute::api::BatchComputeUnitsRequest,
240    ) -> Result<
241        super::super::super::super::super::objects::scout::compute::api::BatchComputeUnitResult,
242        conjure_http::private::Error,
243    >;
244    /// Computes the output of the compute graph specified by a ComputeNodeRequest, as well as providing the resulting
245    /// unit for the output of a compute graph. If the resulting unit is equivalent to exactly one existing unit in the
246    /// system, it will be returned (for example, a series in Coulombs divided by a series in Volts will return an
247    /// output of Farads). If the output does not have units (for example, a range output,) the unit result will return
248    /// noUnitAvailable, and if the computation was not successful, corresponding errors are returned.
249    #[endpoint(
250        method = POST,
251        path = "/compute/v2/computeWithUnits",
252        name = "computeWithUnits",
253        accept = conjure_http::client::StdResponseDeserializer
254    )]
255    async fn compute_with_units(
256        &self,
257        #[auth]
258        auth_: &conjure_object::BearerToken,
259        #[body(serializer = conjure_http::client::StdRequestSerializer)]
260        request: &super::super::super::super::super::objects::scout::compute::api::ComputeWithUnitsRequest,
261    ) -> Result<
262        super::super::super::super::super::objects::scout::compute::api::ComputeWithUnitsResponse,
263        conjure_http::private::Error,
264    >;
265    /// Best-effort cancellation of active compute requests. Each ID should be the request ID that
266    /// the client originally passed when starting the request. A single request may correspond to
267    /// one or more underlying operations, all of which will be cancelled.
268    #[endpoint(
269        method = POST,
270        path = "/compute/v2/compute/batch/kill",
271        name = "batchKillRequests",
272        accept = conjure_http::client::conjure::EmptyResponseDeserializer
273    )]
274    async fn batch_kill_requests(
275        &self,
276        #[auth]
277        auth_: &conjure_object::BearerToken,
278        #[body(serializer = conjure_http::client::StdRequestSerializer)]
279        request: &super::super::super::super::super::objects::scout::compute::api::BatchKillRequestsRequest,
280    ) -> Result<(), conjure_http::private::Error>;
281}
282/// The Compute Service provides the ability to compute the output of compute graphs.
283#[conjure_http::conjure_client(name = "ComputeService", local)]
284pub trait LocalAsyncComputeService<
285    #[response_body]
286    I: conjure_http::private::Stream<
287            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
288        >,
289> {
290    /// Computes the output of the compute graph specified by a ComputeNodeRequest.
291    #[endpoint(
292        method = POST,
293        path = "/compute/v2/compute",
294        name = "compute",
295        accept = conjure_http::client::StdResponseDeserializer
296    )]
297    async fn compute(
298        &self,
299        #[auth]
300        auth_: &conjure_object::BearerToken,
301        #[body(serializer = conjure_http::client::StdRequestSerializer)]
302        request: &super::super::super::super::super::objects::scout::compute::api::ComputeNodeRequest,
303    ) -> Result<
304        super::super::super::super::super::objects::scout::compute::api::ComputeNodeResponse,
305        conjure_http::private::Error,
306    >;
307    /// Computes the output of the compute graph specified by a ParameterizedComputeNodeRequest. A parameterized
308    /// compute request supports multiple values for a single variable, supplied by the ParameterizedContext.
309    /// Results are returned in the same order of the request.
310    #[endpoint(
311        method = POST,
312        path = "/compute/v2/compute/parameterized",
313        name = "parameterizedCompute",
314        accept = conjure_http::client::StdResponseDeserializer
315    )]
316    async fn parameterized_compute(
317        &self,
318        #[auth]
319        auth_: &conjure_object::BearerToken,
320        #[body(serializer = conjure_http::client::StdRequestSerializer)]
321        request: &super::super::super::super::super::objects::scout::compute::api::ParameterizedComputeNodeRequest,
322    ) -> Result<
323        super::super::super::super::super::objects::scout::compute::api::ParameterizedComputeNodeResponse,
324        conjure_http::private::Error,
325    >;
326    /// Returns the resulting unit for the output of a compute graph. If the resulting unit is equivalent to exactly
327    /// one existing unit in the system, it will be returned (for example, a series in Coulombs divided by a series
328    /// in Volts will return an output of Farads). If the output does not have units (for example, a range output,)
329    /// the unit result will return noUnitAvailable, and if the computation was not successful, corresponding errors
330    /// are returned.
331    #[endpoint(
332        method = POST,
333        path = "/compute/v2/compute/units",
334        name = "computeUnits",
335        accept = conjure_http::client::StdResponseDeserializer
336    )]
337    async fn compute_units(
338        &self,
339        #[auth]
340        auth_: &conjure_object::BearerToken,
341        #[body(serializer = conjure_http::client::StdRequestSerializer)]
342        request: &super::super::super::super::super::objects::scout::compute::api::ComputeUnitsRequest,
343    ) -> Result<
344        super::super::super::super::super::objects::scout::compute::api::ComputeUnitResult,
345        conjure_http::private::Error,
346    >;
347    /// Computes the output of compute graphs specified by BatchComputeNodeRequest. Results are returned in the same
348    /// order as the request.
349    #[endpoint(
350        method = POST,
351        path = "/compute/v2/compute/batch",
352        name = "batchComputeWithUnits",
353        accept = conjure_http::client::StdResponseDeserializer
354    )]
355    async fn batch_compute_with_units(
356        &self,
357        #[auth]
358        auth_: &conjure_object::BearerToken,
359        #[body(serializer = conjure_http::client::StdRequestSerializer)]
360        request: &super::super::super::super::super::objects::scout::compute::api::BatchComputeWithUnitsRequest,
361    ) -> Result<
362        super::super::super::super::super::objects::scout::compute::api::BatchComputeWithUnitsResponse,
363        conjure_http::private::Error,
364    >;
365    /// Same as computeUnits, however this endpoint functions on a batch of requests for wire efficiency purposes. An
366    /// extra note is that this method will serialize underlying conjure errors into the BatchComputeUnitResult type,
367    /// meaning callers are required to check for errors explicitly (rather than relying on exceptions being thrown).
368    #[endpoint(
369        method = POST,
370        path = "/compute/v2/compute/batch-units",
371        name = "batchComputeUnits",
372        accept = conjure_http::client::StdResponseDeserializer
373    )]
374    async fn batch_compute_units(
375        &self,
376        #[auth]
377        auth_: &conjure_object::BearerToken,
378        #[body(serializer = conjure_http::client::StdRequestSerializer)]
379        request: &super::super::super::super::super::objects::scout::compute::api::BatchComputeUnitsRequest,
380    ) -> Result<
381        super::super::super::super::super::objects::scout::compute::api::BatchComputeUnitResult,
382        conjure_http::private::Error,
383    >;
384    /// Computes the output of the compute graph specified by a ComputeNodeRequest, as well as providing the resulting
385    /// unit for the output of a compute graph. If the resulting unit is equivalent to exactly one existing unit in the
386    /// system, it will be returned (for example, a series in Coulombs divided by a series in Volts will return an
387    /// output of Farads). If the output does not have units (for example, a range output,) the unit result will return
388    /// noUnitAvailable, and if the computation was not successful, corresponding errors are returned.
389    #[endpoint(
390        method = POST,
391        path = "/compute/v2/computeWithUnits",
392        name = "computeWithUnits",
393        accept = conjure_http::client::StdResponseDeserializer
394    )]
395    async fn compute_with_units(
396        &self,
397        #[auth]
398        auth_: &conjure_object::BearerToken,
399        #[body(serializer = conjure_http::client::StdRequestSerializer)]
400        request: &super::super::super::super::super::objects::scout::compute::api::ComputeWithUnitsRequest,
401    ) -> Result<
402        super::super::super::super::super::objects::scout::compute::api::ComputeWithUnitsResponse,
403        conjure_http::private::Error,
404    >;
405    /// Best-effort cancellation of active compute requests. Each ID should be the request ID that
406    /// the client originally passed when starting the request. A single request may correspond to
407    /// one or more underlying operations, all of which will be cancelled.
408    #[endpoint(
409        method = POST,
410        path = "/compute/v2/compute/batch/kill",
411        name = "batchKillRequests",
412        accept = conjure_http::client::conjure::EmptyResponseDeserializer
413    )]
414    async fn batch_kill_requests(
415        &self,
416        #[auth]
417        auth_: &conjure_object::BearerToken,
418        #[body(serializer = conjure_http::client::StdRequestSerializer)]
419        request: &super::super::super::super::super::objects::scout::compute::api::BatchKillRequestsRequest,
420    ) -> Result<(), conjure_http::private::Error>;
421}