Skip to main content

hanzo_client/apis/
captable_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_captable_convertibles_by_id`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum DeleteCaptableConvertiblesByIdError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`delete_captable_options_by_id`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum DeleteCaptableOptionsByIdError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`delete_captable_safes_by_id`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum DeleteCaptableSafesByIdError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`delete_captable_shares_by_id`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum DeleteCaptableSharesByIdError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`delete_captable_stakeholders_by_id`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum DeleteCaptableStakeholdersByIdError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`get_captable_classes`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum GetCaptableClassesError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`get_captable_company`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum GetCaptableCompanyError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`get_captable_convertibles`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetCaptableConvertiblesError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`get_captable_investments`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetCaptableInvestmentsError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`get_captable_options`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetCaptableOptionsError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`get_captable_plans`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetCaptablePlansError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`get_captable_rounds`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetCaptableRoundsError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`get_captable_rounds_by_id`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum GetCaptableRoundsByIdError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`get_captable_safes`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum GetCaptableSafesError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`get_captable_shares`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum GetCaptableSharesError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`get_captable_stakeholders`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetCaptableStakeholdersError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`get_captable_summary`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum GetCaptableSummaryError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`patch_captable_classes_by_id`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum PatchCaptableClassesByIdError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`patch_captable_stakeholders_by_id`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum PatchCaptableStakeholdersByIdError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`post_captable_classes`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum PostCaptableClassesError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`post_captable_convertibles`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum PostCaptableConvertiblesError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`post_captable_options`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum PostCaptableOptionsError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`post_captable_plans`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum PostCaptablePlansError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`post_captable_rounds`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum PostCaptableRoundsError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`post_captable_rounds_by_id_close`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum PostCaptableRoundsByIdCloseError {
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`post_captable_rounds_by_id_investments`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum PostCaptableRoundsByIdInvestmentsError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`post_captable_safes`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum PostCaptableSafesError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`post_captable_shares`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum PostCaptableSharesError {
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`post_captable_shares_transfer`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum PostCaptableSharesTransferError {
218    UnknownValue(serde_json::Value),
219}
220
221/// struct for typed errors of method [`post_captable_stakeholders`]
222#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum PostCaptableStakeholdersError {
225    UnknownValue(serde_json::Value),
226}
227
228/// struct for typed errors of method [`put_captable_company`]
229#[derive(Debug, Clone, Serialize, Deserialize)]
230#[serde(untagged)]
231pub enum PutCaptableCompanyError {
232    UnknownValue(serde_json::Value),
233}
234
235
236/// Removes one of the caller org's convertible notes, taking its principal out of the cap table's unconverted-instrument totals. An id this org does not hold is not found.
237pub async fn delete_captable_convertibles_by_id(configuration: &configuration::Configuration, id: &str) -> Result<models::CaptableDeleted, Error<DeleteCaptableConvertiblesByIdError>> {
238    // add a prefix to parameters to efficiently prevent name collisions
239    let p_id = id;
240
241    let uri_str = format!("{}/v1/captable/convertibles/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
242    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
243
244    if let Some(ref user_agent) = configuration.user_agent {
245        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
246    }
247    if let Some(ref token) = configuration.bearer_access_token {
248        req_builder = req_builder.bearer_auth(token.to_owned());
249    };
250
251    let req = req_builder.build()?;
252    let resp = configuration.client.execute(req).await?;
253
254    let status = resp.status();
255    let content_type = resp
256        .headers()
257        .get("content-type")
258        .and_then(|v| v.to_str().ok())
259        .unwrap_or("application/octet-stream");
260    let content_type = super::ContentType::from(content_type);
261
262    if !status.is_client_error() && !status.is_server_error() {
263        let content = resp.text().await?;
264        match content_type {
265            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
266            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableDeleted`"))),
267            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::CaptableDeleted`")))),
268        }
269    } else {
270        let content = resp.text().await?;
271        let entity: Option<DeleteCaptableConvertiblesByIdError> = serde_json::from_str(&content).ok();
272        Err(Error::ResponseError(ResponseContent { status, content, entity }))
273    }
274}
275
276/// Removes one of the caller org's option grants, taking its shares out of the cap table's granted-options and fully-diluted counts. An id this org does not hold is not found.
277pub async fn delete_captable_options_by_id(configuration: &configuration::Configuration, id: &str) -> Result<models::CaptableDeleted, Error<DeleteCaptableOptionsByIdError>> {
278    // add a prefix to parameters to efficiently prevent name collisions
279    let p_id = id;
280
281    let uri_str = format!("{}/v1/captable/options/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
282    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
283
284    if let Some(ref user_agent) = configuration.user_agent {
285        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
286    }
287    if let Some(ref token) = configuration.bearer_access_token {
288        req_builder = req_builder.bearer_auth(token.to_owned());
289    };
290
291    let req = req_builder.build()?;
292    let resp = configuration.client.execute(req).await?;
293
294    let status = resp.status();
295    let content_type = resp
296        .headers()
297        .get("content-type")
298        .and_then(|v| v.to_str().ok())
299        .unwrap_or("application/octet-stream");
300    let content_type = super::ContentType::from(content_type);
301
302    if !status.is_client_error() && !status.is_server_error() {
303        let content = resp.text().await?;
304        match content_type {
305            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
306            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableDeleted`"))),
307            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::CaptableDeleted`")))),
308        }
309    } else {
310        let content = resp.text().await?;
311        let entity: Option<DeleteCaptableOptionsByIdError> = serde_json::from_str(&content).ok();
312        Err(Error::ResponseError(ResponseContent { status, content, entity }))
313    }
314}
315
316/// Removes one of the caller org's SAFEs, taking its capital out of the cap table's unconverted-instrument totals. An id this org does not hold is not found.
317pub async fn delete_captable_safes_by_id(configuration: &configuration::Configuration, id: &str) -> Result<models::CaptableDeleted, Error<DeleteCaptableSafesByIdError>> {
318    // add a prefix to parameters to efficiently prevent name collisions
319    let p_id = id;
320
321    let uri_str = format!("{}/v1/captable/safes/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
322    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
323
324    if let Some(ref user_agent) = configuration.user_agent {
325        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
326    }
327    if let Some(ref token) = configuration.bearer_access_token {
328        req_builder = req_builder.bearer_auth(token.to_owned());
329    };
330
331    let req = req_builder.build()?;
332    let resp = configuration.client.execute(req).await?;
333
334    let status = resp.status();
335    let content_type = resp
336        .headers()
337        .get("content-type")
338        .and_then(|v| v.to_str().ok())
339        .unwrap_or("application/octet-stream");
340    let content_type = super::ContentType::from(content_type);
341
342    if !status.is_client_error() && !status.is_server_error() {
343        let content = resp.text().await?;
344        match content_type {
345            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
346            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableDeleted`"))),
347            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::CaptableDeleted`")))),
348        }
349    } else {
350        let content = resp.text().await?;
351        let entity: Option<DeleteCaptableSafesByIdError> = serde_json::from_str(&content).ok();
352        Err(Error::ResponseError(ResponseContent { status, content, entity }))
353    }
354}
355
356/// Removes one of the caller org's share certificates, taking its shares out of the cap table's outstanding and fully-diluted counts. An id this org does not hold is not found.
357pub async fn delete_captable_shares_by_id(configuration: &configuration::Configuration, id: &str) -> Result<models::CaptableDeleted, Error<DeleteCaptableSharesByIdError>> {
358    // add a prefix to parameters to efficiently prevent name collisions
359    let p_id = id;
360
361    let uri_str = format!("{}/v1/captable/shares/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
362    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
363
364    if let Some(ref user_agent) = configuration.user_agent {
365        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
366    }
367    if let Some(ref token) = configuration.bearer_access_token {
368        req_builder = req_builder.bearer_auth(token.to_owned());
369    };
370
371    let req = req_builder.build()?;
372    let resp = configuration.client.execute(req).await?;
373
374    let status = resp.status();
375    let content_type = resp
376        .headers()
377        .get("content-type")
378        .and_then(|v| v.to_str().ok())
379        .unwrap_or("application/octet-stream");
380    let content_type = super::ContentType::from(content_type);
381
382    if !status.is_client_error() && !status.is_server_error() {
383        let content = resp.text().await?;
384        match content_type {
385            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
386            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableDeleted`"))),
387            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::CaptableDeleted`")))),
388        }
389    } else {
390        let content = resp.text().await?;
391        let entity: Option<DeleteCaptableSharesByIdError> = serde_json::from_str(&content).ok();
392        Err(Error::ResponseError(ResponseContent { status, content, entity }))
393    }
394}
395
396/// Removes one of the caller org's stakeholders. It REFUSES to orphan issued equity: a holder that still holds share certificates or option grants cannot be deleted, and answers 400 saying so — release or transfer the holdings first. An id this org does not hold is not found.
397pub async fn delete_captable_stakeholders_by_id(configuration: &configuration::Configuration, id: &str) -> Result<models::CaptableDeleted, Error<DeleteCaptableStakeholdersByIdError>> {
398    // add a prefix to parameters to efficiently prevent name collisions
399    let p_id = id;
400
401    let uri_str = format!("{}/v1/captable/stakeholders/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
402    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
403
404    if let Some(ref user_agent) = configuration.user_agent {
405        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
406    }
407    if let Some(ref token) = configuration.bearer_access_token {
408        req_builder = req_builder.bearer_auth(token.to_owned());
409    };
410
411    let req = req_builder.build()?;
412    let resp = configuration.client.execute(req).await?;
413
414    let status = resp.status();
415    let content_type = resp
416        .headers()
417        .get("content-type")
418        .and_then(|v| v.to_str().ok())
419        .unwrap_or("application/octet-stream");
420    let content_type = super::ContentType::from(content_type);
421
422    if !status.is_client_error() && !status.is_server_error() {
423        let content = resp.text().await?;
424        match content_type {
425            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
426            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableDeleted`"))),
427            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::CaptableDeleted`")))),
428        }
429    } else {
430        let content = resp.text().await?;
431        let entity: Option<DeleteCaptableStakeholdersByIdError> = serde_json::from_str(&content).ok();
432        Err(Error::ResponseError(ResponseContent { status, content, entity }))
433    }
434}
435
436/// Returns the caller org's share classes, in creation order. A share class is what a certificate is issued in, and every class the company has authorized appears. The response is a bare JSON array, not an envelope.
437pub async fn get_captable_classes(configuration: &configuration::Configuration, ) -> Result<Vec<models::CaptableShareClass>, Error<GetCaptableClassesError>> {
438
439    let uri_str = format!("{}/v1/captable/classes", configuration.base_path);
440    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
441
442    if let Some(ref user_agent) = configuration.user_agent {
443        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
444    }
445    if let Some(ref token) = configuration.bearer_access_token {
446        req_builder = req_builder.bearer_auth(token.to_owned());
447    };
448
449    let req = req_builder.build()?;
450    let resp = configuration.client.execute(req).await?;
451
452    let status = resp.status();
453    let content_type = resp
454        .headers()
455        .get("content-type")
456        .and_then(|v| v.to_str().ok())
457        .unwrap_or("application/octet-stream");
458    let content_type = super::ContentType::from(content_type);
459
460    if !status.is_client_error() && !status.is_server_error() {
461        let content = resp.text().await?;
462        match content_type {
463            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
464            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::CaptableShareClass&gt;`"))),
465            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::CaptableShareClass&gt;`")))),
466        }
467    } else {
468        let content = resp.text().await?;
469        let entity: Option<GetCaptableClassesError> = serde_json::from_str(&content).ok();
470        Err(Error::ResponseError(ResponseContent { status, content, entity }))
471    }
472}
473
474/// Returns the caller org's cap-table company record. The row is seeded when the tenant's store first opens, so it always exists; its name and incorporation details are set with PUT /v1/captable/company.
475pub async fn get_captable_company(configuration: &configuration::Configuration, ) -> Result<models::CaptableCompany, Error<GetCaptableCompanyError>> {
476
477    let uri_str = format!("{}/v1/captable/company", configuration.base_path);
478    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
479
480    if let Some(ref user_agent) = configuration.user_agent {
481        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
482    }
483    if let Some(ref token) = configuration.bearer_access_token {
484        req_builder = req_builder.bearer_auth(token.to_owned());
485    };
486
487    let req = req_builder.build()?;
488    let resp = configuration.client.execute(req).await?;
489
490    let status = resp.status();
491    let content_type = resp
492        .headers()
493        .get("content-type")
494        .and_then(|v| v.to_str().ok())
495        .unwrap_or("application/octet-stream");
496    let content_type = super::ContentType::from(content_type);
497
498    if !status.is_client_error() && !status.is_server_error() {
499        let content = resp.text().await?;
500        match content_type {
501            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
502            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableCompany`"))),
503            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::CaptableCompany`")))),
504        }
505    } else {
506        let content = resp.text().await?;
507        let entity: Option<GetCaptableCompanyError> = serde_json::from_str(&content).ok();
508        Err(Error::ResponseError(ResponseContent { status, content, entity }))
509    }
510}
511
512/// Returns the caller org's convertible notes, newest first. A note's principal sits OUTSIDE issued equity until it converts, so it is not part of the share counts.
513pub async fn get_captable_convertibles(configuration: &configuration::Configuration, ) -> Result<models::CaptableNotes, Error<GetCaptableConvertiblesError>> {
514
515    let uri_str = format!("{}/v1/captable/convertibles", configuration.base_path);
516    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
517
518    if let Some(ref user_agent) = configuration.user_agent {
519        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
520    }
521    if let Some(ref token) = configuration.bearer_access_token {
522        req_builder = req_builder.bearer_auth(token.to_owned());
523    };
524
525    let req = req_builder.build()?;
526    let resp = configuration.client.execute(req).await?;
527
528    let status = resp.status();
529    let content_type = resp
530        .headers()
531        .get("content-type")
532        .and_then(|v| v.to_str().ok())
533        .unwrap_or("application/octet-stream");
534    let content_type = super::ContentType::from(content_type);
535
536    if !status.is_client_error() && !status.is_server_error() {
537        let content = resp.text().await?;
538        match content_type {
539            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
540            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableNotes`"))),
541            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::CaptableNotes`")))),
542        }
543    } else {
544        let content = resp.text().await?;
545        let entity: Option<GetCaptableConvertiblesError> = serde_json::from_str(&content).ok();
546        Err(Error::ResponseError(ResponseContent { status, content, entity }))
547    }
548}
549
550/// Returns the caller org's investments, newest first. It spans every round, so it is the flat ledger of cheques written into the company, each naming its investor and the round it went into.
551pub async fn get_captable_investments(configuration: &configuration::Configuration, ) -> Result<models::CaptableInvestments, Error<GetCaptableInvestmentsError>> {
552
553    let uri_str = format!("{}/v1/captable/investments", configuration.base_path);
554    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
555
556    if let Some(ref user_agent) = configuration.user_agent {
557        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
558    }
559    if let Some(ref token) = configuration.bearer_access_token {
560        req_builder = req_builder.bearer_auth(token.to_owned());
561    };
562
563    let req = req_builder.build()?;
564    let resp = configuration.client.execute(req).await?;
565
566    let status = resp.status();
567    let content_type = resp
568        .headers()
569        .get("content-type")
570        .and_then(|v| v.to_str().ok())
571        .unwrap_or("application/octet-stream");
572    let content_type = super::ContentType::from(content_type);
573
574    if !status.is_client_error() && !status.is_server_error() {
575        let content = resp.text().await?;
576        match content_type {
577            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
578            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableInvestments`"))),
579            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::CaptableInvestments`")))),
580        }
581    } else {
582        let content = resp.text().await?;
583        let entity: Option<GetCaptableInvestmentsError> = serde_json::from_str(&content).ok();
584        Err(Error::ResponseError(ResponseContent { status, content, entity }))
585    }
586}
587
588/// Returns the caller org's option grants, newest first. Each row is joined to its grantee and its equity plan. Grants that are EXERCISED, EXPIRED or CANCELLED are listed here but do not dilute the cap table.
589pub async fn get_captable_options(configuration: &configuration::Configuration, ) -> Result<models::CaptableOptions, Error<GetCaptableOptionsError>> {
590
591    let uri_str = format!("{}/v1/captable/options", configuration.base_path);
592    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
593
594    if let Some(ref user_agent) = configuration.user_agent {
595        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
596    }
597    if let Some(ref token) = configuration.bearer_access_token {
598        req_builder = req_builder.bearer_auth(token.to_owned());
599    };
600
601    let req = req_builder.build()?;
602    let resp = configuration.client.execute(req).await?;
603
604    let status = resp.status();
605    let content_type = resp
606        .headers()
607        .get("content-type")
608        .and_then(|v| v.to_str().ok())
609        .unwrap_or("application/octet-stream");
610    let content_type = super::ContentType::from(content_type);
611
612    if !status.is_client_error() && !status.is_server_error() {
613        let content = resp.text().await?;
614        match content_type {
615            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
616            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableOptions`"))),
617            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::CaptableOptions`")))),
618        }
619    } else {
620        let content = resp.text().await?;
621        let entity: Option<GetCaptableOptionsError> = serde_json::from_str(&content).ok();
622        Err(Error::ResponseError(ResponseContent { status, content, entity }))
623    }
624}
625
626/// Returns the caller org's equity plans, newest first. An equity plan is an option pool: a reserve of shares, drawn from one share class, that option grants are written against.
627pub async fn get_captable_plans(configuration: &configuration::Configuration, ) -> Result<models::CaptableEquityPlans, Error<GetCaptablePlansError>> {
628
629    let uri_str = format!("{}/v1/captable/plans", configuration.base_path);
630    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
631
632    if let Some(ref user_agent) = configuration.user_agent {
633        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
634    }
635    if let Some(ref token) = configuration.bearer_access_token {
636        req_builder = req_builder.bearer_auth(token.to_owned());
637    };
638
639    let req = req_builder.build()?;
640    let resp = configuration.client.execute(req).await?;
641
642    let status = resp.status();
643    let content_type = resp
644        .headers()
645        .get("content-type")
646        .and_then(|v| v.to_str().ok())
647        .unwrap_or("application/octet-stream");
648    let content_type = super::ContentType::from(content_type);
649
650    if !status.is_client_error() && !status.is_server_error() {
651        let content = resp.text().await?;
652        match content_type {
653            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
654            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableEquityPlans`"))),
655            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::CaptableEquityPlans`")))),
656        }
657    } else {
658        let content = resp.text().await?;
659        let entity: Option<GetCaptablePlansError> = serde_json::from_str(&content).ok();
660        Err(Error::ResponseError(ResponseContent { status, content, entity }))
661    }
662}
663
664/// Returns the caller org's fundraising rounds, newest first. A round groups a fundraising event; a PRICED round also carries the share class and price per share it issues at.
665pub async fn get_captable_rounds(configuration: &configuration::Configuration, ) -> Result<models::CaptableRounds, Error<GetCaptableRoundsError>> {
666
667    let uri_str = format!("{}/v1/captable/rounds", configuration.base_path);
668    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
669
670    if let Some(ref user_agent) = configuration.user_agent {
671        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
672    }
673    if let Some(ref token) = configuration.bearer_access_token {
674        req_builder = req_builder.bearer_auth(token.to_owned());
675    };
676
677    let req = req_builder.build()?;
678    let resp = configuration.client.execute(req).await?;
679
680    let status = resp.status();
681    let content_type = resp
682        .headers()
683        .get("content-type")
684        .and_then(|v| v.to_str().ok())
685        .unwrap_or("application/octet-stream");
686    let content_type = super::ContentType::from(content_type);
687
688    if !status.is_client_error() && !status.is_server_error() {
689        let content = resp.text().await?;
690        match content_type {
691            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
692            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableRounds`"))),
693            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::CaptableRounds`")))),
694        }
695    } else {
696        let content = resp.text().await?;
697        let entity: Option<GetCaptableRoundsError> = serde_json::from_str(&content).ok();
698        Err(Error::ResponseError(ResponseContent { status, content, entity }))
699    }
700}
701
702/// Returns one of the caller org's fundraising rounds together with every investment written into it, oldest first. A round id that does not exist in the caller's org is not found — including one that exists in another tenant, since the org comes from the caller's principal and is part of the lookup.
703pub async fn get_captable_rounds_by_id(configuration: &configuration::Configuration, id: &str) -> Result<models::CaptableRoundDetail, Error<GetCaptableRoundsByIdError>> {
704    // add a prefix to parameters to efficiently prevent name collisions
705    let p_id = id;
706
707    let uri_str = format!("{}/v1/captable/rounds/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
708    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
709
710    if let Some(ref user_agent) = configuration.user_agent {
711        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
712    }
713    if let Some(ref token) = configuration.bearer_access_token {
714        req_builder = req_builder.bearer_auth(token.to_owned());
715    };
716
717    let req = req_builder.build()?;
718    let resp = configuration.client.execute(req).await?;
719
720    let status = resp.status();
721    let content_type = resp
722        .headers()
723        .get("content-type")
724        .and_then(|v| v.to_str().ok())
725        .unwrap_or("application/octet-stream");
726    let content_type = super::ContentType::from(content_type);
727
728    if !status.is_client_error() && !status.is_server_error() {
729        let content = resp.text().await?;
730        match content_type {
731            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
732            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableRoundDetail`"))),
733            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::CaptableRoundDetail`")))),
734        }
735    } else {
736        let content = resp.text().await?;
737        let entity: Option<GetCaptableRoundsByIdError> = serde_json::from_str(&content).ok();
738        Err(Error::ResponseError(ResponseContent { status, content, entity }))
739    }
740}
741
742/// Returns the caller org's SAFEs, newest first. A SAFE is a simple agreement for future equity: its capital sits OUTSIDE issued equity until it converts, so it is not part of the share counts.
743pub async fn get_captable_safes(configuration: &configuration::Configuration, ) -> Result<models::CaptableSafes, Error<GetCaptableSafesError>> {
744
745    let uri_str = format!("{}/v1/captable/safes", configuration.base_path);
746    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
747
748    if let Some(ref user_agent) = configuration.user_agent {
749        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
750    }
751    if let Some(ref token) = configuration.bearer_access_token {
752        req_builder = req_builder.bearer_auth(token.to_owned());
753    };
754
755    let req = req_builder.build()?;
756    let resp = configuration.client.execute(req).await?;
757
758    let status = resp.status();
759    let content_type = resp
760        .headers()
761        .get("content-type")
762        .and_then(|v| v.to_str().ok())
763        .unwrap_or("application/octet-stream");
764    let content_type = super::ContentType::from(content_type);
765
766    if !status.is_client_error() && !status.is_server_error() {
767        let content = resp.text().await?;
768        match content_type {
769            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
770            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableSafes`"))),
771            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::CaptableSafes`")))),
772        }
773    } else {
774        let content = resp.text().await?;
775        let entity: Option<GetCaptableSafesError> = serde_json::from_str(&content).ok();
776        Err(Error::ResponseError(ResponseContent { status, content, entity }))
777    }
778}
779
780/// Returns the caller org's share certificates, newest first. Each row is joined to its holder and its share class, so a certificate names who holds it and what class it is in without a second call.
781pub async fn get_captable_shares(configuration: &configuration::Configuration, ) -> Result<models::CaptableShares, Error<GetCaptableSharesError>> {
782
783    let uri_str = format!("{}/v1/captable/shares", configuration.base_path);
784    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
785
786    if let Some(ref user_agent) = configuration.user_agent {
787        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
788    }
789    if let Some(ref token) = configuration.bearer_access_token {
790        req_builder = req_builder.bearer_auth(token.to_owned());
791    };
792
793    let req = req_builder.build()?;
794    let resp = configuration.client.execute(req).await?;
795
796    let status = resp.status();
797    let content_type = resp
798        .headers()
799        .get("content-type")
800        .and_then(|v| v.to_str().ok())
801        .unwrap_or("application/octet-stream");
802    let content_type = super::ContentType::from(content_type);
803
804    if !status.is_client_error() && !status.is_server_error() {
805        let content = resp.text().await?;
806        match content_type {
807            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
808            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableShares`"))),
809            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::CaptableShares`")))),
810        }
811    } else {
812        let content = resp.text().await?;
813        let entity: Option<GetCaptableSharesError> = serde_json::from_str(&content).ok();
814        Err(Error::ResponseError(ResponseContent { status, content, entity }))
815    }
816}
817
818/// Returns the caller org's stakeholders, newest first. The response is a bare JSON array, not an envelope. Each row carries the holder's contact and address fields alongside the company's name.
819pub async fn get_captable_stakeholders(configuration: &configuration::Configuration, ) -> Result<Vec<models::CaptableStakeholder>, Error<GetCaptableStakeholdersError>> {
820
821    let uri_str = format!("{}/v1/captable/stakeholders", configuration.base_path);
822    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
823
824    if let Some(ref user_agent) = configuration.user_agent {
825        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
826    }
827    if let Some(ref token) = configuration.bearer_access_token {
828        req_builder = req_builder.bearer_auth(token.to_owned());
829    };
830
831    let req = req_builder.build()?;
832    let resp = configuration.client.execute(req).await?;
833
834    let status = resp.status();
835    let content_type = resp
836        .headers()
837        .get("content-type")
838        .and_then(|v| v.to_str().ok())
839        .unwrap_or("application/octet-stream");
840    let content_type = super::ContentType::from(content_type);
841
842    if !status.is_client_error() && !status.is_server_error() {
843        let content = resp.text().await?;
844        match content_type {
845            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
846            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::CaptableStakeholder&gt;`"))),
847            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::CaptableStakeholder&gt;`")))),
848        }
849    } else {
850        let content = resp.text().await?;
851        let entity: Option<GetCaptableStakeholdersError> = serde_json::from_str(&content).ok();
852        Err(Error::ResponseError(ResponseContent { status, content, entity }))
853    }
854}
855
856/// Computes the caller org's cap table. It answers who owns what on a fully-diluted basis: outstanding shares, granted options, per-stakeholder ownership percentages, each share class's authorized versus issued position, and the capital sitting on SAFEs and convertible notes that have not yet converted. Only non-terminal option grants dilute — EXERCISED, EXPIRED and CANCELLED grants are excluded, so equity issued through an exercised option is never counted twice.
857pub async fn get_captable_summary(configuration: &configuration::Configuration, ) -> Result<models::CaptableSummary, Error<GetCaptableSummaryError>> {
858
859    let uri_str = format!("{}/v1/captable/summary", configuration.base_path);
860    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
861
862    if let Some(ref user_agent) = configuration.user_agent {
863        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
864    }
865    if let Some(ref token) = configuration.bearer_access_token {
866        req_builder = req_builder.bearer_auth(token.to_owned());
867    };
868
869    let req = req_builder.build()?;
870    let resp = configuration.client.execute(req).await?;
871
872    let status = resp.status();
873    let content_type = resp
874        .headers()
875        .get("content-type")
876        .and_then(|v| v.to_str().ok())
877        .unwrap_or("application/octet-stream");
878    let content_type = super::ContentType::from(content_type);
879
880    if !status.is_client_error() && !status.is_server_error() {
881        let content = resp.text().await?;
882        match content_type {
883            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
884            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableSummary`"))),
885            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::CaptableSummary`")))),
886        }
887    } else {
888        let content = resp.text().await?;
889        let entity: Option<GetCaptableSummaryError> = serde_json::from_str(&content).ok();
890        Err(Error::ResponseError(ResponseContent { status, content, entity }))
891    }
892}
893
894/// Replaces one share class's terms.  It is a full REPLACE and not a merge, despite the PATCH: every field is written as sent, so a field omitted is written empty rather than left alone. Send the whole class. The method is PATCH because the resource is addressed by id, not because the body is partial — and getting that backwards silently blanks terms every later issuance prices against.
895pub async fn patch_captable_classes_by_id(configuration: &configuration::Configuration, id: &str, captable_share_class_amend: models::CaptableShareClassAmend) -> Result<models::CaptableUpdated, Error<PatchCaptableClassesByIdError>> {
896    // add a prefix to parameters to efficiently prevent name collisions
897    let p_id = id;
898    let p_captable_share_class_amend = captable_share_class_amend;
899
900    let uri_str = format!("{}/v1/captable/classes/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
901    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
902
903    if let Some(ref user_agent) = configuration.user_agent {
904        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
905    }
906    if let Some(ref token) = configuration.bearer_access_token {
907        req_builder = req_builder.bearer_auth(token.to_owned());
908    };
909    req_builder = req_builder.json(&p_captable_share_class_amend);
910
911    let req = req_builder.build()?;
912    let resp = configuration.client.execute(req).await?;
913
914    let status = resp.status();
915    let content_type = resp
916        .headers()
917        .get("content-type")
918        .and_then(|v| v.to_str().ok())
919        .unwrap_or("application/octet-stream");
920    let content_type = super::ContentType::from(content_type);
921
922    if !status.is_client_error() && !status.is_server_error() {
923        let content = resp.text().await?;
924        match content_type {
925            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
926            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableUpdated`"))),
927            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::CaptableUpdated`")))),
928        }
929    } else {
930        let content = resp.text().await?;
931        let entity: Option<PatchCaptableClassesByIdError> = serde_json::from_str(&content).ok();
932        Err(Error::ResponseError(ResponseContent { status, content, entity }))
933    }
934}
935
936/// Changes one of the caller org's stakeholders. It is a PARTIAL update: only the fields the request names are written, and a field sent as null clears that column. A request that names no updatable field is refused, and an id this org does not hold is not found.  The values are stored as sent. Unlike adding a stakeholder, this route does not check the email's shape or the type and relationship vocabularies, so it can record a value that adding one would have rejected.
937pub async fn patch_captable_stakeholders_by_id(configuration: &configuration::Configuration, id: &str, captable_stakeholder_patch: models::CaptableStakeholderPatch) -> Result<models::CaptableUpdated, Error<PatchCaptableStakeholdersByIdError>> {
938    // add a prefix to parameters to efficiently prevent name collisions
939    let p_id = id;
940    let p_captable_stakeholder_patch = captable_stakeholder_patch;
941
942    let uri_str = format!("{}/v1/captable/stakeholders/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
943    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
944
945    if let Some(ref user_agent) = configuration.user_agent {
946        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
947    }
948    if let Some(ref token) = configuration.bearer_access_token {
949        req_builder = req_builder.bearer_auth(token.to_owned());
950    };
951    req_builder = req_builder.json(&p_captable_stakeholder_patch);
952
953    let req = req_builder.build()?;
954    let resp = configuration.client.execute(req).await?;
955
956    let status = resp.status();
957    let content_type = resp
958        .headers()
959        .get("content-type")
960        .and_then(|v| v.to_str().ok())
961        .unwrap_or("application/octet-stream");
962    let content_type = super::ContentType::from(content_type);
963
964    if !status.is_client_error() && !status.is_server_error() {
965        let content = resp.text().await?;
966        match content_type {
967            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
968            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableUpdated`"))),
969            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::CaptableUpdated`")))),
970        }
971    } else {
972        let content = resp.text().await?;
973        let entity: Option<PatchCaptableStakeholdersByIdError> = serde_json::from_str(&content).ok();
974        Err(Error::ResponseError(ResponseContent { status, content, entity }))
975    }
976}
977
978/// Defines a new class of shares.  Every field but convertsToShareClassId is required — a class is the instrument every later issuance prices against, so a partially-specified one would silently mis-value every share issued into it. `seniority` orders liquidation preference with LOWER first.
979pub async fn post_captable_classes(configuration: &configuration::Configuration, captable_share_class_in: models::CaptableShareClassIn) -> Result<models::CaptableCreated, Error<PostCaptableClassesError>> {
980    // add a prefix to parameters to efficiently prevent name collisions
981    let p_captable_share_class_in = captable_share_class_in;
982
983    let uri_str = format!("{}/v1/captable/classes", configuration.base_path);
984    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
985
986    if let Some(ref user_agent) = configuration.user_agent {
987        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
988    }
989    if let Some(ref token) = configuration.bearer_access_token {
990        req_builder = req_builder.bearer_auth(token.to_owned());
991    };
992    req_builder = req_builder.json(&p_captable_share_class_in);
993
994    let req = req_builder.build()?;
995    let resp = configuration.client.execute(req).await?;
996
997    let status = resp.status();
998    let content_type = resp
999        .headers()
1000        .get("content-type")
1001        .and_then(|v| v.to_str().ok())
1002        .unwrap_or("application/octet-stream");
1003    let content_type = super::ContentType::from(content_type);
1004
1005    if !status.is_client_error() && !status.is_server_error() {
1006        let content = resp.text().await?;
1007        match content_type {
1008            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1009            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableCreated`"))),
1010            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::CaptableCreated`")))),
1011        }
1012    } else {
1013        let content = resp.text().await?;
1014        let entity: Option<PostCaptableClassesError> = serde_json::from_str(&content).ok();
1015        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1016    }
1017}
1018
1019/// Records a convertible note.
1020pub async fn post_captable_convertibles(configuration: &configuration::Configuration, captable_convertible_in: models::CaptableConvertibleIn) -> Result<models::CaptableCreated, Error<PostCaptableConvertiblesError>> {
1021    // add a prefix to parameters to efficiently prevent name collisions
1022    let p_captable_convertible_in = captable_convertible_in;
1023
1024    let uri_str = format!("{}/v1/captable/convertibles", configuration.base_path);
1025    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1026
1027    if let Some(ref user_agent) = configuration.user_agent {
1028        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1029    }
1030    if let Some(ref token) = configuration.bearer_access_token {
1031        req_builder = req_builder.bearer_auth(token.to_owned());
1032    };
1033    req_builder = req_builder.json(&p_captable_convertible_in);
1034
1035    let req = req_builder.build()?;
1036    let resp = configuration.client.execute(req).await?;
1037
1038    let status = resp.status();
1039    let content_type = resp
1040        .headers()
1041        .get("content-type")
1042        .and_then(|v| v.to_str().ok())
1043        .unwrap_or("application/octet-stream");
1044    let content_type = super::ContentType::from(content_type);
1045
1046    if !status.is_client_error() && !status.is_server_error() {
1047        let content = resp.text().await?;
1048        match content_type {
1049            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1050            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableCreated`"))),
1051            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::CaptableCreated`")))),
1052        }
1053    } else {
1054        let content = resp.text().await?;
1055        let entity: Option<PostCaptableConvertiblesError> = serde_json::from_str(&content).ok();
1056        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1057    }
1058}
1059
1060/// Grants options to a stakeholder from an equity plan.
1061pub async fn post_captable_options(configuration: &configuration::Configuration, captable_option_in: models::CaptableOptionIn) -> Result<models::CaptableCreated, Error<PostCaptableOptionsError>> {
1062    // add a prefix to parameters to efficiently prevent name collisions
1063    let p_captable_option_in = captable_option_in;
1064
1065    let uri_str = format!("{}/v1/captable/options", configuration.base_path);
1066    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1067
1068    if let Some(ref user_agent) = configuration.user_agent {
1069        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1070    }
1071    if let Some(ref token) = configuration.bearer_access_token {
1072        req_builder = req_builder.bearer_auth(token.to_owned());
1073    };
1074    req_builder = req_builder.json(&p_captable_option_in);
1075
1076    let req = req_builder.build()?;
1077    let resp = configuration.client.execute(req).await?;
1078
1079    let status = resp.status();
1080    let content_type = resp
1081        .headers()
1082        .get("content-type")
1083        .and_then(|v| v.to_str().ok())
1084        .unwrap_or("application/octet-stream");
1085    let content_type = super::ContentType::from(content_type);
1086
1087    if !status.is_client_error() && !status.is_server_error() {
1088        let content = resp.text().await?;
1089        match content_type {
1090            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1091            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableCreated`"))),
1092            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::CaptableCreated`")))),
1093        }
1094    } else {
1095        let content = resp.text().await?;
1096        let entity: Option<PostCaptableOptionsError> = serde_json::from_str(&content).ok();
1097        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1098    }
1099}
1100
1101/// Opens an equity plan that options are granted from.
1102pub async fn post_captable_plans(configuration: &configuration::Configuration, captable_equity_plan_in: models::CaptableEquityPlanIn) -> Result<models::CaptableCreated, Error<PostCaptablePlansError>> {
1103    // add a prefix to parameters to efficiently prevent name collisions
1104    let p_captable_equity_plan_in = captable_equity_plan_in;
1105
1106    let uri_str = format!("{}/v1/captable/plans", configuration.base_path);
1107    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1108
1109    if let Some(ref user_agent) = configuration.user_agent {
1110        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1111    }
1112    if let Some(ref token) = configuration.bearer_access_token {
1113        req_builder = req_builder.bearer_auth(token.to_owned());
1114    };
1115    req_builder = req_builder.json(&p_captable_equity_plan_in);
1116
1117    let req = req_builder.build()?;
1118    let resp = configuration.client.execute(req).await?;
1119
1120    let status = resp.status();
1121    let content_type = resp
1122        .headers()
1123        .get("content-type")
1124        .and_then(|v| v.to_str().ok())
1125        .unwrap_or("application/octet-stream");
1126    let content_type = super::ContentType::from(content_type);
1127
1128    if !status.is_client_error() && !status.is_server_error() {
1129        let content = resp.text().await?;
1130        match content_type {
1131            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1132            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableCreated`"))),
1133            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::CaptableCreated`")))),
1134        }
1135    } else {
1136        let content = resp.text().await?;
1137        let entity: Option<PostCaptablePlansError> = serde_json::from_str(&content).ok();
1138        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1139    }
1140}
1141
1142/// Opens a priced round that investments can be added to.  The round opens OPEN; investing into a closed one is refused.
1143pub async fn post_captable_rounds(configuration: &configuration::Configuration, captable_round_in: models::CaptableRoundIn) -> Result<models::CaptableCreated, Error<PostCaptableRoundsError>> {
1144    // add a prefix to parameters to efficiently prevent name collisions
1145    let p_captable_round_in = captable_round_in;
1146
1147    let uri_str = format!("{}/v1/captable/rounds", configuration.base_path);
1148    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1149
1150    if let Some(ref user_agent) = configuration.user_agent {
1151        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1152    }
1153    if let Some(ref token) = configuration.bearer_access_token {
1154        req_builder = req_builder.bearer_auth(token.to_owned());
1155    };
1156    req_builder = req_builder.json(&p_captable_round_in);
1157
1158    let req = req_builder.build()?;
1159    let resp = configuration.client.execute(req).await?;
1160
1161    let status = resp.status();
1162    let content_type = resp
1163        .headers()
1164        .get("content-type")
1165        .and_then(|v| v.to_str().ok())
1166        .unwrap_or("application/octet-stream");
1167    let content_type = super::ContentType::from(content_type);
1168
1169    if !status.is_client_error() && !status.is_server_error() {
1170        let content = resp.text().await?;
1171        match content_type {
1172            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1173            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableCreated`"))),
1174            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::CaptableCreated`")))),
1175        }
1176    } else {
1177        let content = resp.text().await?;
1178        let entity: Option<PostCaptableRoundsError> = serde_json::from_str(&content).ok();
1179        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1180    }
1181}
1182
1183/// Closes one of the caller org's fundraising rounds, recording the close date and moving its status to CLOSED. Only an OPEN round can be closed: a round that is already closed — like an id this org does not hold — is not found. Closing a round does not change what was invested in it.
1184pub async fn post_captable_rounds_by_id_close(configuration: &configuration::Configuration, id: &str, captable_round_close_request: models::CaptableRoundCloseRequest) -> Result<models::CaptableUpdated, Error<PostCaptableRoundsByIdCloseError>> {
1185    // add a prefix to parameters to efficiently prevent name collisions
1186    let p_id = id;
1187    let p_captable_round_close_request = captable_round_close_request;
1188
1189    let uri_str = format!("{}/v1/captable/rounds/{id}/close", configuration.base_path, id=crate::apis::urlencode(p_id));
1190    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1191
1192    if let Some(ref user_agent) = configuration.user_agent {
1193        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1194    }
1195    if let Some(ref token) = configuration.bearer_access_token {
1196        req_builder = req_builder.bearer_auth(token.to_owned());
1197    };
1198    req_builder = req_builder.json(&p_captable_round_close_request);
1199
1200    let req = req_builder.build()?;
1201    let resp = configuration.client.execute(req).await?;
1202
1203    let status = resp.status();
1204    let content_type = resp
1205        .headers()
1206        .get("content-type")
1207        .and_then(|v| v.to_str().ok())
1208        .unwrap_or("application/octet-stream");
1209    let content_type = super::ContentType::from(content_type);
1210
1211    if !status.is_client_error() && !status.is_server_error() {
1212        let content = resp.text().await?;
1213        match content_type {
1214            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1215            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableUpdated`"))),
1216            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::CaptableUpdated`")))),
1217        }
1218    } else {
1219        let content = resp.text().await?;
1220        let entity: Option<PostCaptableRoundsByIdCloseError> = serde_json::from_str(&content).ok();
1221        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1222    }
1223}
1224
1225/// Records one investor's money into an open round.  The round must be OPEN; investing into a closed one is refused. Where the round carries a price per share, the investment also issues the shares it buys and the answer names them.
1226pub async fn post_captable_rounds_by_id_investments(configuration: &configuration::Configuration, id: &str, captable_investment_in: models::CaptableInvestmentIn) -> Result<models::CaptableInvested, Error<PostCaptableRoundsByIdInvestmentsError>> {
1227    // add a prefix to parameters to efficiently prevent name collisions
1228    let p_id = id;
1229    let p_captable_investment_in = captable_investment_in;
1230
1231    let uri_str = format!("{}/v1/captable/rounds/{id}/investments", configuration.base_path, id=crate::apis::urlencode(p_id));
1232    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1233
1234    if let Some(ref user_agent) = configuration.user_agent {
1235        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1236    }
1237    if let Some(ref token) = configuration.bearer_access_token {
1238        req_builder = req_builder.bearer_auth(token.to_owned());
1239    };
1240    req_builder = req_builder.json(&p_captable_investment_in);
1241
1242    let req = req_builder.build()?;
1243    let resp = configuration.client.execute(req).await?;
1244
1245    let status = resp.status();
1246    let content_type = resp
1247        .headers()
1248        .get("content-type")
1249        .and_then(|v| v.to_str().ok())
1250        .unwrap_or("application/octet-stream");
1251    let content_type = super::ContentType::from(content_type);
1252
1253    if !status.is_client_error() && !status.is_server_error() {
1254        let content = resp.text().await?;
1255        match content_type {
1256            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1257            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableInvested`"))),
1258            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::CaptableInvested`")))),
1259        }
1260    } else {
1261        let content = resp.text().await?;
1262        let entity: Option<PostCaptableRoundsByIdInvestmentsError> = serde_json::from_str(&content).ok();
1263        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1264    }
1265}
1266
1267/// Records a SAFE — a simple agreement for future equity.
1268pub async fn post_captable_safes(configuration: &configuration::Configuration, captable_safe_in: models::CaptableSafeIn) -> Result<models::CaptableCreated, Error<PostCaptableSafesError>> {
1269    // add a prefix to parameters to efficiently prevent name collisions
1270    let p_captable_safe_in = captable_safe_in;
1271
1272    let uri_str = format!("{}/v1/captable/safes", configuration.base_path);
1273    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1274
1275    if let Some(ref user_agent) = configuration.user_agent {
1276        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1277    }
1278    if let Some(ref token) = configuration.bearer_access_token {
1279        req_builder = req_builder.bearer_auth(token.to_owned());
1280    };
1281    req_builder = req_builder.json(&p_captable_safe_in);
1282
1283    let req = req_builder.build()?;
1284    let resp = configuration.client.execute(req).await?;
1285
1286    let status = resp.status();
1287    let content_type = resp
1288        .headers()
1289        .get("content-type")
1290        .and_then(|v| v.to_str().ok())
1291        .unwrap_or("application/octet-stream");
1292    let content_type = super::ContentType::from(content_type);
1293
1294    if !status.is_client_error() && !status.is_server_error() {
1295        let content = resp.text().await?;
1296        match content_type {
1297            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1298            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableCreated`"))),
1299            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::CaptableCreated`")))),
1300        }
1301    } else {
1302        let content = resp.text().await?;
1303        let entity: Option<PostCaptableSafesError> = serde_json::from_str(&content).ok();
1304        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1305    }
1306}
1307
1308/// Issues a share certificate to a stakeholder.  The certificate id must be UNIQUE within the company — a duplicate is refused 409, not silently merged — and both the stakeholder and the share class must belong to this company, so an id from another tenant is a 400 rather than a cross-company issuance.
1309pub async fn post_captable_shares(configuration: &configuration::Configuration, captable_share_in: models::CaptableShareIn) -> Result<models::CaptableCreated, Error<PostCaptableSharesError>> {
1310    // add a prefix to parameters to efficiently prevent name collisions
1311    let p_captable_share_in = captable_share_in;
1312
1313    let uri_str = format!("{}/v1/captable/shares", configuration.base_path);
1314    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1315
1316    if let Some(ref user_agent) = configuration.user_agent {
1317        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1318    }
1319    if let Some(ref token) = configuration.bearer_access_token {
1320        req_builder = req_builder.bearer_auth(token.to_owned());
1321    };
1322    req_builder = req_builder.json(&p_captable_share_in);
1323
1324    let req = req_builder.build()?;
1325    let resp = configuration.client.execute(req).await?;
1326
1327    let status = resp.status();
1328    let content_type = resp
1329        .headers()
1330        .get("content-type")
1331        .and_then(|v| v.to_str().ok())
1332        .unwrap_or("application/octet-stream");
1333    let content_type = super::ContentType::from(content_type);
1334
1335    if !status.is_client_error() && !status.is_server_error() {
1336        let content = resp.text().await?;
1337        match content_type {
1338            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1339            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableCreated`"))),
1340            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::CaptableCreated`")))),
1341        }
1342    } else {
1343        let content = resp.text().await?;
1344        let entity: Option<PostCaptableSharesError> = serde_json::from_str(&content).ok();
1345        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1346    }
1347}
1348
1349/// Moves shares from one stakeholder to another.  Omit `quantity` to transfer the whole certificate, which REASSIGNS it and mints no new share. Send a quantity below the amount held to SPLIT it — the source certificate keeps the remainder, and a split additionally requires `certificateId` for the new certificate, which must be unique in the company. A quantity outside 1..held is refused, so a transfer can never over-issue.  Both outcomes answer 200: a transfer records a movement between holders and mints no security of its own, which is why this is not a 201 the way an investment is.
1350pub async fn post_captable_shares_transfer(configuration: &configuration::Configuration, captable_share_transfer: models::CaptableShareTransfer) -> Result<models::CaptableTransferred, Error<PostCaptableSharesTransferError>> {
1351    // add a prefix to parameters to efficiently prevent name collisions
1352    let p_captable_share_transfer = captable_share_transfer;
1353
1354    let uri_str = format!("{}/v1/captable/shares/transfer", configuration.base_path);
1355    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1356
1357    if let Some(ref user_agent) = configuration.user_agent {
1358        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1359    }
1360    if let Some(ref token) = configuration.bearer_access_token {
1361        req_builder = req_builder.bearer_auth(token.to_owned());
1362    };
1363    req_builder = req_builder.json(&p_captable_share_transfer);
1364
1365    let req = req_builder.build()?;
1366    let resp = configuration.client.execute(req).await?;
1367
1368    let status = resp.status();
1369    let content_type = resp
1370        .headers()
1371        .get("content-type")
1372        .and_then(|v| v.to_str().ok())
1373        .unwrap_or("application/octet-stream");
1374    let content_type = super::ContentType::from(content_type);
1375
1376    if !status.is_client_error() && !status.is_server_error() {
1377        let content = resp.text().await?;
1378        match content_type {
1379            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1380            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableTransferred`"))),
1381            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::CaptableTransferred`")))),
1382        }
1383    } else {
1384        let content = resp.text().await?;
1385        let entity: Option<PostCaptableSharesTransferError> = serde_json::from_str(&content).ok();
1386        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1387    }
1388}
1389
1390/// Records the people and institutions that can hold equity — the rows every share, option, SAFE, note and investment is issued to.  The body is ONE stakeholder object or an ARRAY of them, and the array is the point: a whole roster loads in a single call. Email is the identity within the company, so a stakeholder whose email is already on the table is SKIPPED rather than duplicated or rejected — the 201 reports how many rows were actually inserted, which is what makes re-running an import safe. Validation is all-or-nothing across the batch: one bad entry refuses the whole array.  Writes the caller's OWN cap table: the org resolved from the validated principal selects the tenant's store and scopes every row, so there is no field by which a caller can write into another company's table; a request with no validated org is refused. The whole write runs in one transaction, so a refusal leaves nothing behind. Validation is the cap-table bundle's and so is its refusal: a bad body comes back as {success:false, message, errors:[…]} with the failing fields listed, and numeric fields accept a number OR a numeric string. Bodies are capped at 1 MiB.
1391pub async fn post_captable_stakeholders(configuration: &configuration::Configuration, ) -> Result<(), Error<PostCaptableStakeholdersError>> {
1392
1393    let uri_str = format!("{}/v1/captable/stakeholders", configuration.base_path);
1394    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1395
1396    if let Some(ref user_agent) = configuration.user_agent {
1397        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1398    }
1399    if let Some(ref token) = configuration.bearer_access_token {
1400        req_builder = req_builder.bearer_auth(token.to_owned());
1401    };
1402
1403    let req = req_builder.build()?;
1404    let resp = configuration.client.execute(req).await?;
1405
1406    let status = resp.status();
1407
1408    if !status.is_client_error() && !status.is_server_error() {
1409        Ok(())
1410    } else {
1411        let content = resp.text().await?;
1412        let entity: Option<PostCaptableStakeholdersError> = serde_json::from_str(&content).ok();
1413        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1414    }
1415}
1416
1417/// Sets the caller org's company name and incorporation details. The name is required; the three incorporation fields are optional and each is stored as empty when omitted, so a call that sends only a name CLEARS them. The company row itself is seeded when the tenant's store first opens, so this never creates one.
1418pub async fn put_captable_company(configuration: &configuration::Configuration, captable_company_update: models::CaptableCompanyUpdate) -> Result<models::CaptableUpdated, Error<PutCaptableCompanyError>> {
1419    // add a prefix to parameters to efficiently prevent name collisions
1420    let p_captable_company_update = captable_company_update;
1421
1422    let uri_str = format!("{}/v1/captable/company", configuration.base_path);
1423    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1424
1425    if let Some(ref user_agent) = configuration.user_agent {
1426        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1427    }
1428    if let Some(ref token) = configuration.bearer_access_token {
1429        req_builder = req_builder.bearer_auth(token.to_owned());
1430    };
1431    req_builder = req_builder.json(&p_captable_company_update);
1432
1433    let req = req_builder.build()?;
1434    let resp = configuration.client.execute(req).await?;
1435
1436    let status = resp.status();
1437    let content_type = resp
1438        .headers()
1439        .get("content-type")
1440        .and_then(|v| v.to_str().ok())
1441        .unwrap_or("application/octet-stream");
1442    let content_type = super::ContentType::from(content_type);
1443
1444    if !status.is_client_error() && !status.is_server_error() {
1445        let content = resp.text().await?;
1446        match content_type {
1447            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1448            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CaptableUpdated`"))),
1449            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::CaptableUpdated`")))),
1450        }
1451    } else {
1452        let content = resp.text().await?;
1453        let entity: Option<PutCaptableCompanyError> = serde_json::from_str(&content).ok();
1454        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1455    }
1456}
1457