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 DeleteGuideCurriculumError {
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum GetGuideError {
29 UnknownValue(serde_json::Value),
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum GetGuideActionsError {
36 UnknownValue(serde_json::Value),
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum GetGuideAnalyticsError {
43 UnknownValue(serde_json::Value),
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum GetGuideBlueprintError {
50 UnknownValue(serde_json::Value),
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum GetGuideBlueprintVersionsError {
57 UnknownValue(serde_json::Value),
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum GetGuideCurriculumError {
64 UnknownValue(serde_json::Value),
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetGuideProfileError {
71 UnknownValue(serde_json::Value),
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetGuideStrategiesError {
78 UnknownValue(serde_json::Value),
79}
80
81#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetGuideSuggestError {
85 UnknownValue(serde_json::Value),
86}
87
88#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum PatchGuideBlueprintByCollectionByIdError {
92 UnknownValue(serde_json::Value),
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum PostGuideChatError {
99 UnknownValue(serde_json::Value),
100}
101
102#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum PostGuideStepsByIdDoError {
106 UnknownValue(serde_json::Value),
107}
108
109#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum PostGuideStepsByIdDoneError {
113 UnknownValue(serde_json::Value),
114}
115
116#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum PostGuideStepsByIdResetError {
120 UnknownValue(serde_json::Value),
121}
122
123#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum PostGuideStepsByIdSkipError {
127 UnknownValue(serde_json::Value),
128}
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum PostGuideStepsByIdStartError {
134 UnknownValue(serde_json::Value),
135}
136
137#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum PutGuideBlueprintError {
141 UnknownValue(serde_json::Value),
142}
143
144#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum PutGuideCurriculumError {
148 UnknownValue(serde_json::Value),
149}
150
151
152pub async fn delete_guide_curriculum(configuration: &configuration::Configuration, ) -> Result<models::CurriculumView, Error<DeleteGuideCurriculumError>> {
154
155 let uri_str = format!("{}/v1/guide/curriculum", configuration.base_path);
156 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
157
158 if let Some(ref user_agent) = configuration.user_agent {
159 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
160 }
161 if let Some(ref token) = configuration.bearer_access_token {
162 req_builder = req_builder.bearer_auth(token.to_owned());
163 };
164
165 let req = req_builder.build()?;
166 let resp = configuration.client.execute(req).await?;
167
168 let status = resp.status();
169 let content_type = resp
170 .headers()
171 .get("content-type")
172 .and_then(|v| v.to_str().ok())
173 .unwrap_or("application/octet-stream");
174 let content_type = super::ContentType::from(content_type);
175
176 if !status.is_client_error() && !status.is_server_error() {
177 let content = resp.text().await?;
178 match content_type {
179 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
180 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CurriculumView`"))),
181 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::CurriculumView`")))),
182 }
183 } else {
184 let content = resp.text().await?;
185 let entity: Option<DeleteGuideCurriculumError> = serde_json::from_str(&content).ok();
186 Err(Error::ResponseError(ResponseContent { status, content, entity }))
187 }
188}
189
190pub async fn get_guide(configuration: &configuration::Configuration, ) -> Result<models::OverviewView, Error<GetGuideError>> {
192
193 let uri_str = format!("{}/v1/guide", configuration.base_path);
194 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
195
196 if let Some(ref user_agent) = configuration.user_agent {
197 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
198 }
199 if let Some(ref token) = configuration.bearer_access_token {
200 req_builder = req_builder.bearer_auth(token.to_owned());
201 };
202
203 let req = req_builder.build()?;
204 let resp = configuration.client.execute(req).await?;
205
206 let status = resp.status();
207 let content_type = resp
208 .headers()
209 .get("content-type")
210 .and_then(|v| v.to_str().ok())
211 .unwrap_or("application/octet-stream");
212 let content_type = super::ContentType::from(content_type);
213
214 if !status.is_client_error() && !status.is_server_error() {
215 let content = resp.text().await?;
216 match content_type {
217 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
218 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OverviewView`"))),
219 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::OverviewView`")))),
220 }
221 } else {
222 let content = resp.text().await?;
223 let entity: Option<GetGuideError> = serde_json::from_str(&content).ok();
224 Err(Error::ResponseError(ResponseContent { status, content, entity }))
225 }
226}
227
228pub async fn get_guide_actions(configuration: &configuration::Configuration, ) -> Result<models::ActionsView, Error<GetGuideActionsError>> {
230
231 let uri_str = format!("{}/v1/guide/actions", configuration.base_path);
232 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
233
234 if let Some(ref user_agent) = configuration.user_agent {
235 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
236 }
237 if let Some(ref token) = configuration.bearer_access_token {
238 req_builder = req_builder.bearer_auth(token.to_owned());
239 };
240
241 let req = req_builder.build()?;
242 let resp = configuration.client.execute(req).await?;
243
244 let status = resp.status();
245 let content_type = resp
246 .headers()
247 .get("content-type")
248 .and_then(|v| v.to_str().ok())
249 .unwrap_or("application/octet-stream");
250 let content_type = super::ContentType::from(content_type);
251
252 if !status.is_client_error() && !status.is_server_error() {
253 let content = resp.text().await?;
254 match content_type {
255 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
256 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionsView`"))),
257 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::ActionsView`")))),
258 }
259 } else {
260 let content = resp.text().await?;
261 let entity: Option<GetGuideActionsError> = serde_json::from_str(&content).ok();
262 Err(Error::ResponseError(ResponseContent { status, content, entity }))
263 }
264}
265
266pub async fn get_guide_analytics(configuration: &configuration::Configuration, ) -> Result<models::AnalyticsView, Error<GetGuideAnalyticsError>> {
268
269 let uri_str = format!("{}/v1/guide/analytics", configuration.base_path);
270 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
271
272 if let Some(ref user_agent) = configuration.user_agent {
273 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
274 }
275 if let Some(ref token) = configuration.bearer_access_token {
276 req_builder = req_builder.bearer_auth(token.to_owned());
277 };
278
279 let req = req_builder.build()?;
280 let resp = configuration.client.execute(req).await?;
281
282 let status = resp.status();
283 let content_type = resp
284 .headers()
285 .get("content-type")
286 .and_then(|v| v.to_str().ok())
287 .unwrap_or("application/octet-stream");
288 let content_type = super::ContentType::from(content_type);
289
290 if !status.is_client_error() && !status.is_server_error() {
291 let content = resp.text().await?;
292 match content_type {
293 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
294 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AnalyticsView`"))),
295 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::AnalyticsView`")))),
296 }
297 } else {
298 let content = resp.text().await?;
299 let entity: Option<GetGuideAnalyticsError> = serde_json::from_str(&content).ok();
300 Err(Error::ResponseError(ResponseContent { status, content, entity }))
301 }
302}
303
304pub async fn get_guide_blueprint(configuration: &configuration::Configuration, ) -> Result<models::BlueprintView, Error<GetGuideBlueprintError>> {
306
307 let uri_str = format!("{}/v1/guide/blueprint", configuration.base_path);
308 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
309
310 if let Some(ref user_agent) = configuration.user_agent {
311 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
312 }
313 if let Some(ref token) = configuration.bearer_access_token {
314 req_builder = req_builder.bearer_auth(token.to_owned());
315 };
316
317 let req = req_builder.build()?;
318 let resp = configuration.client.execute(req).await?;
319
320 let status = resp.status();
321 let content_type = resp
322 .headers()
323 .get("content-type")
324 .and_then(|v| v.to_str().ok())
325 .unwrap_or("application/octet-stream");
326 let content_type = super::ContentType::from(content_type);
327
328 if !status.is_client_error() && !status.is_server_error() {
329 let content = resp.text().await?;
330 match content_type {
331 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
332 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BlueprintView`"))),
333 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::BlueprintView`")))),
334 }
335 } else {
336 let content = resp.text().await?;
337 let entity: Option<GetGuideBlueprintError> = serde_json::from_str(&content).ok();
338 Err(Error::ResponseError(ResponseContent { status, content, entity }))
339 }
340}
341
342pub async fn get_guide_blueprint_versions(configuration: &configuration::Configuration, ) -> Result<models::BlueprintVersionsView, Error<GetGuideBlueprintVersionsError>> {
344
345 let uri_str = format!("{}/v1/guide/blueprint/versions", configuration.base_path);
346 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
347
348 if let Some(ref user_agent) = configuration.user_agent {
349 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
350 }
351 if let Some(ref token) = configuration.bearer_access_token {
352 req_builder = req_builder.bearer_auth(token.to_owned());
353 };
354
355 let req = req_builder.build()?;
356 let resp = configuration.client.execute(req).await?;
357
358 let status = resp.status();
359 let content_type = resp
360 .headers()
361 .get("content-type")
362 .and_then(|v| v.to_str().ok())
363 .unwrap_or("application/octet-stream");
364 let content_type = super::ContentType::from(content_type);
365
366 if !status.is_client_error() && !status.is_server_error() {
367 let content = resp.text().await?;
368 match content_type {
369 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
370 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BlueprintVersionsView`"))),
371 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::BlueprintVersionsView`")))),
372 }
373 } else {
374 let content = resp.text().await?;
375 let entity: Option<GetGuideBlueprintVersionsError> = serde_json::from_str(&content).ok();
376 Err(Error::ResponseError(ResponseContent { status, content, entity }))
377 }
378}
379
380pub async fn get_guide_curriculum(configuration: &configuration::Configuration, ) -> Result<models::CurriculumView, Error<GetGuideCurriculumError>> {
382
383 let uri_str = format!("{}/v1/guide/curriculum", configuration.base_path);
384 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
385
386 if let Some(ref user_agent) = configuration.user_agent {
387 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
388 }
389 if let Some(ref token) = configuration.bearer_access_token {
390 req_builder = req_builder.bearer_auth(token.to_owned());
391 };
392
393 let req = req_builder.build()?;
394 let resp = configuration.client.execute(req).await?;
395
396 let status = resp.status();
397 let content_type = resp
398 .headers()
399 .get("content-type")
400 .and_then(|v| v.to_str().ok())
401 .unwrap_or("application/octet-stream");
402 let content_type = super::ContentType::from(content_type);
403
404 if !status.is_client_error() && !status.is_server_error() {
405 let content = resp.text().await?;
406 match content_type {
407 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
408 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CurriculumView`"))),
409 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::CurriculumView`")))),
410 }
411 } else {
412 let content = resp.text().await?;
413 let entity: Option<GetGuideCurriculumError> = serde_json::from_str(&content).ok();
414 Err(Error::ResponseError(ResponseContent { status, content, entity }))
415 }
416}
417
418pub async fn get_guide_profile(configuration: &configuration::Configuration, ) -> Result<models::ProfileResponse, Error<GetGuideProfileError>> {
420
421 let uri_str = format!("{}/v1/guide/profile", configuration.base_path);
422 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
423
424 if let Some(ref user_agent) = configuration.user_agent {
425 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
426 }
427 if let Some(ref token) = configuration.bearer_access_token {
428 req_builder = req_builder.bearer_auth(token.to_owned());
429 };
430
431 let req = req_builder.build()?;
432 let resp = configuration.client.execute(req).await?;
433
434 let status = resp.status();
435 let content_type = resp
436 .headers()
437 .get("content-type")
438 .and_then(|v| v.to_str().ok())
439 .unwrap_or("application/octet-stream");
440 let content_type = super::ContentType::from(content_type);
441
442 if !status.is_client_error() && !status.is_server_error() {
443 let content = resp.text().await?;
444 match content_type {
445 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
446 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProfileResponse`"))),
447 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::ProfileResponse`")))),
448 }
449 } else {
450 let content = resp.text().await?;
451 let entity: Option<GetGuideProfileError> = serde_json::from_str(&content).ok();
452 Err(Error::ResponseError(ResponseContent { status, content, entity }))
453 }
454}
455
456pub async fn get_guide_strategies(configuration: &configuration::Configuration, category: Option<&str>, stage: Option<&str>, workload: Option<&str>) -> Result<models::CorpusView, Error<GetGuideStrategiesError>> {
458 let p_category = category;
460 let p_stage = stage;
461 let p_workload = workload;
462
463 let uri_str = format!("{}/v1/guide/strategies", configuration.base_path);
464 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
465
466 if let Some(ref param_value) = p_category {
467 req_builder = req_builder.query(&[("category", ¶m_value.to_string())]);
468 }
469 if let Some(ref param_value) = p_stage {
470 req_builder = req_builder.query(&[("stage", ¶m_value.to_string())]);
471 }
472 if let Some(ref param_value) = p_workload {
473 req_builder = req_builder.query(&[("workload", ¶m_value.to_string())]);
474 }
475 if let Some(ref user_agent) = configuration.user_agent {
476 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
477 }
478 if let Some(ref token) = configuration.bearer_access_token {
479 req_builder = req_builder.bearer_auth(token.to_owned());
480 };
481
482 let req = req_builder.build()?;
483 let resp = configuration.client.execute(req).await?;
484
485 let status = resp.status();
486 let content_type = resp
487 .headers()
488 .get("content-type")
489 .and_then(|v| v.to_str().ok())
490 .unwrap_or("application/octet-stream");
491 let content_type = super::ContentType::from(content_type);
492
493 if !status.is_client_error() && !status.is_server_error() {
494 let content = resp.text().await?;
495 match content_type {
496 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
497 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CorpusView`"))),
498 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::CorpusView`")))),
499 }
500 } else {
501 let content = resp.text().await?;
502 let entity: Option<GetGuideStrategiesError> = serde_json::from_str(&content).ok();
503 Err(Error::ResponseError(ResponseContent { status, content, entity }))
504 }
505}
506
507pub async fn get_guide_suggest(configuration: &configuration::Configuration, ) -> Result<models::SuggestResponse, Error<GetGuideSuggestError>> {
509
510 let uri_str = format!("{}/v1/guide/suggest", configuration.base_path);
511 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
512
513 if let Some(ref user_agent) = configuration.user_agent {
514 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
515 }
516 if let Some(ref token) = configuration.bearer_access_token {
517 req_builder = req_builder.bearer_auth(token.to_owned());
518 };
519
520 let req = req_builder.build()?;
521 let resp = configuration.client.execute(req).await?;
522
523 let status = resp.status();
524 let content_type = resp
525 .headers()
526 .get("content-type")
527 .and_then(|v| v.to_str().ok())
528 .unwrap_or("application/octet-stream");
529 let content_type = super::ContentType::from(content_type);
530
531 if !status.is_client_error() && !status.is_server_error() {
532 let content = resp.text().await?;
533 match content_type {
534 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
535 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SuggestResponse`"))),
536 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::SuggestResponse`")))),
537 }
538 } else {
539 let content = resp.text().await?;
540 let entity: Option<GetGuideSuggestError> = serde_json::from_str(&content).ok();
541 Err(Error::ResponseError(ResponseContent { status, content, entity }))
542 }
543}
544
545pub async fn patch_guide_blueprint_by_collection_by_id(configuration: &configuration::Configuration, collection: &str, id: &str) -> Result<(), Error<PatchGuideBlueprintByCollectionByIdError>> {
547 let p_collection = collection;
549 let p_id = id;
550
551 let uri_str = format!("{}/v1/guide/blueprint/{collection}/{id}", configuration.base_path, collection=crate::apis::urlencode(p_collection), id=crate::apis::urlencode(p_id));
552 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
553
554 if let Some(ref user_agent) = configuration.user_agent {
555 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
556 }
557 if let Some(ref token) = configuration.bearer_access_token {
558 req_builder = req_builder.bearer_auth(token.to_owned());
559 };
560
561 let req = req_builder.build()?;
562 let resp = configuration.client.execute(req).await?;
563
564 let status = resp.status();
565
566 if !status.is_client_error() && !status.is_server_error() {
567 Ok(())
568 } else {
569 let content = resp.text().await?;
570 let entity: Option<PatchGuideBlueprintByCollectionByIdError> = serde_json::from_str(&content).ok();
571 Err(Error::ResponseError(ResponseContent { status, content, entity }))
572 }
573}
574
575pub async fn post_guide_chat(configuration: &configuration::Configuration, chat_request: models::ChatRequest) -> Result<models::ChatResponse, Error<PostGuideChatError>> {
577 let p_chat_request = chat_request;
579
580 let uri_str = format!("{}/v1/guide/chat", configuration.base_path);
581 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
582
583 if let Some(ref user_agent) = configuration.user_agent {
584 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
585 }
586 if let Some(ref token) = configuration.bearer_access_token {
587 req_builder = req_builder.bearer_auth(token.to_owned());
588 };
589 req_builder = req_builder.json(&p_chat_request);
590
591 let req = req_builder.build()?;
592 let resp = configuration.client.execute(req).await?;
593
594 let status = resp.status();
595 let content_type = resp
596 .headers()
597 .get("content-type")
598 .and_then(|v| v.to_str().ok())
599 .unwrap_or("application/octet-stream");
600 let content_type = super::ContentType::from(content_type);
601
602 if !status.is_client_error() && !status.is_server_error() {
603 let content = resp.text().await?;
604 match content_type {
605 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
606 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ChatResponse`"))),
607 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::ChatResponse`")))),
608 }
609 } else {
610 let content = resp.text().await?;
611 let entity: Option<PostGuideChatError> = serde_json::from_str(&content).ok();
612 Err(Error::ResponseError(ResponseContent { status, content, entity }))
613 }
614}
615
616pub async fn post_guide_steps_by_id_do(configuration: &configuration::Configuration, id: &str) -> Result<(), Error<PostGuideStepsByIdDoError>> {
618 let p_id = id;
620
621 let uri_str = format!("{}/v1/guide/steps/{id}/do", configuration.base_path, id=crate::apis::urlencode(p_id));
622 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
623
624 if let Some(ref user_agent) = configuration.user_agent {
625 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
626 }
627 if let Some(ref token) = configuration.bearer_access_token {
628 req_builder = req_builder.bearer_auth(token.to_owned());
629 };
630
631 let req = req_builder.build()?;
632 let resp = configuration.client.execute(req).await?;
633
634 let status = resp.status();
635
636 if !status.is_client_error() && !status.is_server_error() {
637 Ok(())
638 } else {
639 let content = resp.text().await?;
640 let entity: Option<PostGuideStepsByIdDoError> = serde_json::from_str(&content).ok();
641 Err(Error::ResponseError(ResponseContent { status, content, entity }))
642 }
643}
644
645pub async fn post_guide_steps_by_id_done(configuration: &configuration::Configuration, id: &str) -> Result<models::OverviewView, Error<PostGuideStepsByIdDoneError>> {
647 let p_id = id;
649
650 let uri_str = format!("{}/v1/guide/steps/{id}/done", configuration.base_path, id=crate::apis::urlencode(p_id));
651 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
652
653 if let Some(ref user_agent) = configuration.user_agent {
654 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
655 }
656 if let Some(ref token) = configuration.bearer_access_token {
657 req_builder = req_builder.bearer_auth(token.to_owned());
658 };
659
660 let req = req_builder.build()?;
661 let resp = configuration.client.execute(req).await?;
662
663 let status = resp.status();
664 let content_type = resp
665 .headers()
666 .get("content-type")
667 .and_then(|v| v.to_str().ok())
668 .unwrap_or("application/octet-stream");
669 let content_type = super::ContentType::from(content_type);
670
671 if !status.is_client_error() && !status.is_server_error() {
672 let content = resp.text().await?;
673 match content_type {
674 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
675 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OverviewView`"))),
676 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::OverviewView`")))),
677 }
678 } else {
679 let content = resp.text().await?;
680 let entity: Option<PostGuideStepsByIdDoneError> = serde_json::from_str(&content).ok();
681 Err(Error::ResponseError(ResponseContent { status, content, entity }))
682 }
683}
684
685pub async fn post_guide_steps_by_id_reset(configuration: &configuration::Configuration, id: &str) -> Result<models::OverviewView, Error<PostGuideStepsByIdResetError>> {
687 let p_id = id;
689
690 let uri_str = format!("{}/v1/guide/steps/{id}/reset", configuration.base_path, id=crate::apis::urlencode(p_id));
691 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
692
693 if let Some(ref user_agent) = configuration.user_agent {
694 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
695 }
696 if let Some(ref token) = configuration.bearer_access_token {
697 req_builder = req_builder.bearer_auth(token.to_owned());
698 };
699
700 let req = req_builder.build()?;
701 let resp = configuration.client.execute(req).await?;
702
703 let status = resp.status();
704 let content_type = resp
705 .headers()
706 .get("content-type")
707 .and_then(|v| v.to_str().ok())
708 .unwrap_or("application/octet-stream");
709 let content_type = super::ContentType::from(content_type);
710
711 if !status.is_client_error() && !status.is_server_error() {
712 let content = resp.text().await?;
713 match content_type {
714 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
715 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OverviewView`"))),
716 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::OverviewView`")))),
717 }
718 } else {
719 let content = resp.text().await?;
720 let entity: Option<PostGuideStepsByIdResetError> = serde_json::from_str(&content).ok();
721 Err(Error::ResponseError(ResponseContent { status, content, entity }))
722 }
723}
724
725pub async fn post_guide_steps_by_id_skip(configuration: &configuration::Configuration, id: &str) -> Result<models::OverviewView, Error<PostGuideStepsByIdSkipError>> {
727 let p_id = id;
729
730 let uri_str = format!("{}/v1/guide/steps/{id}/skip", configuration.base_path, id=crate::apis::urlencode(p_id));
731 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
732
733 if let Some(ref user_agent) = configuration.user_agent {
734 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
735 }
736 if let Some(ref token) = configuration.bearer_access_token {
737 req_builder = req_builder.bearer_auth(token.to_owned());
738 };
739
740 let req = req_builder.build()?;
741 let resp = configuration.client.execute(req).await?;
742
743 let status = resp.status();
744 let content_type = resp
745 .headers()
746 .get("content-type")
747 .and_then(|v| v.to_str().ok())
748 .unwrap_or("application/octet-stream");
749 let content_type = super::ContentType::from(content_type);
750
751 if !status.is_client_error() && !status.is_server_error() {
752 let content = resp.text().await?;
753 match content_type {
754 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
755 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OverviewView`"))),
756 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::OverviewView`")))),
757 }
758 } else {
759 let content = resp.text().await?;
760 let entity: Option<PostGuideStepsByIdSkipError> = serde_json::from_str(&content).ok();
761 Err(Error::ResponseError(ResponseContent { status, content, entity }))
762 }
763}
764
765pub async fn post_guide_steps_by_id_start(configuration: &configuration::Configuration, id: &str) -> Result<models::OverviewView, Error<PostGuideStepsByIdStartError>> {
767 let p_id = id;
769
770 let uri_str = format!("{}/v1/guide/steps/{id}/start", configuration.base_path, id=crate::apis::urlencode(p_id));
771 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
772
773 if let Some(ref user_agent) = configuration.user_agent {
774 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
775 }
776 if let Some(ref token) = configuration.bearer_access_token {
777 req_builder = req_builder.bearer_auth(token.to_owned());
778 };
779
780 let req = req_builder.build()?;
781 let resp = configuration.client.execute(req).await?;
782
783 let status = resp.status();
784 let content_type = resp
785 .headers()
786 .get("content-type")
787 .and_then(|v| v.to_str().ok())
788 .unwrap_or("application/octet-stream");
789 let content_type = super::ContentType::from(content_type);
790
791 if !status.is_client_error() && !status.is_server_error() {
792 let content = resp.text().await?;
793 match content_type {
794 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
795 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OverviewView`"))),
796 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::OverviewView`")))),
797 }
798 } else {
799 let content = resp.text().await?;
800 let entity: Option<PostGuideStepsByIdStartError> = serde_json::from_str(&content).ok();
801 Err(Error::ResponseError(ResponseContent { status, content, entity }))
802 }
803}
804
805pub async fn put_guide_blueprint(configuration: &configuration::Configuration, ) -> Result<(), Error<PutGuideBlueprintError>> {
807
808 let uri_str = format!("{}/v1/guide/blueprint", configuration.base_path);
809 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
810
811 if let Some(ref user_agent) = configuration.user_agent {
812 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
813 }
814 if let Some(ref token) = configuration.bearer_access_token {
815 req_builder = req_builder.bearer_auth(token.to_owned());
816 };
817
818 let req = req_builder.build()?;
819 let resp = configuration.client.execute(req).await?;
820
821 let status = resp.status();
822
823 if !status.is_client_error() && !status.is_server_error() {
824 Ok(())
825 } else {
826 let content = resp.text().await?;
827 let entity: Option<PutGuideBlueprintError> = serde_json::from_str(&content).ok();
828 Err(Error::ResponseError(ResponseContent { status, content, entity }))
829 }
830}
831
832pub async fn put_guide_curriculum(configuration: &configuration::Configuration, ) -> Result<(), Error<PutGuideCurriculumError>> {
834
835 let uri_str = format!("{}/v1/guide/curriculum", configuration.base_path);
836 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
837
838 if let Some(ref user_agent) = configuration.user_agent {
839 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
840 }
841 if let Some(ref token) = configuration.bearer_access_token {
842 req_builder = req_builder.bearer_auth(token.to_owned());
843 };
844
845 let req = req_builder.build()?;
846 let resp = configuration.client.execute(req).await?;
847
848 let status = resp.status();
849
850 if !status.is_client_error() && !status.is_server_error() {
851 Ok(())
852 } else {
853 let content = resp.text().await?;
854 let entity: Option<PutGuideCurriculumError> = serde_json::from_str(&content).ok();
855 Err(Error::ResponseError(ResponseContent { status, content, entity }))
856 }
857}
858