Skip to main content

orvanta_api/apis/
copilot_conversations_api.rs

1/*
2 * Orvanta API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 6.5.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method [`append_copilot_conversation_messages`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum AppendCopilotConversationMessagesError {
22    Status400(),
23    Status404(),
24    UnknownValue(serde_json::Value),
25}
26
27/// struct for typed errors of method [`create_copilot_conversation`]
28#[derive(Debug, Clone, Serialize, Deserialize)]
29#[serde(untagged)]
30pub enum CreateCopilotConversationError {
31    Status400(),
32    Status403(),
33    UnknownValue(serde_json::Value),
34}
35
36/// struct for typed errors of method [`delete_copilot_conversation`]
37#[derive(Debug, Clone, Serialize, Deserialize)]
38#[serde(untagged)]
39pub enum DeleteCopilotConversationError {
40    Status404(),
41    UnknownValue(serde_json::Value),
42}
43
44/// struct for typed errors of method [`get_copilot_conversation`]
45#[derive(Debug, Clone, Serialize, Deserialize)]
46#[serde(untagged)]
47pub enum GetCopilotConversationError {
48    Status404(),
49    UnknownValue(serde_json::Value),
50}
51
52/// struct for typed errors of method [`list_copilot_conversation_messages`]
53#[derive(Debug, Clone, Serialize, Deserialize)]
54#[serde(untagged)]
55pub enum ListCopilotConversationMessagesError {
56    Status404(),
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`list_copilot_conversation_shares`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum ListCopilotConversationSharesError {
64    Status404(),
65    UnknownValue(serde_json::Value),
66}
67
68/// struct for typed errors of method [`list_copilot_conversations`]
69#[derive(Debug, Clone, Serialize, Deserialize)]
70#[serde(untagged)]
71pub enum ListCopilotConversationsError {
72    Status403(),
73    UnknownValue(serde_json::Value),
74}
75
76/// struct for typed errors of method [`list_copilot_conversations_shared_with_me`]
77#[derive(Debug, Clone, Serialize, Deserialize)]
78#[serde(untagged)]
79pub enum ListCopilotConversationsSharedWithMeError {
80    UnknownValue(serde_json::Value),
81}
82
83/// struct for typed errors of method [`share_copilot_conversation`]
84#[derive(Debug, Clone, Serialize, Deserialize)]
85#[serde(untagged)]
86pub enum ShareCopilotConversationError {
87    Status400(),
88    Status404(),
89    UnknownValue(serde_json::Value),
90}
91
92/// struct for typed errors of method [`unshare_copilot_conversation`]
93#[derive(Debug, Clone, Serialize, Deserialize)]
94#[serde(untagged)]
95pub enum UnshareCopilotConversationError {
96    Status404(),
97    UnknownValue(serde_json::Value),
98}
99
100
101/// Author-only. A workspace admin that can read a transcript still gets a 404 here — read power and write power are deliberately separate so an audited transcript cannot be forged.
102pub async fn append_copilot_conversation_messages(configuration: &configuration::Configuration, workspace: &str, conversation_id: &str, append_copilot_conversation_messages_request: models::AppendCopilotConversationMessagesRequest) -> Result<models::AppendCopilotConversationMessages200Response, Error<AppendCopilotConversationMessagesError>> {
103    let local_var_configuration = configuration;
104
105    let local_var_client = &local_var_configuration.client;
106
107    let local_var_uri_str = format!("{}/w/{workspace}/copilot_conversations/{conversation_id}/messages", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), conversation_id=crate::apis::urlencode(conversation_id));
108    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
109
110    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
111        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
112    }
113    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
114        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
115    };
116    local_var_req_builder = local_var_req_builder.json(&append_copilot_conversation_messages_request);
117
118    let local_var_req = local_var_req_builder.build()?;
119    let local_var_resp = local_var_client.execute(local_var_req).await?;
120
121    let local_var_status = local_var_resp.status();
122    let local_var_content = local_var_resp.text().await?;
123
124    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
125        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
126    } else {
127        let local_var_entity: Option<AppendCopilotConversationMessagesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
128        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
129        Err(Error::ResponseError(local_var_error))
130    }
131}
132
133/// Idempotent upsert on a client-minted UUID, so a retry is safe. `messages` is normally empty (messages are appended per turn) and non-empty only on the one-time IndexedDB import. Re-using an id owned by someone else is refused rather than rebound.
134pub async fn create_copilot_conversation(configuration: &configuration::Configuration, workspace: &str, create_copilot_conversation_request: models::CreateCopilotConversationRequest) -> Result<models::CopilotConversation, Error<CreateCopilotConversationError>> {
135    let local_var_configuration = configuration;
136
137    let local_var_client = &local_var_configuration.client;
138
139    let local_var_uri_str = format!("{}/w/{workspace}/copilot_conversations/create", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
140    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
141
142    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
143        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
144    }
145    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
146        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
147    };
148    local_var_req_builder = local_var_req_builder.json(&create_copilot_conversation_request);
149
150    let local_var_req = local_var_req_builder.build()?;
151    let local_var_resp = local_var_client.execute(local_var_req).await?;
152
153    let local_var_status = local_var_resp.status();
154    let local_var_content = local_var_resp.text().await?;
155
156    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
157        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
158    } else {
159        let local_var_entity: Option<CreateCopilotConversationError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
160        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
161        Err(Error::ResponseError(local_var_error))
162    }
163}
164
165/// Author or workspace admin. Messages cascade. Always audit-logged — this is the erasure path for content a user may have pasted a secret into.
166pub async fn delete_copilot_conversation(configuration: &configuration::Configuration, workspace: &str, conversation_id: &str) -> Result<String, Error<DeleteCopilotConversationError>> {
167    let local_var_configuration = configuration;
168
169    let local_var_client = &local_var_configuration.client;
170
171    let local_var_uri_str = format!("{}/w/{workspace}/copilot_conversations/delete/{conversation_id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), conversation_id=crate::apis::urlencode(conversation_id));
172    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
173
174    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
175        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
176    }
177    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
178        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
179    };
180
181    let local_var_req = local_var_req_builder.build()?;
182    let local_var_resp = local_var_client.execute(local_var_req).await?;
183
184    let local_var_status = local_var_resp.status();
185    let local_var_content = local_var_resp.text().await?;
186
187    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
188        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
189    } else {
190        let local_var_entity: Option<DeleteCopilotConversationError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
191        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
192        Err(Error::ResponseError(local_var_error))
193    }
194}
195
196pub async fn get_copilot_conversation(configuration: &configuration::Configuration, workspace: &str, conversation_id: &str) -> Result<models::CopilotConversation, Error<GetCopilotConversationError>> {
197    let local_var_configuration = configuration;
198
199    let local_var_client = &local_var_configuration.client;
200
201    let local_var_uri_str = format!("{}/w/{workspace}/copilot_conversations/get/{conversation_id}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), conversation_id=crate::apis::urlencode(conversation_id));
202    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
203
204    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
205        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
206    }
207    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
208        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
209    };
210
211    let local_var_req = local_var_req_builder.build()?;
212    let local_var_resp = local_var_client.execute(local_var_req).await?;
213
214    let local_var_status = local_var_resp.status();
215    let local_var_content = local_var_resp.text().await?;
216
217    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
218        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
219    } else {
220        let local_var_entity: Option<GetCopilotConversationError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
221        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
222        Err(Error::ResponseError(local_var_error))
223    }
224}
225
226/// The author's own transcript is returned verbatim, byte-exact, because the `actual` channel is replayed to the model on resume. When a workspace admin reads **somebody else's** transcript (#1282), string leaves that match a known credential shape are replaced with `[orvanta:redacted]` in the response. That masking is best-effort pattern matching, not a guarantee: it catches PEM key blocks, URL userinfo, labelled `secret=`/`api_key:` assignments and a handful of prefixed vendor tokens, and it does **not** catch a bare unlabelled high-entropy string, an encoded secret, or a secret split across messages. Treat a masked transcript as still sensitive.
227pub async fn list_copilot_conversation_messages(configuration: &configuration::Configuration, workspace: &str, conversation_id: &str, page: Option<i32>, per_page: Option<i32>, after_seq: Option<i64>, channel: Option<&str>) -> Result<Vec<models::CopilotConversationMessage>, Error<ListCopilotConversationMessagesError>> {
228    let local_var_configuration = configuration;
229
230    let local_var_client = &local_var_configuration.client;
231
232    let local_var_uri_str = format!("{}/w/{workspace}/copilot_conversations/{conversation_id}/messages", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), conversation_id=crate::apis::urlencode(conversation_id));
233    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
234
235    if let Some(ref local_var_str) = page {
236        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
237    }
238    if let Some(ref local_var_str) = per_page {
239        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
240    }
241    if let Some(ref local_var_str) = after_seq {
242        local_var_req_builder = local_var_req_builder.query(&[("after_seq", &local_var_str.to_string())]);
243    }
244    if let Some(ref local_var_str) = channel {
245        local_var_req_builder = local_var_req_builder.query(&[("channel", &local_var_str.to_string())]);
246    }
247    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
248        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
249    }
250    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
251        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
252    };
253
254    let local_var_req = local_var_req_builder.build()?;
255    let local_var_resp = local_var_client.execute(local_var_req).await?;
256
257    let local_var_status = local_var_resp.status();
258    let local_var_content = local_var_resp.text().await?;
259
260    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
261        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
262    } else {
263        let local_var_entity: Option<ListCopilotConversationMessagesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
264        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
265        Err(Error::ResponseError(local_var_error))
266    }
267}
268
269/// Author, or a workspace admin (audited as `copilot_conversations.audit_read`). Deliberately not the recipients — telling one recipient who else has access discloses those people without their involvement.
270pub async fn list_copilot_conversation_shares(configuration: &configuration::Configuration, workspace: &str, conversation_id: &str) -> Result<Vec<models::CopilotConversationShare>, Error<ListCopilotConversationSharesError>> {
271    let local_var_configuration = configuration;
272
273    let local_var_client = &local_var_configuration.client;
274
275    let local_var_uri_str = format!("{}/w/{workspace}/copilot_conversations/{conversation_id}/shares", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), conversation_id=crate::apis::urlencode(conversation_id));
276    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
277
278    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
279        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
280    }
281    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
282        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
283    };
284
285    let local_var_req = local_var_req_builder.build()?;
286    let local_var_resp = local_var_client.execute(local_var_req).await?;
287
288    let local_var_status = local_var_resp.status();
289    let local_var_content = local_var_resp.text().await?;
290
291    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
292        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
293    } else {
294        let local_var_entity: Option<ListCopilotConversationSharesError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
295        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
296        Err(Error::ResponseError(local_var_error))
297    }
298}
299
300pub async fn list_copilot_conversations(configuration: &configuration::Configuration, workspace: &str, page: Option<i32>, per_page: Option<i32>, include_all_users: Option<bool>, created_by: Option<&str>, mode: Option<&str>) -> Result<Vec<models::CopilotConversation>, Error<ListCopilotConversationsError>> {
301    let local_var_configuration = configuration;
302
303    let local_var_client = &local_var_configuration.client;
304
305    let local_var_uri_str = format!("{}/w/{workspace}/copilot_conversations/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
306    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
307
308    if let Some(ref local_var_str) = page {
309        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
310    }
311    if let Some(ref local_var_str) = per_page {
312        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
313    }
314    if let Some(ref local_var_str) = include_all_users {
315        local_var_req_builder = local_var_req_builder.query(&[("include_all_users", &local_var_str.to_string())]);
316    }
317    if let Some(ref local_var_str) = created_by {
318        local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]);
319    }
320    if let Some(ref local_var_str) = mode {
321        local_var_req_builder = local_var_req_builder.query(&[("mode", &local_var_str.to_string())]);
322    }
323    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
324        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
325    }
326    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
327        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
328    };
329
330    let local_var_req = local_var_req_builder.build()?;
331    let local_var_resp = local_var_client.execute(local_var_req).await?;
332
333    let local_var_status = local_var_resp.status();
334    let local_var_content = local_var_resp.text().await?;
335
336    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
337        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
338    } else {
339        let local_var_entity: Option<ListCopilotConversationsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
340        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
341        Err(Error::ResponseError(local_var_error))
342    }
343}
344
345/// The recipient's inbox. Each entry carries `shared_by` — the authenticated identity that issued the grant — alongside the conversation's own `created_by`, which is an attribution recorded at save time and not a proof of authorship.
346pub async fn list_copilot_conversations_shared_with_me(configuration: &configuration::Configuration, workspace: &str, page: Option<i32>, per_page: Option<i32>) -> Result<Vec<models::SharedCopilotConversation>, Error<ListCopilotConversationsSharedWithMeError>> {
347    let local_var_configuration = configuration;
348
349    let local_var_client = &local_var_configuration.client;
350
351    let local_var_uri_str = format!("{}/w/{workspace}/copilot_conversations/shared_with_me", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
352    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
353
354    if let Some(ref local_var_str) = page {
355        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
356    }
357    if let Some(ref local_var_str) = per_page {
358        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
359    }
360    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
361        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
362    }
363    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
364        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
365    };
366
367    let local_var_req = local_var_req_builder.build()?;
368    let local_var_resp = local_var_client.execute(local_var_req).await?;
369
370    let local_var_status = local_var_resp.status();
371    let local_var_content = local_var_resp.text().await?;
372
373    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
374        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
375    } else {
376        let local_var_entity: Option<ListCopilotConversationsSharedWithMeError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
377        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
378        Err(Error::ResponseError(local_var_error))
379    }
380}
381
382/// Author-only, and idempotent: re-granting the same pair returns the existing grant without re-dating it or writing a second audit row. A workspace admin gets the same 404 as anyone else — a share is the author's consent that a colleague may read what they typed, and an admin issuing it on their behalf manufactures that consent. The recipient must be an active member of this workspace. Audit-logged as `copilot_conversations.share`.
383pub async fn share_copilot_conversation(configuration: &configuration::Configuration, workspace: &str, conversation_id: &str, create_service_account_request: models::CreateServiceAccountRequest) -> Result<models::CopilotConversationShare, Error<ShareCopilotConversationError>> {
384    let local_var_configuration = configuration;
385
386    let local_var_client = &local_var_configuration.client;
387
388    let local_var_uri_str = format!("{}/w/{workspace}/copilot_conversations/{conversation_id}/shares", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), conversation_id=crate::apis::urlencode(conversation_id));
389    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
390
391    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
392        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
393    }
394    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
395        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
396    };
397    local_var_req_builder = local_var_req_builder.json(&create_service_account_request);
398
399    let local_var_req = local_var_req_builder.build()?;
400    let local_var_resp = local_var_client.execute(local_var_req).await?;
401
402    let local_var_status = local_var_resp.status();
403    let local_var_content = local_var_resp.text().await?;
404
405    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
406        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
407    } else {
408        let local_var_entity: Option<ShareCopilotConversationError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
409        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
410        Err(Error::ResponseError(local_var_error))
411    }
412}
413
414/// Author or workspace admin, and idempotent. Revocation is **prospective**: it stops future reads through this API, it does not un-read — a recipient who already opened the transcript has seen it and may have copied it. Audit-logged as `copilot_conversations.unshare`.
415pub async fn unshare_copilot_conversation(configuration: &configuration::Configuration, workspace: &str, conversation_id: &str, username: &str) -> Result<String, Error<UnshareCopilotConversationError>> {
416    let local_var_configuration = configuration;
417
418    let local_var_client = &local_var_configuration.client;
419
420    let local_var_uri_str = format!("{}/w/{workspace}/copilot_conversations/{conversation_id}/shares/{username}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), conversation_id=crate::apis::urlencode(conversation_id), username=crate::apis::urlencode(username));
421    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
422
423    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
424        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
425    }
426    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
427        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
428    };
429
430    let local_var_req = local_var_req_builder.build()?;
431    let local_var_resp = local_var_client.execute(local_var_req).await?;
432
433    let local_var_status = local_var_resp.status();
434    let local_var_content = local_var_resp.text().await?;
435
436    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
437        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
438    } else {
439        let local_var_entity: Option<UnshareCopilotConversationError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
440        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
441        Err(Error::ResponseError(local_var_error))
442    }
443}
444