Skip to main content

hanzo_client/apis/
guide_api.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17
18/// struct for typed errors of method [`delete_guide_curriculum`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum DeleteGuideCurriculumError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`get_guide`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum GetGuideError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`get_guide_actions`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum GetGuideActionsError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`get_guide_analytics`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum GetGuideAnalyticsError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`get_guide_blueprint`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum GetGuideBlueprintError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`get_guide_blueprint_versions`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum GetGuideBlueprintVersionsError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`get_guide_curriculum`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum GetGuideCurriculumError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`get_guide_profile`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetGuideProfileError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`get_guide_strategies`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetGuideStrategiesError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`get_guide_suggest`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetGuideSuggestError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`patch_guide_blueprint_by_collection_by_id`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum PatchGuideBlueprintByCollectionByIdError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`post_guide_chat`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum PostGuideChatError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`post_guide_steps_by_id_do`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum PostGuideStepsByIdDoError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`post_guide_steps_by_id_done`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum PostGuideStepsByIdDoneError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`post_guide_steps_by_id_reset`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum PostGuideStepsByIdResetError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`post_guide_steps_by_id_skip`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum PostGuideStepsByIdSkipError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`post_guide_steps_by_id_start`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum PostGuideStepsByIdStartError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`put_guide_blueprint`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum PutGuideBlueprintError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`put_guide_curriculum`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum PutGuideCurriculumError {
148    UnknownValue(serde_json::Value),
149}
150
151
152/// Clears the caller org's curriculum override and returns the journey it falls back to — the brand blueprint, else the embedded fixture. Clearing an org that never set one is a no-op that answers the same default.
153pub 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
190/// Overview returns the caller org's launch journey: the active curriculum's version and title, every step with its state, whether it is available, what blocks it and whether the Business AI can run it, the done/total/percent progress with the next step to take, and the org's analytics funnel folded in. Auto-detect runs first, so a step the org has already completed elsewhere reads done without anyone marking it.
191pub 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
228/// Returns the caller org's Business AI action ledger, most recent first: every \"do it for me\" tool call, the arguments it ran with, its result and whether it succeeded. It is the audit-visible record of what the agent did on the org's behalf, and the backing state for the \"acted\" auto-detect signal.
229pub 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
266/// Analytics returns the caller org's funnel from the analytics lens plus the GTM recommendations derived from it. It is the Business AI's data-grounded read — what the funnel is doing, and the next-best action to move its weakest stage. An unreachable or silent warehouse answers available=false, never a fabricated number.
267pub 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
304/// Returns the FULL authored brand blueprint — every principle, section, step, strategy and template WITH its enabled flag made explicit, including the disabled items the org-facing reads never see — plus the active version number, the brand key it is stored under and the item counts. It is the SuperAdmin authoring view of the platform blueprint, so it is refused 403 for anyone else, including a per-org admin: the brand blueprint is shared platform content, not a per-customer surface.
305pub 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
342/// Returns the brand blueprint's version history — every stored version's number and edit time, newest first — which is the point-in-time-recovery and audit trail behind the authoring plane. Metadata only: the documents are not returned. SuperAdmin only, like the rest of this plane. The history is listable even when the current stored document no longer parses, so a schema-drifted row can still be diagnosed.
343pub 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
380/// Returns the journey the caller's org is actually running, and whether it comes from the org's OWN override (custom) or from the platform default — the brand blueprint, else the embedded fixture.
381pub 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
418/// Profile returns the caller org's OBSERVED growth profile — the signal set, the classified growth stage, and the org's own key metrics. It is a pure READ, recomputed from the org's CURRENT state each request (real-time by pull): it reuses the reconcile path (snapshotFor runs the detectors) for launch progress and runs the growth probes (observe) for the signals — it never caches, never runs a billable effect, never targets another org. Org-scoped on the validated principal; fail-closed without one. It PRODUCES the profile and classifies the stage; it decides NO recommendation (that is a later surface).
419pub 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
456/// Strategies returns the ENABLED tactics corpus for the caller's org: the tactics library narrowed by the explicit category/workload filters AND by the org's OBSERVED growth stage and capability signals (a tactic's tags are preconditions, so it surfaces only once the org can act on it). Passing stage PREVIEWS the corpus at that stage instead of the observed one. The content is shared platform data — no org's records — and the read is never a billable effect.
457pub async fn get_guide_strategies(configuration: &configuration::Configuration, category: Option<&str>, stage: Option<&str>, workload: Option<&str>) -> Result<models::CorpusView, Error<GetGuideStrategiesError>> {
458    // add a prefix to parameters to efficiently prevent name collisions
459    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", &param_value.to_string())]);
468    }
469    if let Some(ref param_value) = p_stage {
470        req_builder = req_builder.query(&[("stage", &param_value.to_string())]);
471    }
472    if let Some(ref param_value) = p_workload {
473        req_builder = req_builder.query(&[("workload", &param_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
507/// Suggest returns the caller org's next-best quests: the available, non-terminal steps of its journey ranked by how much downstream work each unblocks, each with the grounded reason it is a good next move and whether the Business AI can run it, plus the org's funnel and the GTM recommendations derived from it. A best-effort AI narrative over exactly those quests and numbers is included when an AI plane is wired. READ-ONLY: it advises and never runs a step — the only executing path is POST /v1/guide/steps/{id}/do.
508pub 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
545/// Edits a single item of the brand blueprint by id and saves it as a NEW VERSION, answering the whole blueprint after the edit. `collection` is one of `sections`, `steps`, `strategies` or `templates`; anything else is 400, and an id that collection does not hold is 404. This is also the retire lever: `{\"enabled\": false}` takes an item out of every org's journey without deleting it or its history.  SuperAdmin ONLY, like the rest of the authoring plane; a per-org admin is 403. The write is audited.  The patch is a SHALLOW merge over the item's own top-level keys — a key you send replaces that key whole, a key you omit is left alone — and `id` is dropped from the patch before it is applied, so an edit can never rekey an item. That is why the body has no declarable shape: its keys are the patched item's, not this route's.  Fail-closed on the WHOLE document, not just the item: the blueprint is re-validated after the merge, so a patch that would dangle a dependency, break the step DAG or empty the journey is 422 and nothing is saved. An empty patch is 400 and one over 16 MiB is 413.
546pub async fn patch_guide_blueprint_by_collection_by_id(configuration: &configuration::Configuration, collection: &str, id: &str) -> Result<(), Error<PatchGuideBlueprintByCollectionByIdError>> {
547    // add a prefix to parameters to efficiently prevent name collisions
548    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
575/// Chat answers a founder's question about their launch journey as the Business AI coach: it grounds the reply in the org's REAL progress, its ranked available quests and its analytics funnel, and returns those candidate quests alongside so the caller can act on one. READ-ONLY — it advises and never runs a step, so it cannot be talked into performing an action; the only executing path is POST /v1/guide/steps/{id}/do. One AI completion per call, billed to the caller's own payer.
576pub async fn post_guide_chat(configuration: &configuration::Configuration, chat_request: models::ChatRequest) -> Result<models::ChatResponse, Error<PostGuideChatError>> {
577    // add a prefix to parameters to efficiently prevent name collisions
578    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
616/// Executes one step of the caller org's journey through that principal's OWN tool plane and answers the action log — `{step, events, state}` — so the caller sees every tool call the agent made and where the step ended up. This is the ONE executing path in guide: suggest and chat advise, this acts, and the work is charged to the calling principal's ledger.  Ask for it live and the same actions arrive as Server-Sent Events instead, on either of two triggers — `Accept: text/event-stream` or `?stream=1`. The stream opens with a comment, emits one frame per action as it happens, and closes with an `end` frame carrying `ok` and the final state. The streamed run is detached and bounded at 120 seconds, so it finishes on its own clock once the response has begun.  An agent that FAILS is not a failed request: the JSON answer still comes back 200 with `error` beside the events it did manage, and the stream still ends with `ok:false`. The refusals are the ones before the agent runs — 409 with `{error, step, blockedBy}` for a step whose dependencies are unfinished, 404 for an id the journey does not contain, 403 without a validated org.
617pub async fn post_guide_steps_by_id_do(configuration: &configuration::Configuration, id: &str) -> Result<(), Error<PostGuideStepsByIdDoError>> {
618    // add a prefix to parameters to efficiently prevent name collisions
619    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
645/// Marks one step of the caller org's journey complete and returns the refreshed journey.  Dependency-GATED, exactly as start is: a step whose prerequisites are unfinished is refused 409 carrying {error, step, blockedBy} naming what is in the way.
646pub async fn post_guide_steps_by_id_done(configuration: &configuration::Configuration, id: &str) -> Result<models::OverviewView, Error<PostGuideStepsByIdDoneError>> {
647    // add a prefix to parameters to efficiently prevent name collisions
648    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
685/// Returns one step of the caller org's journey to todo — clearing a manual mark or a skip — and returns the refreshed journey. Reset is never dependency-gated. Auto-detect runs on the next read, so a step the org has in fact completed elsewhere goes straight back to done.
686pub async fn post_guide_steps_by_id_reset(configuration: &configuration::Configuration, id: &str) -> Result<models::OverviewView, Error<PostGuideStepsByIdResetError>> {
687    // add a prefix to parameters to efficiently prevent name collisions
688    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
725/// Marks one step of the caller org's journey skipped and returns the refreshed journey. Skipping is never dependency-gated — the founder is declaring the step does not apply to them — so a step whose dependencies are unfinished can still be skipped, and a skipped step counts as terminal for everything downstream of it.
726pub async fn post_guide_steps_by_id_skip(configuration: &configuration::Configuration, id: &str) -> Result<models::OverviewView, Error<PostGuideStepsByIdSkipError>> {
727    // add a prefix to parameters to efficiently prevent name collisions
728    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
765/// Marks one step of the caller org's journey in progress and returns the refreshed journey.  Dependency-GATED: a step whose prerequisites are unfinished is refused 409 carrying {error, step, blockedBy}, where blockedBy names the exact steps in the way — enough to render the reason without asking again.
766pub async fn post_guide_steps_by_id_start(configuration: &configuration::Configuration, id: &str) -> Result<models::OverviewView, Error<PostGuideStepsByIdStartError>> {
767    // add a prefix to parameters to efficiently prevent name collisions
768    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
805/// Replaces the deployment's brand blueprint — the shared journey, sections, strategies and templates every org starts from — as a NEW VERSION, and answers the stored document with its key and version number. The previous versions are kept, so /blueprint/versions is a real recovery trail.  SuperAdmin ONLY. A per-org admin is 403: this is platform content, not a per-customer surface — the per-customer surface is /v1/guide/curriculum. The write is audited.  The body is a blueprint document accepted as YAML **or** JSON, which is the caller-visible reason it takes a raw body. It must parse AND validate — unique ids throughout, an acyclic step graph with no dangling dependencies, every step's section and every strategy's principle resolving to a real one — or it is 422 and never becomes active, leaving the version already serving authoritative. An empty body is 400 and one over 16 MiB is 413.  Edits are live: the next resolve reads the newest version. A stored document that is itself corrupt or schema-drifted does not block this write — the target is resolved without parsing what is there — so a bad version can always be published over.
806pub 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
832/// Sets the caller org's OWN curriculum — the per-customer override — and answers the journey now in force with `custom: true`. The body is a curriculum document, and it is accepted as YAML **or** JSON: that is the caller-visible reason this takes a raw body rather than a declared shape. Whatever the syntax, the CANONICAL parsed form is what is stored, so the document the engine runs never depends on how it was written.  Fail-closed: a body that does not parse, or parses but is not a valid journey (unique step ids, no dangling or cyclic dependencies), is 422 and NEVER becomes active — the org keeps the journey it had. Requires a validated org; 403 without one. An empty body is 400 and one over 256 KiB is 413.  This is tier one only. It overrides nothing but this org's own journey; the shared brand blueprint is a different surface with a different gate. DELETE the same path to drop the override and fall back to it.
833pub 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