1use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum DeleteToolsMcpServersByIdError {
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum DeleteToolsPluginsAuthoredByIdError {
29 UnknownValue(serde_json::Value),
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum DeleteToolsSkillsByIdError {
36 UnknownValue(serde_json::Value),
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum GetToolsError {
43 UnknownValue(serde_json::Value),
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum GetToolsActivationError {
50 UnknownValue(serde_json::Value),
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum GetToolsCatalogError {
57 UnknownValue(serde_json::Value),
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum GetToolsCatalogByIdError {
64 UnknownValue(serde_json::Value),
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetToolsMcpServersError {
71 UnknownValue(serde_json::Value),
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetToolsPluginsError {
78 UnknownValue(serde_json::Value),
79}
80
81#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetToolsPluginsAuthoredError {
85 UnknownValue(serde_json::Value),
86}
87
88#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetToolsSkillsError {
92 UnknownValue(serde_json::Value),
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetToolsSkillsAuthoredError {
99 UnknownValue(serde_json::Value),
100}
101
102#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum PatchToolsCatalogByIdError {
106 UnknownValue(serde_json::Value),
107}
108
109#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum PostToolsCallError {
113 UnknownValue(serde_json::Value),
114}
115
116#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum PostToolsCatalogSyncError {
120 UnknownValue(serde_json::Value),
121}
122
123#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum PostToolsMcpServersError {
127 UnknownValue(serde_json::Value),
128}
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum PostToolsPluginsBuildError {
134 UnknownValue(serde_json::Value),
135}
136
137#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum PostToolsSkillsError {
141 UnknownValue(serde_json::Value),
142}
143
144#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum PutToolsActivationError {
148 UnknownValue(serde_json::Value),
149}
150
151
152pub async fn delete_tools_mcp_servers_by_id(configuration: &configuration::Configuration, id: &str) -> Result<(), Error<DeleteToolsMcpServersByIdError>> {
154 let p_id = id;
156
157 let uri_str = format!("{}/v1/tools/mcp/servers/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
158 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
159
160 if let Some(ref user_agent) = configuration.user_agent {
161 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
162 }
163 if let Some(ref token) = configuration.bearer_access_token {
164 req_builder = req_builder.bearer_auth(token.to_owned());
165 };
166
167 let req = req_builder.build()?;
168 let resp = configuration.client.execute(req).await?;
169
170 let status = resp.status();
171
172 if !status.is_client_error() && !status.is_server_error() {
173 Ok(())
174 } else {
175 let content = resp.text().await?;
176 let entity: Option<DeleteToolsMcpServersByIdError> = serde_json::from_str(&content).ok();
177 Err(Error::ResponseError(ResponseContent { status, content, entity }))
178 }
179}
180
181pub async fn delete_tools_plugins_authored_by_id(configuration: &configuration::Configuration, id: &str) -> Result<models::PluginDeleted, Error<DeleteToolsPluginsAuthoredByIdError>> {
183 let p_id = id;
185
186 let uri_str = format!("{}/v1/tools/plugins/authored/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
187 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
188
189 if let Some(ref user_agent) = configuration.user_agent {
190 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
191 }
192 if let Some(ref token) = configuration.bearer_access_token {
193 req_builder = req_builder.bearer_auth(token.to_owned());
194 };
195
196 let req = req_builder.build()?;
197 let resp = configuration.client.execute(req).await?;
198
199 let status = resp.status();
200 let content_type = resp
201 .headers()
202 .get("content-type")
203 .and_then(|v| v.to_str().ok())
204 .unwrap_or("application/octet-stream");
205 let content_type = super::ContentType::from(content_type);
206
207 if !status.is_client_error() && !status.is_server_error() {
208 let content = resp.text().await?;
209 match content_type {
210 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
211 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PluginDeleted`"))),
212 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PluginDeleted`")))),
213 }
214 } else {
215 let content = resp.text().await?;
216 let entity: Option<DeleteToolsPluginsAuthoredByIdError> = serde_json::from_str(&content).ok();
217 Err(Error::ResponseError(ResponseContent { status, content, entity }))
218 }
219}
220
221pub async fn delete_tools_skills_by_id(configuration: &configuration::Configuration, id: &str) -> Result<models::SkillDeleted, Error<DeleteToolsSkillsByIdError>> {
223 let p_id = id;
225
226 let uri_str = format!("{}/v1/tools/skills/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
227 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
228
229 if let Some(ref user_agent) = configuration.user_agent {
230 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
231 }
232 if let Some(ref token) = configuration.bearer_access_token {
233 req_builder = req_builder.bearer_auth(token.to_owned());
234 };
235
236 let req = req_builder.build()?;
237 let resp = configuration.client.execute(req).await?;
238
239 let status = resp.status();
240 let content_type = resp
241 .headers()
242 .get("content-type")
243 .and_then(|v| v.to_str().ok())
244 .unwrap_or("application/octet-stream");
245 let content_type = super::ContentType::from(content_type);
246
247 if !status.is_client_error() && !status.is_server_error() {
248 let content = resp.text().await?;
249 match content_type {
250 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
251 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SkillDeleted`"))),
252 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SkillDeleted`")))),
253 }
254 } else {
255 let content = resp.text().await?;
256 let entity: Option<DeleteToolsSkillsByIdError> = serde_json::from_str(&content).ok();
257 Err(Error::ResponseError(ResponseContent { status, content, entity }))
258 }
259}
260
261pub async fn get_tools(configuration: &configuration::Configuration, source: Option<&str>, activated: Option<&str>) -> Result<models::ToolList, Error<GetToolsError>> {
263 let p_source = source;
265 let p_activated = activated;
266
267 let uri_str = format!("{}/v1/tools", configuration.base_path);
268 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
269
270 if let Some(ref param_value) = p_source {
271 req_builder = req_builder.query(&[("source", ¶m_value.to_string())]);
272 }
273 if let Some(ref param_value) = p_activated {
274 req_builder = req_builder.query(&[("activated", ¶m_value.to_string())]);
275 }
276 if let Some(ref user_agent) = configuration.user_agent {
277 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
278 }
279 if let Some(ref token) = configuration.bearer_access_token {
280 req_builder = req_builder.bearer_auth(token.to_owned());
281 };
282
283 let req = req_builder.build()?;
284 let resp = configuration.client.execute(req).await?;
285
286 let status = resp.status();
287 let content_type = resp
288 .headers()
289 .get("content-type")
290 .and_then(|v| v.to_str().ok())
291 .unwrap_or("application/octet-stream");
292 let content_type = super::ContentType::from(content_type);
293
294 if !status.is_client_error() && !status.is_server_error() {
295 let content = resp.text().await?;
296 match content_type {
297 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
298 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ToolList`"))),
299 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ToolList`")))),
300 }
301 } else {
302 let content = resp.text().await?;
303 let entity: Option<GetToolsError> = serde_json::from_str(&content).ok();
304 Err(Error::ResponseError(ResponseContent { status, content, entity }))
305 }
306}
307
308pub async fn get_tools_activation(configuration: &configuration::Configuration, ) -> Result<models::ActivationSet, Error<GetToolsActivationError>> {
310
311 let uri_str = format!("{}/v1/tools/activation", configuration.base_path);
312 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
313
314 if let Some(ref user_agent) = configuration.user_agent {
315 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
316 }
317 if let Some(ref token) = configuration.bearer_access_token {
318 req_builder = req_builder.bearer_auth(token.to_owned());
319 };
320
321 let req = req_builder.build()?;
322 let resp = configuration.client.execute(req).await?;
323
324 let status = resp.status();
325 let content_type = resp
326 .headers()
327 .get("content-type")
328 .and_then(|v| v.to_str().ok())
329 .unwrap_or("application/octet-stream");
330 let content_type = super::ContentType::from(content_type);
331
332 if !status.is_client_error() && !status.is_server_error() {
333 let content = resp.text().await?;
334 match content_type {
335 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
336 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActivationSet`"))),
337 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActivationSet`")))),
338 }
339 } else {
340 let content = resp.text().await?;
341 let entity: Option<GetToolsActivationError> = serde_json::from_str(&content).ok();
342 Err(Error::ResponseError(ResponseContent { status, content, entity }))
343 }
344}
345
346pub async fn get_tools_catalog(configuration: &configuration::Configuration, q: Option<&str>, featured: Option<&str>, official: Option<&str>, limit: Option<i32>, offset: Option<i32>) -> Result<models::McpCatalog, Error<GetToolsCatalogError>> {
348 let p_q = q;
350 let p_featured = featured;
351 let p_official = official;
352 let p_limit = limit;
353 let p_offset = offset;
354
355 let uri_str = format!("{}/v1/tools/catalog", configuration.base_path);
356 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
357
358 if let Some(ref param_value) = p_q {
359 req_builder = req_builder.query(&[("q", ¶m_value.to_string())]);
360 }
361 if let Some(ref param_value) = p_featured {
362 req_builder = req_builder.query(&[("featured", ¶m_value.to_string())]);
363 }
364 if let Some(ref param_value) = p_official {
365 req_builder = req_builder.query(&[("official", ¶m_value.to_string())]);
366 }
367 if let Some(ref param_value) = p_limit {
368 req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
369 }
370 if let Some(ref param_value) = p_offset {
371 req_builder = req_builder.query(&[("offset", ¶m_value.to_string())]);
372 }
373 if let Some(ref user_agent) = configuration.user_agent {
374 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
375 }
376 if let Some(ref token) = configuration.bearer_access_token {
377 req_builder = req_builder.bearer_auth(token.to_owned());
378 };
379
380 let req = req_builder.build()?;
381 let resp = configuration.client.execute(req).await?;
382
383 let status = resp.status();
384 let content_type = resp
385 .headers()
386 .get("content-type")
387 .and_then(|v| v.to_str().ok())
388 .unwrap_or("application/octet-stream");
389 let content_type = super::ContentType::from(content_type);
390
391 if !status.is_client_error() && !status.is_server_error() {
392 let content = resp.text().await?;
393 match content_type {
394 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
395 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::McpCatalog`"))),
396 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::McpCatalog`")))),
397 }
398 } else {
399 let content = resp.text().await?;
400 let entity: Option<GetToolsCatalogError> = serde_json::from_str(&content).ok();
401 Err(Error::ResponseError(ResponseContent { status, content, entity }))
402 }
403}
404
405pub async fn get_tools_catalog_by_id(configuration: &configuration::Configuration, id: &str) -> Result<models::McpListing, Error<GetToolsCatalogByIdError>> {
407 let p_id = id;
409
410 let uri_str = format!("{}/v1/tools/catalog/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
411 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
412
413 if let Some(ref user_agent) = configuration.user_agent {
414 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
415 }
416 if let Some(ref token) = configuration.bearer_access_token {
417 req_builder = req_builder.bearer_auth(token.to_owned());
418 };
419
420 let req = req_builder.build()?;
421 let resp = configuration.client.execute(req).await?;
422
423 let status = resp.status();
424 let content_type = resp
425 .headers()
426 .get("content-type")
427 .and_then(|v| v.to_str().ok())
428 .unwrap_or("application/octet-stream");
429 let content_type = super::ContentType::from(content_type);
430
431 if !status.is_client_error() && !status.is_server_error() {
432 let content = resp.text().await?;
433 match content_type {
434 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
435 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::McpListing`"))),
436 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::McpListing`")))),
437 }
438 } else {
439 let content = resp.text().await?;
440 let entity: Option<GetToolsCatalogByIdError> = serde_json::from_str(&content).ok();
441 Err(Error::ResponseError(ResponseContent { status, content, entity }))
442 }
443}
444
445pub async fn get_tools_mcp_servers(configuration: &configuration::Configuration, ) -> Result<models::McpServerList, Error<GetToolsMcpServersError>> {
447
448 let uri_str = format!("{}/v1/tools/mcp/servers", configuration.base_path);
449 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
450
451 if let Some(ref user_agent) = configuration.user_agent {
452 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
453 }
454 if let Some(ref token) = configuration.bearer_access_token {
455 req_builder = req_builder.bearer_auth(token.to_owned());
456 };
457
458 let req = req_builder.build()?;
459 let resp = configuration.client.execute(req).await?;
460
461 let status = resp.status();
462 let content_type = resp
463 .headers()
464 .get("content-type")
465 .and_then(|v| v.to_str().ok())
466 .unwrap_or("application/octet-stream");
467 let content_type = super::ContentType::from(content_type);
468
469 if !status.is_client_error() && !status.is_server_error() {
470 let content = resp.text().await?;
471 match content_type {
472 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
473 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::McpServerList`"))),
474 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::McpServerList`")))),
475 }
476 } else {
477 let content = resp.text().await?;
478 let entity: Option<GetToolsMcpServersError> = serde_json::from_str(&content).ok();
479 Err(Error::ResponseError(ResponseContent { status, content, entity }))
480 }
481}
482
483pub async fn get_tools_plugins(configuration: &configuration::Configuration, all: Option<&str>) -> Result<models::PluginMountList, Error<GetToolsPluginsError>> {
485 let p_all = all;
487
488 let uri_str = format!("{}/v1/tools/plugins", configuration.base_path);
489 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
490
491 if let Some(ref param_value) = p_all {
492 req_builder = req_builder.query(&[("all", ¶m_value.to_string())]);
493 }
494 if let Some(ref user_agent) = configuration.user_agent {
495 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
496 }
497 if let Some(ref token) = configuration.bearer_access_token {
498 req_builder = req_builder.bearer_auth(token.to_owned());
499 };
500
501 let req = req_builder.build()?;
502 let resp = configuration.client.execute(req).await?;
503
504 let status = resp.status();
505 let content_type = resp
506 .headers()
507 .get("content-type")
508 .and_then(|v| v.to_str().ok())
509 .unwrap_or("application/octet-stream");
510 let content_type = super::ContentType::from(content_type);
511
512 if !status.is_client_error() && !status.is_server_error() {
513 let content = resp.text().await?;
514 match content_type {
515 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
516 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PluginMountList`"))),
517 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PluginMountList`")))),
518 }
519 } else {
520 let content = resp.text().await?;
521 let entity: Option<GetToolsPluginsError> = serde_json::from_str(&content).ok();
522 Err(Error::ResponseError(ResponseContent { status, content, entity }))
523 }
524}
525
526pub async fn get_tools_plugins_authored(configuration: &configuration::Configuration, ) -> Result<models::AuthoredPluginList, Error<GetToolsPluginsAuthoredError>> {
528
529 let uri_str = format!("{}/v1/tools/plugins/authored", configuration.base_path);
530 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
531
532 if let Some(ref user_agent) = configuration.user_agent {
533 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
534 }
535 if let Some(ref token) = configuration.bearer_access_token {
536 req_builder = req_builder.bearer_auth(token.to_owned());
537 };
538
539 let req = req_builder.build()?;
540 let resp = configuration.client.execute(req).await?;
541
542 let status = resp.status();
543 let content_type = resp
544 .headers()
545 .get("content-type")
546 .and_then(|v| v.to_str().ok())
547 .unwrap_or("application/octet-stream");
548 let content_type = super::ContentType::from(content_type);
549
550 if !status.is_client_error() && !status.is_server_error() {
551 let content = resp.text().await?;
552 match content_type {
553 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
554 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthoredPluginList`"))),
555 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthoredPluginList`")))),
556 }
557 } else {
558 let content = resp.text().await?;
559 let entity: Option<GetToolsPluginsAuthoredError> = serde_json::from_str(&content).ok();
560 Err(Error::ResponseError(ResponseContent { status, content, entity }))
561 }
562}
563
564pub async fn get_tools_skills(configuration: &configuration::Configuration, activated: Option<&str>) -> Result<models::SourceToolList, Error<GetToolsSkillsError>> {
566 let p_activated = activated;
568
569 let uri_str = format!("{}/v1/tools/skills", configuration.base_path);
570 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
571
572 if let Some(ref param_value) = p_activated {
573 req_builder = req_builder.query(&[("activated", ¶m_value.to_string())]);
574 }
575 if let Some(ref user_agent) = configuration.user_agent {
576 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
577 }
578 if let Some(ref token) = configuration.bearer_access_token {
579 req_builder = req_builder.bearer_auth(token.to_owned());
580 };
581
582 let req = req_builder.build()?;
583 let resp = configuration.client.execute(req).await?;
584
585 let status = resp.status();
586 let content_type = resp
587 .headers()
588 .get("content-type")
589 .and_then(|v| v.to_str().ok())
590 .unwrap_or("application/octet-stream");
591 let content_type = super::ContentType::from(content_type);
592
593 if !status.is_client_error() && !status.is_server_error() {
594 let content = resp.text().await?;
595 match content_type {
596 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
597 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SourceToolList`"))),
598 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SourceToolList`")))),
599 }
600 } else {
601 let content = resp.text().await?;
602 let entity: Option<GetToolsSkillsError> = serde_json::from_str(&content).ok();
603 Err(Error::ResponseError(ResponseContent { status, content, entity }))
604 }
605}
606
607pub async fn get_tools_skills_authored(configuration: &configuration::Configuration, ) -> Result<models::AuthoredSkillList, Error<GetToolsSkillsAuthoredError>> {
609
610 let uri_str = format!("{}/v1/tools/skills/authored", configuration.base_path);
611 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
612
613 if let Some(ref user_agent) = configuration.user_agent {
614 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
615 }
616 if let Some(ref token) = configuration.bearer_access_token {
617 req_builder = req_builder.bearer_auth(token.to_owned());
618 };
619
620 let req = req_builder.build()?;
621 let resp = configuration.client.execute(req).await?;
622
623 let status = resp.status();
624 let content_type = resp
625 .headers()
626 .get("content-type")
627 .and_then(|v| v.to_str().ok())
628 .unwrap_or("application/octet-stream");
629 let content_type = super::ContentType::from(content_type);
630
631 if !status.is_client_error() && !status.is_server_error() {
632 let content = resp.text().await?;
633 match content_type {
634 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
635 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AuthoredSkillList`"))),
636 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AuthoredSkillList`")))),
637 }
638 } else {
639 let content = resp.text().await?;
640 let entity: Option<GetToolsSkillsAuthoredError> = serde_json::from_str(&content).ok();
641 Err(Error::ResponseError(ResponseContent { status, content, entity }))
642 }
643}
644
645pub async fn patch_tools_catalog_by_id(configuration: &configuration::Configuration, id: &str, curate_req: models::CurateReq) -> Result<models::McpListing, Error<PatchToolsCatalogByIdError>> {
647 let p_id = id;
649 let p_curate_req = curate_req;
650
651 let uri_str = format!("{}/v1/tools/catalog/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
652 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
653
654 if let Some(ref user_agent) = configuration.user_agent {
655 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
656 }
657 if let Some(ref token) = configuration.bearer_access_token {
658 req_builder = req_builder.bearer_auth(token.to_owned());
659 };
660 req_builder = req_builder.json(&p_curate_req);
661
662 let req = req_builder.build()?;
663 let resp = configuration.client.execute(req).await?;
664
665 let status = resp.status();
666 let content_type = resp
667 .headers()
668 .get("content-type")
669 .and_then(|v| v.to_str().ok())
670 .unwrap_or("application/octet-stream");
671 let content_type = super::ContentType::from(content_type);
672
673 if !status.is_client_error() && !status.is_server_error() {
674 let content = resp.text().await?;
675 match content_type {
676 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
677 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::McpListing`"))),
678 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::McpListing`")))),
679 }
680 } else {
681 let content = resp.text().await?;
682 let entity: Option<PatchToolsCatalogByIdError> = serde_json::from_str(&content).ok();
683 Err(Error::ResponseError(ResponseContent { status, content, entity }))
684 }
685}
686
687pub async fn post_tools_call(configuration: &configuration::Configuration, tool_call: models::ToolCall) -> Result<models::ToolResult, Error<PostToolsCallError>> {
689 let p_tool_call = tool_call;
691
692 let uri_str = format!("{}/v1/tools/call", configuration.base_path);
693 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
694
695 if let Some(ref user_agent) = configuration.user_agent {
696 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
697 }
698 if let Some(ref token) = configuration.bearer_access_token {
699 req_builder = req_builder.bearer_auth(token.to_owned());
700 };
701 req_builder = req_builder.json(&p_tool_call);
702
703 let req = req_builder.build()?;
704 let resp = configuration.client.execute(req).await?;
705
706 let status = resp.status();
707 let content_type = resp
708 .headers()
709 .get("content-type")
710 .and_then(|v| v.to_str().ok())
711 .unwrap_or("application/octet-stream");
712 let content_type = super::ContentType::from(content_type);
713
714 if !status.is_client_error() && !status.is_server_error() {
715 let content = resp.text().await?;
716 match content_type {
717 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
718 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ToolResult`"))),
719 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ToolResult`")))),
720 }
721 } else {
722 let content = resp.text().await?;
723 let entity: Option<PostToolsCallError> = serde_json::from_str(&content).ok();
724 Err(Error::ResponseError(ResponseContent { status, content, entity }))
725 }
726}
727
728pub async fn post_tools_catalog_sync(configuration: &configuration::Configuration, ) -> Result<models::McpCatalogSync, Error<PostToolsCatalogSyncError>> {
730
731 let uri_str = format!("{}/v1/tools/catalog/sync", configuration.base_path);
732 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
733
734 if let Some(ref user_agent) = configuration.user_agent {
735 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
736 }
737 if let Some(ref token) = configuration.bearer_access_token {
738 req_builder = req_builder.bearer_auth(token.to_owned());
739 };
740
741 let req = req_builder.build()?;
742 let resp = configuration.client.execute(req).await?;
743
744 let status = resp.status();
745 let content_type = resp
746 .headers()
747 .get("content-type")
748 .and_then(|v| v.to_str().ok())
749 .unwrap_or("application/octet-stream");
750 let content_type = super::ContentType::from(content_type);
751
752 if !status.is_client_error() && !status.is_server_error() {
753 let content = resp.text().await?;
754 match content_type {
755 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
756 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::McpCatalogSync`"))),
757 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::McpCatalogSync`")))),
758 }
759 } else {
760 let content = resp.text().await?;
761 let entity: Option<PostToolsCatalogSyncError> = serde_json::from_str(&content).ok();
762 Err(Error::ResponseError(ResponseContent { status, content, entity }))
763 }
764}
765
766pub async fn post_tools_mcp_servers(configuration: &configuration::Configuration, create_server_req: models::CreateServerReq) -> Result<models::McpServer, Error<PostToolsMcpServersError>> {
768 let p_create_server_req = create_server_req;
770
771 let uri_str = format!("{}/v1/tools/mcp/servers", configuration.base_path);
772 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
773
774 if let Some(ref user_agent) = configuration.user_agent {
775 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
776 }
777 if let Some(ref token) = configuration.bearer_access_token {
778 req_builder = req_builder.bearer_auth(token.to_owned());
779 };
780 req_builder = req_builder.json(&p_create_server_req);
781
782 let req = req_builder.build()?;
783 let resp = configuration.client.execute(req).await?;
784
785 let status = resp.status();
786 let content_type = resp
787 .headers()
788 .get("content-type")
789 .and_then(|v| v.to_str().ok())
790 .unwrap_or("application/octet-stream");
791 let content_type = super::ContentType::from(content_type);
792
793 if !status.is_client_error() && !status.is_server_error() {
794 let content = resp.text().await?;
795 match content_type {
796 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
797 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::McpServer`"))),
798 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::McpServer`")))),
799 }
800 } else {
801 let content = resp.text().await?;
802 let entity: Option<PostToolsMcpServersError> = serde_json::from_str(&content).ok();
803 Err(Error::ResponseError(ResponseContent { status, content, entity }))
804 }
805}
806
807pub async fn post_tools_plugins_build(configuration: &configuration::Configuration, build_request: models::BuildRequest) -> Result<models::BuildOut, Error<PostToolsPluginsBuildError>> {
809 let p_build_request = build_request;
811
812 let uri_str = format!("{}/v1/tools/plugins/build", configuration.base_path);
813 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
814
815 if let Some(ref user_agent) = configuration.user_agent {
816 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
817 }
818 if let Some(ref token) = configuration.bearer_access_token {
819 req_builder = req_builder.bearer_auth(token.to_owned());
820 };
821 req_builder = req_builder.json(&p_build_request);
822
823 let req = req_builder.build()?;
824 let resp = configuration.client.execute(req).await?;
825
826 let status = resp.status();
827 let content_type = resp
828 .headers()
829 .get("content-type")
830 .and_then(|v| v.to_str().ok())
831 .unwrap_or("application/octet-stream");
832 let content_type = super::ContentType::from(content_type);
833
834 if !status.is_client_error() && !status.is_server_error() {
835 let content = resp.text().await?;
836 match content_type {
837 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
838 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BuildOut`"))),
839 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BuildOut`")))),
840 }
841 } else {
842 let content = resp.text().await?;
843 let entity: Option<PostToolsPluginsBuildError> = serde_json::from_str(&content).ok();
844 Err(Error::ResponseError(ResponseContent { status, content, entity }))
845 }
846}
847
848pub async fn post_tools_skills(configuration: &configuration::Configuration, skill_in: models::SkillIn) -> Result<models::SkillWritten, Error<PostToolsSkillsError>> {
850 let p_skill_in = skill_in;
852
853 let uri_str = format!("{}/v1/tools/skills", configuration.base_path);
854 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
855
856 if let Some(ref user_agent) = configuration.user_agent {
857 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
858 }
859 if let Some(ref token) = configuration.bearer_access_token {
860 req_builder = req_builder.bearer_auth(token.to_owned());
861 };
862 req_builder = req_builder.json(&p_skill_in);
863
864 let req = req_builder.build()?;
865 let resp = configuration.client.execute(req).await?;
866
867 let status = resp.status();
868 let content_type = resp
869 .headers()
870 .get("content-type")
871 .and_then(|v| v.to_str().ok())
872 .unwrap_or("application/octet-stream");
873 let content_type = super::ContentType::from(content_type);
874
875 if !status.is_client_error() && !status.is_server_error() {
876 let content = resp.text().await?;
877 match content_type {
878 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
879 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SkillWritten`"))),
880 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SkillWritten`")))),
881 }
882 } else {
883 let content = resp.text().await?;
884 let entity: Option<PostToolsSkillsError> = serde_json::from_str(&content).ok();
885 Err(Error::ResponseError(ResponseContent { status, content, entity }))
886 }
887}
888
889pub async fn put_tools_activation(configuration: &configuration::Configuration, activation_req: models::ActivationReq) -> Result<models::ActivationSet, Error<PutToolsActivationError>> {
891 let p_activation_req = activation_req;
893
894 let uri_str = format!("{}/v1/tools/activation", configuration.base_path);
895 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
896
897 if let Some(ref user_agent) = configuration.user_agent {
898 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
899 }
900 if let Some(ref token) = configuration.bearer_access_token {
901 req_builder = req_builder.bearer_auth(token.to_owned());
902 };
903 req_builder = req_builder.json(&p_activation_req);
904
905 let req = req_builder.build()?;
906 let resp = configuration.client.execute(req).await?;
907
908 let status = resp.status();
909 let content_type = resp
910 .headers()
911 .get("content-type")
912 .and_then(|v| v.to_str().ok())
913 .unwrap_or("application/octet-stream");
914 let content_type = super::ContentType::from(content_type);
915
916 if !status.is_client_error() && !status.is_server_error() {
917 let content = resp.text().await?;
918 match content_type {
919 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
920 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActivationSet`"))),
921 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActivationSet`")))),
922 }
923 } else {
924 let content = resp.text().await?;
925 let entity: Option<PutToolsActivationError> = serde_json::from_str(&content).ok();
926 Err(Error::ResponseError(ResponseContent { status, content, entity }))
927 }
928}
929