Skip to main content

hanzo_client/apis/
provisioning_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_provisioning_datastore_by_name`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum DeleteProvisioningDatastoreByNameError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`delete_provisioning_docdb_by_name`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum DeleteProvisioningDocdbByNameError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`delete_provisioning_kv_by_name`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum DeleteProvisioningKvByNameError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`delete_provisioning_s3_by_name`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum DeleteProvisioningS3ByNameError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`delete_provisioning_search_by_name`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum DeleteProvisioningSearchByNameError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`delete_provisioning_sql_by_name`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum DeleteProvisioningSqlByNameError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`delete_provisioning_vector_by_name`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum DeleteProvisioningVectorByNameError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`get_provisioning_datastore`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetProvisioningDatastoreError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`get_provisioning_datastore_by_name`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetProvisioningDatastoreByNameError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`get_provisioning_docdb`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetProvisioningDocdbError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`get_provisioning_docdb_by_name`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetProvisioningDocdbByNameError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`get_provisioning_kv`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetProvisioningKvError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`get_provisioning_kv_by_name`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum GetProvisioningKvByNameError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`get_provisioning_s3`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum GetProvisioningS3Error {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`get_provisioning_s3_by_name`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum GetProvisioningS3ByNameError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`get_provisioning_search`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetProvisioningSearchError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`get_provisioning_search_by_name`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum GetProvisioningSearchByNameError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`get_provisioning_sql`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum GetProvisioningSqlError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`get_provisioning_sql_by_name`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum GetProvisioningSqlByNameError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`get_provisioning_vector`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum GetProvisioningVectorError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`get_provisioning_vector_by_name`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum GetProvisioningVectorByNameError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`post_provisioning_datastore`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum PostProvisioningDatastoreError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`post_provisioning_docdb`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum PostProvisioningDocdbError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`post_provisioning_kv`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum PostProvisioningKvError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`post_provisioning_s3`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum PostProvisioningS3Error {
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`post_provisioning_search`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum PostProvisioningSearchError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`post_provisioning_sql`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum PostProvisioningSqlError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`post_provisioning_vector`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum PostProvisioningVectorError {
211    UnknownValue(serde_json::Value),
212}
213
214
215/// Deprovisions one Hanzo Datastore warehouse. It reverts any app instance bound to it back to Base BEFORE tearing down the org's dedicated instance, then deletes the sealed credential and removes the metadata row. Answers 204 with no body; a second call is a 404.
216pub async fn delete_provisioning_datastore_by_name(configuration: &configuration::Configuration, name: &str) -> Result<(), Error<DeleteProvisioningDatastoreByNameError>> {
217    // add a prefix to parameters to efficiently prevent name collisions
218    let p_name = name;
219
220    let uri_str = format!("{}/v1/provisioning/datastore/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
221    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
222
223    if let Some(ref user_agent) = configuration.user_agent {
224        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
225    }
226    if let Some(ref token) = configuration.bearer_access_token {
227        req_builder = req_builder.bearer_auth(token.to_owned());
228    };
229
230    let req = req_builder.build()?;
231    let resp = configuration.client.execute(req).await?;
232
233    let status = resp.status();
234
235    if !status.is_client_error() && !status.is_server_error() {
236        Ok(())
237    } else {
238        let content = resp.text().await?;
239        let entity: Option<DeleteProvisioningDatastoreByNameError> = serde_json::from_str(&content).ok();
240        Err(Error::ResponseError(ResponseContent { status, content, entity }))
241    }
242}
243
244/// DropDocDB deprovisions one Hanzo DocDB database. It reverts any app instance bound to it back to Base BEFORE tearing down the org's dedicated FerretDB instance, then deletes the sealed credential and removes the metadata row. Answers 204 with no body; a second call is a 404.
245pub async fn delete_provisioning_docdb_by_name(configuration: &configuration::Configuration, name: &str) -> Result<(), Error<DeleteProvisioningDocdbByNameError>> {
246    // add a prefix to parameters to efficiently prevent name collisions
247    let p_name = name;
248
249    let uri_str = format!("{}/v1/provisioning/docdb/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
250    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
251
252    if let Some(ref user_agent) = configuration.user_agent {
253        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
254    }
255    if let Some(ref token) = configuration.bearer_access_token {
256        req_builder = req_builder.bearer_auth(token.to_owned());
257    };
258
259    let req = req_builder.build()?;
260    let resp = configuration.client.execute(req).await?;
261
262    let status = resp.status();
263
264    if !status.is_client_error() && !status.is_server_error() {
265        Ok(())
266    } else {
267        let content = resp.text().await?;
268        let entity: Option<DeleteProvisioningDocdbByNameError> = serde_json::from_str(&content).ok();
269        Err(Error::ResponseError(ResponseContent { status, content, entity }))
270    }
271}
272
273/// DropKV deprovisions one Hanzo KV store. It reverts any app instance bound to it back to Base BEFORE tearing down the org's dedicated Valkey instance, then deletes the sealed credential and removes the metadata row. Answers 204 with no body; a second call is a 404.
274pub async fn delete_provisioning_kv_by_name(configuration: &configuration::Configuration, name: &str) -> Result<(), Error<DeleteProvisioningKvByNameError>> {
275    // add a prefix to parameters to efficiently prevent name collisions
276    let p_name = name;
277
278    let uri_str = format!("{}/v1/provisioning/kv/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
279    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
280
281    if let Some(ref user_agent) = configuration.user_agent {
282        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
283    }
284    if let Some(ref token) = configuration.bearer_access_token {
285        req_builder = req_builder.bearer_auth(token.to_owned());
286    };
287
288    let req = req_builder.build()?;
289    let resp = configuration.client.execute(req).await?;
290
291    let status = resp.status();
292
293    if !status.is_client_error() && !status.is_server_error() {
294        Ok(())
295    } else {
296        let content = resp.text().await?;
297        let entity: Option<DeleteProvisioningKvByNameError> = serde_json::from_str(&content).ok();
298        Err(Error::ResponseError(ResponseContent { status, content, entity }))
299    }
300}
301
302/// Deletes one bucket from the shared object store and removes its metadata row. Answers 204 with no body; a second call is a 404.
303pub async fn delete_provisioning_s3_by_name(configuration: &configuration::Configuration, name: &str) -> Result<(), Error<DeleteProvisioningS3ByNameError>> {
304    // add a prefix to parameters to efficiently prevent name collisions
305    let p_name = name;
306
307    let uri_str = format!("{}/v1/provisioning/s3/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
308    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
309
310    if let Some(ref user_agent) = configuration.user_agent {
311        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
312    }
313    if let Some(ref token) = configuration.bearer_access_token {
314        req_builder = req_builder.bearer_auth(token.to_owned());
315    };
316
317    let req = req_builder.build()?;
318    let resp = configuration.client.execute(req).await?;
319
320    let status = resp.status();
321
322    if !status.is_client_error() && !status.is_server_error() {
323        Ok(())
324    } else {
325        let content = resp.text().await?;
326        let entity: Option<DeleteProvisioningS3ByNameError> = serde_json::from_str(&content).ok();
327        Err(Error::ResponseError(ResponseContent { status, content, entity }))
328    }
329}
330
331/// Deletes one search index from the shared backend and removes its metadata row. Answers 204 with no body; a second call is a 404.
332pub async fn delete_provisioning_search_by_name(configuration: &configuration::Configuration, name: &str) -> Result<(), Error<DeleteProvisioningSearchByNameError>> {
333    // add a prefix to parameters to efficiently prevent name collisions
334    let p_name = name;
335
336    let uri_str = format!("{}/v1/provisioning/search/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
337    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
338
339    if let Some(ref user_agent) = configuration.user_agent {
340        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
341    }
342    if let Some(ref token) = configuration.bearer_access_token {
343        req_builder = req_builder.bearer_auth(token.to_owned());
344    };
345
346    let req = req_builder.build()?;
347    let resp = configuration.client.execute(req).await?;
348
349    let status = resp.status();
350
351    if !status.is_client_error() && !status.is_server_error() {
352        Ok(())
353    } else {
354        let content = resp.text().await?;
355        let entity: Option<DeleteProvisioningSearchByNameError> = serde_json::from_str(&content).ok();
356        Err(Error::ResponseError(ResponseContent { status, content, entity }))
357    }
358}
359
360/// DropSQL deprovisions one Hanzo SQL database. It reverts any app instance bound to it back to Base BEFORE tearing down the org's dedicated Postgres instance — never a live app pointed at a deleted backend — then deletes the sealed credential and removes the metadata row. Answers 204 with no body; a second call is a 404, not a second delete.
361pub async fn delete_provisioning_sql_by_name(configuration: &configuration::Configuration, name: &str) -> Result<(), Error<DeleteProvisioningSqlByNameError>> {
362    // add a prefix to parameters to efficiently prevent name collisions
363    let p_name = name;
364
365    let uri_str = format!("{}/v1/provisioning/sql/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
366    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
367
368    if let Some(ref user_agent) = configuration.user_agent {
369        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
370    }
371    if let Some(ref token) = configuration.bearer_access_token {
372        req_builder = req_builder.bearer_auth(token.to_owned());
373    };
374
375    let req = req_builder.build()?;
376    let resp = configuration.client.execute(req).await?;
377
378    let status = resp.status();
379
380    if !status.is_client_error() && !status.is_server_error() {
381        Ok(())
382    } else {
383        let content = resp.text().await?;
384        let entity: Option<DeleteProvisioningSqlByNameError> = serde_json::from_str(&content).ok();
385        Err(Error::ResponseError(ResponseContent { status, content, entity }))
386    }
387}
388
389/// Deletes one vector collection from the shared backend and removes its metadata row. Answers 204 with no body; a second call is a 404.
390pub async fn delete_provisioning_vector_by_name(configuration: &configuration::Configuration, name: &str) -> Result<(), Error<DeleteProvisioningVectorByNameError>> {
391    // add a prefix to parameters to efficiently prevent name collisions
392    let p_name = name;
393
394    let uri_str = format!("{}/v1/provisioning/vector/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
395    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
396
397    if let Some(ref user_agent) = configuration.user_agent {
398        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
399    }
400    if let Some(ref token) = configuration.bearer_access_token {
401        req_builder = req_builder.bearer_auth(token.to_owned());
402    };
403
404    let req = req_builder.build()?;
405    let resp = configuration.client.execute(req).await?;
406
407    let status = resp.status();
408
409    if !status.is_client_error() && !status.is_server_error() {
410        Ok(())
411    } else {
412        let content = resp.text().await?;
413        let entity: Option<DeleteProvisioningVectorByNameError> = serde_json::from_str(&content).ok();
414        Err(Error::ResponseError(ResponseContent { status, content, entity }))
415    }
416}
417
418/// Lists the caller org's Hanzo Datastore warehouses. Each one is a DEDICATED analytical instance the org alone runs, so the host is that instance's own in-cluster Service and the port is its HTTP port, 8123.
419pub async fn get_provisioning_datastore(configuration: &configuration::Configuration, ) -> Result<Vec<models::ProvisionedSummary>, Error<GetProvisioningDatastoreError>> {
420
421    let uri_str = format!("{}/v1/provisioning/datastore", configuration.base_path);
422    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
423
424    if let Some(ref user_agent) = configuration.user_agent {
425        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
426    }
427    if let Some(ref token) = configuration.bearer_access_token {
428        req_builder = req_builder.bearer_auth(token.to_owned());
429    };
430
431    let req = req_builder.build()?;
432    let resp = configuration.client.execute(req).await?;
433
434    let status = resp.status();
435    let content_type = resp
436        .headers()
437        .get("content-type")
438        .and_then(|v| v.to_str().ok())
439        .unwrap_or("application/octet-stream");
440    let content_type = super::ContentType::from(content_type);
441
442    if !status.is_client_error() && !status.is_server_error() {
443        let content = resp.text().await?;
444        match content_type {
445            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
446            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::ProvisionedSummary&gt;`"))),
447            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::ProvisionedSummary&gt;`")))),
448        }
449    } else {
450        let content = resp.text().await?;
451        let entity: Option<GetProvisioningDatastoreError> = serde_json::from_str(&content).ok();
452        Err(Error::ResponseError(ResponseContent { status, content, entity }))
453    }
454}
455
456/// Returns one Hanzo Datastore warehouse's metadata. It carries the warehouse's status, its instance address and the admin user the instance booted with — never the password. A still-booting instance reads \"provisioning\", reconciled from the operator's live view rather than the row.
457pub async fn get_provisioning_datastore_by_name(configuration: &configuration::Configuration, name: &str) -> Result<models::ProvisionedResource, Error<GetProvisioningDatastoreByNameError>> {
458    // add a prefix to parameters to efficiently prevent name collisions
459    let p_name = name;
460
461    let uri_str = format!("{}/v1/provisioning/datastore/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
462    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
463
464    if let Some(ref user_agent) = configuration.user_agent {
465        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
466    }
467    if let Some(ref token) = configuration.bearer_access_token {
468        req_builder = req_builder.bearer_auth(token.to_owned());
469    };
470
471    let req = req_builder.build()?;
472    let resp = configuration.client.execute(req).await?;
473
474    let status = resp.status();
475    let content_type = resp
476        .headers()
477        .get("content-type")
478        .and_then(|v| v.to_str().ok())
479        .unwrap_or("application/octet-stream");
480    let content_type = super::ContentType::from(content_type);
481
482    if !status.is_client_error() && !status.is_server_error() {
483        let content = resp.text().await?;
484        match content_type {
485            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
486            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProvisionedResource`"))),
487            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::ProvisionedResource`")))),
488        }
489    } else {
490        let content = resp.text().await?;
491        let entity: Option<GetProvisioningDatastoreByNameError> = serde_json::from_str(&content).ok();
492        Err(Error::ResponseError(ResponseContent { status, content, entity }))
493    }
494}
495
496/// ListDocDB lists the caller org's Hanzo DocDB document databases. Each one is a DEDICATED FerretDB instance the org alone runs, speaking the MongoDB wire protocol, so the host is that instance's own in-cluster Service and the port is 27017.
497pub async fn get_provisioning_docdb(configuration: &configuration::Configuration, ) -> Result<Vec<models::ProvisionedSummary>, Error<GetProvisioningDocdbError>> {
498
499    let uri_str = format!("{}/v1/provisioning/docdb", configuration.base_path);
500    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
501
502    if let Some(ref user_agent) = configuration.user_agent {
503        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
504    }
505    if let Some(ref token) = configuration.bearer_access_token {
506        req_builder = req_builder.bearer_auth(token.to_owned());
507    };
508
509    let req = req_builder.build()?;
510    let resp = configuration.client.execute(req).await?;
511
512    let status = resp.status();
513    let content_type = resp
514        .headers()
515        .get("content-type")
516        .and_then(|v| v.to_str().ok())
517        .unwrap_or("application/octet-stream");
518    let content_type = super::ContentType::from(content_type);
519
520    if !status.is_client_error() && !status.is_server_error() {
521        let content = resp.text().await?;
522        match content_type {
523            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
524            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::ProvisionedSummary&gt;`"))),
525            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::ProvisionedSummary&gt;`")))),
526        }
527    } else {
528        let content = resp.text().await?;
529        let entity: Option<GetProvisioningDocdbError> = serde_json::from_str(&content).ok();
530        Err(Error::ResponseError(ResponseContent { status, content, entity }))
531    }
532}
533
534/// GetDocDB returns one Hanzo DocDB database's metadata. It carries the database's status, its instance address and the SCRAM user the instance was set up with — never the password. A still-booting instance reads \"provisioning\", reconciled from the operator's live view.
535pub async fn get_provisioning_docdb_by_name(configuration: &configuration::Configuration, name: &str) -> Result<models::ProvisionedResource, Error<GetProvisioningDocdbByNameError>> {
536    // add a prefix to parameters to efficiently prevent name collisions
537    let p_name = name;
538
539    let uri_str = format!("{}/v1/provisioning/docdb/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
540    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
541
542    if let Some(ref user_agent) = configuration.user_agent {
543        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
544    }
545    if let Some(ref token) = configuration.bearer_access_token {
546        req_builder = req_builder.bearer_auth(token.to_owned());
547    };
548
549    let req = req_builder.build()?;
550    let resp = configuration.client.execute(req).await?;
551
552    let status = resp.status();
553    let content_type = resp
554        .headers()
555        .get("content-type")
556        .and_then(|v| v.to_str().ok())
557        .unwrap_or("application/octet-stream");
558    let content_type = super::ContentType::from(content_type);
559
560    if !status.is_client_error() && !status.is_server_error() {
561        let content = resp.text().await?;
562        match content_type {
563            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
564            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProvisionedResource`"))),
565            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::ProvisionedResource`")))),
566        }
567    } else {
568        let content = resp.text().await?;
569        let entity: Option<GetProvisioningDocdbByNameError> = serde_json::from_str(&content).ok();
570        Err(Error::ResponseError(ResponseContent { status, content, entity }))
571    }
572}
573
574/// ListKV lists the caller org's Hanzo KV stores. Each one is a DEDICATED Valkey instance the org alone runs, so the host is that instance's own in-cluster Service and the port is 6379.
575pub async fn get_provisioning_kv(configuration: &configuration::Configuration, ) -> Result<Vec<models::ProvisionedSummary>, Error<GetProvisioningKvError>> {
576
577    let uri_str = format!("{}/v1/provisioning/kv", configuration.base_path);
578    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
579
580    if let Some(ref user_agent) = configuration.user_agent {
581        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
582    }
583    if let Some(ref token) = configuration.bearer_access_token {
584        req_builder = req_builder.bearer_auth(token.to_owned());
585    };
586
587    let req = req_builder.build()?;
588    let resp = configuration.client.execute(req).await?;
589
590    let status = resp.status();
591    let content_type = resp
592        .headers()
593        .get("content-type")
594        .and_then(|v| v.to_str().ok())
595        .unwrap_or("application/octet-stream");
596    let content_type = super::ContentType::from(content_type);
597
598    if !status.is_client_error() && !status.is_server_error() {
599        let content = resp.text().await?;
600        match content_type {
601            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
602            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::ProvisionedSummary&gt;`"))),
603            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::ProvisionedSummary&gt;`")))),
604        }
605    } else {
606        let content = resp.text().await?;
607        let entity: Option<GetProvisioningKvError> = serde_json::from_str(&content).ok();
608        Err(Error::ResponseError(ResponseContent { status, content, entity }))
609    }
610}
611
612/// GetKV returns one Hanzo KV store's metadata. It carries the store's status, its instance address and the Valkey user it authenticates as (\"default\", the only user a requirepass instance has) — never the password. A still-booting instance reads \"provisioning\", reconciled from the operator's live view.
613pub async fn get_provisioning_kv_by_name(configuration: &configuration::Configuration, name: &str) -> Result<models::ProvisionedResource, Error<GetProvisioningKvByNameError>> {
614    // add a prefix to parameters to efficiently prevent name collisions
615    let p_name = name;
616
617    let uri_str = format!("{}/v1/provisioning/kv/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
618    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
619
620    if let Some(ref user_agent) = configuration.user_agent {
621        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
622    }
623    if let Some(ref token) = configuration.bearer_access_token {
624        req_builder = req_builder.bearer_auth(token.to_owned());
625    };
626
627    let req = req_builder.build()?;
628    let resp = configuration.client.execute(req).await?;
629
630    let status = resp.status();
631    let content_type = resp
632        .headers()
633        .get("content-type")
634        .and_then(|v| v.to_str().ok())
635        .unwrap_or("application/octet-stream");
636    let content_type = super::ContentType::from(content_type);
637
638    if !status.is_client_error() && !status.is_server_error() {
639        let content = resp.text().await?;
640        match content_type {
641            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
642            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProvisionedResource`"))),
643            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::ProvisionedResource`")))),
644        }
645    } else {
646        let content = resp.text().await?;
647        let entity: Option<GetProvisioningKvByNameError> = serde_json::from_str(&content).ok();
648        Err(Error::ResponseError(ResponseContent { status, content, entity }))
649    }
650}
651
652/// Lists the caller org's object-storage buckets. A bucket lives in an already-live shared object store and is reached through the public gateway. The names here are the friendly ones the org provisioned; the physical bucket is org-namespaced underneath, which is what keeps two tenants' buckets distinct.
653pub async fn get_provisioning_s3(configuration: &configuration::Configuration, ) -> Result<Vec<models::ProvisionedSummary>, Error<GetProvisioningS3Error>> {
654
655    let uri_str = format!("{}/v1/provisioning/s3", configuration.base_path);
656    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
657
658    if let Some(ref user_agent) = configuration.user_agent {
659        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
660    }
661    if let Some(ref token) = configuration.bearer_access_token {
662        req_builder = req_builder.bearer_auth(token.to_owned());
663    };
664
665    let req = req_builder.build()?;
666    let resp = configuration.client.execute(req).await?;
667
668    let status = resp.status();
669    let content_type = resp
670        .headers()
671        .get("content-type")
672        .and_then(|v| v.to_str().ok())
673        .unwrap_or("application/octet-stream");
674    let content_type = super::ContentType::from(content_type);
675
676    if !status.is_client_error() && !status.is_server_error() {
677        let content = resp.text().await?;
678        match content_type {
679            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
680            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::ProvisionedSummary&gt;`"))),
681            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::ProvisionedSummary&gt;`")))),
682        }
683    } else {
684        let content = resp.text().await?;
685        let entity: Option<GetProvisioningS3Error> = serde_json::from_str(&content).ok();
686        Err(Error::ResponseError(ResponseContent { status, content, entity }))
687    }
688}
689
690/// Returns one bucket's metadata. It carries the bucket's status and the gateway address it is reached at, and no username: the object store authenticates with a shared, out-of-band key rather than a per-bucket credential.
691pub async fn get_provisioning_s3_by_name(configuration: &configuration::Configuration, name: &str) -> Result<models::ProvisionedResource, Error<GetProvisioningS3ByNameError>> {
692    // add a prefix to parameters to efficiently prevent name collisions
693    let p_name = name;
694
695    let uri_str = format!("{}/v1/provisioning/s3/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
696    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
697
698    if let Some(ref user_agent) = configuration.user_agent {
699        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
700    }
701    if let Some(ref token) = configuration.bearer_access_token {
702        req_builder = req_builder.bearer_auth(token.to_owned());
703    };
704
705    let req = req_builder.build()?;
706    let resp = configuration.client.execute(req).await?;
707
708    let status = resp.status();
709    let content_type = resp
710        .headers()
711        .get("content-type")
712        .and_then(|v| v.to_str().ok())
713        .unwrap_or("application/octet-stream");
714    let content_type = super::ContentType::from(content_type);
715
716    if !status.is_client_error() && !status.is_server_error() {
717        let content = resp.text().await?;
718        match content_type {
719            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
720            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProvisionedResource`"))),
721            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::ProvisionedResource`")))),
722        }
723    } else {
724        let content = resp.text().await?;
725        let entity: Option<GetProvisioningS3ByNameError> = serde_json::from_str(&content).ok();
726        Err(Error::ResponseError(ResponseContent { status, content, entity }))
727    }
728}
729
730/// Lists the caller org's search indexes. An index is a logical resource inside an already-live shared backend, so every one of them is reached through the public gateway rather than at an instance of its own.
731pub async fn get_provisioning_search(configuration: &configuration::Configuration, ) -> Result<Vec<models::ProvisionedSummary>, Error<GetProvisioningSearchError>> {
732
733    let uri_str = format!("{}/v1/provisioning/search", configuration.base_path);
734    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
735
736    if let Some(ref user_agent) = configuration.user_agent {
737        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
738    }
739    if let Some(ref token) = configuration.bearer_access_token {
740        req_builder = req_builder.bearer_auth(token.to_owned());
741    };
742
743    let req = req_builder.build()?;
744    let resp = configuration.client.execute(req).await?;
745
746    let status = resp.status();
747    let content_type = resp
748        .headers()
749        .get("content-type")
750        .and_then(|v| v.to_str().ok())
751        .unwrap_or("application/octet-stream");
752    let content_type = super::ContentType::from(content_type);
753
754    if !status.is_client_error() && !status.is_server_error() {
755        let content = resp.text().await?;
756        match content_type {
757            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
758            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::ProvisionedSummary&gt;`"))),
759            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::ProvisionedSummary&gt;`")))),
760        }
761    } else {
762        let content = resp.text().await?;
763        let entity: Option<GetProvisioningSearchError> = serde_json::from_str(&content).ok();
764        Err(Error::ResponseError(ResponseContent { status, content, entity }))
765    }
766}
767
768/// Returns one search index's metadata. It carries the index's status and the gateway address it is reached at, and no username: the backend authenticates with a shared, out-of-band key rather than a per-index credential.
769pub async fn get_provisioning_search_by_name(configuration: &configuration::Configuration, name: &str) -> Result<models::ProvisionedResource, Error<GetProvisioningSearchByNameError>> {
770    // add a prefix to parameters to efficiently prevent name collisions
771    let p_name = name;
772
773    let uri_str = format!("{}/v1/provisioning/search/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
774    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
775
776    if let Some(ref user_agent) = configuration.user_agent {
777        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
778    }
779    if let Some(ref token) = configuration.bearer_access_token {
780        req_builder = req_builder.bearer_auth(token.to_owned());
781    };
782
783    let req = req_builder.build()?;
784    let resp = configuration.client.execute(req).await?;
785
786    let status = resp.status();
787    let content_type = resp
788        .headers()
789        .get("content-type")
790        .and_then(|v| v.to_str().ok())
791        .unwrap_or("application/octet-stream");
792    let content_type = super::ContentType::from(content_type);
793
794    if !status.is_client_error() && !status.is_server_error() {
795        let content = resp.text().await?;
796        match content_type {
797            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
798            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProvisionedResource`"))),
799            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::ProvisionedResource`")))),
800        }
801    } else {
802        let content = resp.text().await?;
803        let entity: Option<GetProvisioningSearchByNameError> = serde_json::from_str(&content).ok();
804        Err(Error::ResponseError(ResponseContent { status, content, entity }))
805    }
806}
807
808/// ListSQL lists the caller org's Hanzo SQL databases. Each one is a DEDICATED PostgreSQL instance the org alone runs, so the host is that instance's own in-cluster Service and the port is 5432.
809pub async fn get_provisioning_sql(configuration: &configuration::Configuration, ) -> Result<Vec<models::ProvisionedSummary>, Error<GetProvisioningSqlError>> {
810
811    let uri_str = format!("{}/v1/provisioning/sql", configuration.base_path);
812    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
813
814    if let Some(ref user_agent) = configuration.user_agent {
815        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
816    }
817    if let Some(ref token) = configuration.bearer_access_token {
818        req_builder = req_builder.bearer_auth(token.to_owned());
819    };
820
821    let req = req_builder.build()?;
822    let resp = configuration.client.execute(req).await?;
823
824    let status = resp.status();
825    let content_type = resp
826        .headers()
827        .get("content-type")
828        .and_then(|v| v.to_str().ok())
829        .unwrap_or("application/octet-stream");
830    let content_type = super::ContentType::from(content_type);
831
832    if !status.is_client_error() && !status.is_server_error() {
833        let content = resp.text().await?;
834        match content_type {
835            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
836            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::ProvisionedSummary&gt;`"))),
837            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::ProvisionedSummary&gt;`")))),
838        }
839    } else {
840        let content = resp.text().await?;
841        let entity: Option<GetProvisioningSqlError> = serde_json::from_str(&content).ok();
842        Err(Error::ResponseError(ResponseContent { status, content, entity }))
843    }
844}
845
846/// GetSQL returns one Hanzo SQL database's metadata. It carries the database's status, its instance address and the admin user Postgres booted with — never the password, which is returned once at create and otherwise lives only in Hanzo KMS. A still-booting instance reads \"provisioning\", reconciled from the operator's live view rather than from the row.
847pub async fn get_provisioning_sql_by_name(configuration: &configuration::Configuration, name: &str) -> Result<models::ProvisionedResource, Error<GetProvisioningSqlByNameError>> {
848    // add a prefix to parameters to efficiently prevent name collisions
849    let p_name = name;
850
851    let uri_str = format!("{}/v1/provisioning/sql/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
852    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
853
854    if let Some(ref user_agent) = configuration.user_agent {
855        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
856    }
857    if let Some(ref token) = configuration.bearer_access_token {
858        req_builder = req_builder.bearer_auth(token.to_owned());
859    };
860
861    let req = req_builder.build()?;
862    let resp = configuration.client.execute(req).await?;
863
864    let status = resp.status();
865    let content_type = resp
866        .headers()
867        .get("content-type")
868        .and_then(|v| v.to_str().ok())
869        .unwrap_or("application/octet-stream");
870    let content_type = super::ContentType::from(content_type);
871
872    if !status.is_client_error() && !status.is_server_error() {
873        let content = resp.text().await?;
874        match content_type {
875            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
876            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProvisionedResource`"))),
877            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::ProvisionedResource`")))),
878        }
879    } else {
880        let content = resp.text().await?;
881        let entity: Option<GetProvisioningSqlByNameError> = serde_json::from_str(&content).ok();
882        Err(Error::ResponseError(ResponseContent { status, content, entity }))
883    }
884}
885
886/// Lists the caller org's vector collections. A collection is a logical resource inside an already-live shared backend, so every one of them is reached through the public gateway rather than at an instance of its own.
887pub async fn get_provisioning_vector(configuration: &configuration::Configuration, ) -> Result<Vec<models::ProvisionedSummary>, Error<GetProvisioningVectorError>> {
888
889    let uri_str = format!("{}/v1/provisioning/vector", configuration.base_path);
890    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
891
892    if let Some(ref user_agent) = configuration.user_agent {
893        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
894    }
895    if let Some(ref token) = configuration.bearer_access_token {
896        req_builder = req_builder.bearer_auth(token.to_owned());
897    };
898
899    let req = req_builder.build()?;
900    let resp = configuration.client.execute(req).await?;
901
902    let status = resp.status();
903    let content_type = resp
904        .headers()
905        .get("content-type")
906        .and_then(|v| v.to_str().ok())
907        .unwrap_or("application/octet-stream");
908    let content_type = super::ContentType::from(content_type);
909
910    if !status.is_client_error() && !status.is_server_error() {
911        let content = resp.text().await?;
912        match content_type {
913            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
914            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::ProvisionedSummary&gt;`"))),
915            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::ProvisionedSummary&gt;`")))),
916        }
917    } else {
918        let content = resp.text().await?;
919        let entity: Option<GetProvisioningVectorError> = serde_json::from_str(&content).ok();
920        Err(Error::ResponseError(ResponseContent { status, content, entity }))
921    }
922}
923
924/// Returns one vector collection's metadata. It carries the collection's status and the gateway address it is reached at, and no username: the backend authenticates with a shared, out-of-band key rather than a per-collection credential, so there is no per-resource user to report.
925pub async fn get_provisioning_vector_by_name(configuration: &configuration::Configuration, name: &str) -> Result<models::ProvisionedResource, Error<GetProvisioningVectorByNameError>> {
926    // add a prefix to parameters to efficiently prevent name collisions
927    let p_name = name;
928
929    let uri_str = format!("{}/v1/provisioning/vector/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
930    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
931
932    if let Some(ref user_agent) = configuration.user_agent {
933        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
934    }
935    if let Some(ref token) = configuration.bearer_access_token {
936        req_builder = req_builder.bearer_auth(token.to_owned());
937    };
938
939    let req = req_builder.build()?;
940    let resp = configuration.client.execute(req).await?;
941
942    let status = resp.status();
943    let content_type = resp
944        .headers()
945        .get("content-type")
946        .and_then(|v| v.to_str().ok())
947        .unwrap_or("application/octet-stream");
948    let content_type = super::ContentType::from(content_type);
949
950    if !status.is_client_error() && !status.is_server_error() {
951        let content = resp.text().await?;
952        match content_type {
953            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
954            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProvisionedResource`"))),
955            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::ProvisionedResource`")))),
956        }
957    } else {
958        let content = resp.text().await?;
959        let entity: Option<GetProvisioningVectorByNameError> = serde_json::from_str(&content).ok();
960        Err(Error::ResponseError(ResponseContent { status, content, entity }))
961    }
962}
963
964/// Launches your org's OWN Hanzo Datastore instance and answers with its `datastore://` connection string.  The instance is yours alone — a deployment in your own tenant namespace, so its admin credential is naturally scoped to you and no other tenant shares the process. Off-cluster this fails closed with 503 rather than handing back a shared one.
965pub async fn post_provisioning_datastore(configuration: &configuration::Configuration, provision_request: models::ProvisionRequest) -> Result<models::ProvisionResult, Error<PostProvisioningDatastoreError>> {
966    // add a prefix to parameters to efficiently prevent name collisions
967    let p_provision_request = provision_request;
968
969    let uri_str = format!("{}/v1/provisioning/datastore", configuration.base_path);
970    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
971
972    if let Some(ref user_agent) = configuration.user_agent {
973        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
974    }
975    if let Some(ref token) = configuration.bearer_access_token {
976        req_builder = req_builder.bearer_auth(token.to_owned());
977    };
978    req_builder = req_builder.json(&p_provision_request);
979
980    let req = req_builder.build()?;
981    let resp = configuration.client.execute(req).await?;
982
983    let status = resp.status();
984    let content_type = resp
985        .headers()
986        .get("content-type")
987        .and_then(|v| v.to_str().ok())
988        .unwrap_or("application/octet-stream");
989    let content_type = super::ContentType::from(content_type);
990
991    if !status.is_client_error() && !status.is_server_error() {
992        let content = resp.text().await?;
993        match content_type {
994            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
995            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProvisionResult`"))),
996            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::ProvisionResult`")))),
997        }
998    } else {
999        let content = resp.text().await?;
1000        let entity: Option<PostProvisioningDatastoreError> = serde_json::from_str(&content).ok();
1001        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1002    }
1003}
1004
1005/// CreateDocDB launches your org's OWN document-database instance and answers with its `mongodb://` connection string. It speaks the MongoDB wire protocol, so existing MongoDB drivers connect unchanged.  The instance is yours alone — a deployment in your own tenant namespace, so its admin credential is naturally scoped to you and no other tenant shares the process. Off-cluster this fails closed with 503 rather than handing back a shared one.
1006pub async fn post_provisioning_docdb(configuration: &configuration::Configuration, provision_request: models::ProvisionRequest) -> Result<models::ProvisionResult, Error<PostProvisioningDocdbError>> {
1007    // add a prefix to parameters to efficiently prevent name collisions
1008    let p_provision_request = provision_request;
1009
1010    let uri_str = format!("{}/v1/provisioning/docdb", configuration.base_path);
1011    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1012
1013    if let Some(ref user_agent) = configuration.user_agent {
1014        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1015    }
1016    if let Some(ref token) = configuration.bearer_access_token {
1017        req_builder = req_builder.bearer_auth(token.to_owned());
1018    };
1019    req_builder = req_builder.json(&p_provision_request);
1020
1021    let req = req_builder.build()?;
1022    let resp = configuration.client.execute(req).await?;
1023
1024    let status = resp.status();
1025    let content_type = resp
1026        .headers()
1027        .get("content-type")
1028        .and_then(|v| v.to_str().ok())
1029        .unwrap_or("application/octet-stream");
1030    let content_type = super::ContentType::from(content_type);
1031
1032    if !status.is_client_error() && !status.is_server_error() {
1033        let content = resp.text().await?;
1034        match content_type {
1035            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1036            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProvisionResult`"))),
1037            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::ProvisionResult`")))),
1038        }
1039    } else {
1040        let content = resp.text().await?;
1041        let entity: Option<PostProvisioningDocdbError> = serde_json::from_str(&content).ok();
1042        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1043    }
1044}
1045
1046/// CreateKV launches your org's OWN key-value instance and answers with its `kv://` connection string.  The instance is yours alone — a deployment in your own tenant namespace, so its admin credential is naturally scoped to you and no other tenant shares the process. Off-cluster this fails closed with 503 rather than handing back a shared one.
1047pub async fn post_provisioning_kv(configuration: &configuration::Configuration, provision_request: models::ProvisionRequest) -> Result<models::ProvisionResult, Error<PostProvisioningKvError>> {
1048    // add a prefix to parameters to efficiently prevent name collisions
1049    let p_provision_request = provision_request;
1050
1051    let uri_str = format!("{}/v1/provisioning/kv", configuration.base_path);
1052    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1053
1054    if let Some(ref user_agent) = configuration.user_agent {
1055        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1056    }
1057    if let Some(ref token) = configuration.bearer_access_token {
1058        req_builder = req_builder.bearer_auth(token.to_owned());
1059    };
1060    req_builder = req_builder.json(&p_provision_request);
1061
1062    let req = req_builder.build()?;
1063    let resp = configuration.client.execute(req).await?;
1064
1065    let status = resp.status();
1066    let content_type = resp
1067        .headers()
1068        .get("content-type")
1069        .and_then(|v| v.to_str().ok())
1070        .unwrap_or("application/octet-stream");
1071    let content_type = super::ContentType::from(content_type);
1072
1073    if !status.is_client_error() && !status.is_server_error() {
1074        let content = resp.text().await?;
1075        match content_type {
1076            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1077            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProvisionResult`"))),
1078            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::ProvisionResult`")))),
1079        }
1080    } else {
1081        let content = resp.text().await?;
1082        let entity: Option<PostProvisioningKvError> = serde_json::from_str(&content).ok();
1083        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1084    }
1085}
1086
1087/// Creates an S3-compatible bucket inside the already-running shared object store and answers with the endpoint that reaches it.
1088pub async fn post_provisioning_s3(configuration: &configuration::Configuration, provision_request: models::ProvisionRequest) -> Result<models::ProvisionResult, Error<PostProvisioningS3Error>> {
1089    // add a prefix to parameters to efficiently prevent name collisions
1090    let p_provision_request = provision_request;
1091
1092    let uri_str = format!("{}/v1/provisioning/s3", configuration.base_path);
1093    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1094
1095    if let Some(ref user_agent) = configuration.user_agent {
1096        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1097    }
1098    if let Some(ref token) = configuration.bearer_access_token {
1099        req_builder = req_builder.bearer_auth(token.to_owned());
1100    };
1101    req_builder = req_builder.json(&p_provision_request);
1102
1103    let req = req_builder.build()?;
1104    let resp = configuration.client.execute(req).await?;
1105
1106    let status = resp.status();
1107    let content_type = resp
1108        .headers()
1109        .get("content-type")
1110        .and_then(|v| v.to_str().ok())
1111        .unwrap_or("application/octet-stream");
1112    let content_type = super::ContentType::from(content_type);
1113
1114    if !status.is_client_error() && !status.is_server_error() {
1115        let content = resp.text().await?;
1116        match content_type {
1117            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1118            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProvisionResult`"))),
1119            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::ProvisionResult`")))),
1120        }
1121    } else {
1122        let content = resp.text().await?;
1123        let entity: Option<PostProvisioningS3Error> = serde_json::from_str(&content).ok();
1124        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1125    }
1126}
1127
1128/// Creates a search index inside the already-running shared search backend and answers with the endpoint that reaches it.
1129pub async fn post_provisioning_search(configuration: &configuration::Configuration, provision_request: models::ProvisionRequest) -> Result<models::ProvisionResult, Error<PostProvisioningSearchError>> {
1130    // add a prefix to parameters to efficiently prevent name collisions
1131    let p_provision_request = provision_request;
1132
1133    let uri_str = format!("{}/v1/provisioning/search", configuration.base_path);
1134    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1135
1136    if let Some(ref user_agent) = configuration.user_agent {
1137        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1138    }
1139    if let Some(ref token) = configuration.bearer_access_token {
1140        req_builder = req_builder.bearer_auth(token.to_owned());
1141    };
1142    req_builder = req_builder.json(&p_provision_request);
1143
1144    let req = req_builder.build()?;
1145    let resp = configuration.client.execute(req).await?;
1146
1147    let status = resp.status();
1148    let content_type = resp
1149        .headers()
1150        .get("content-type")
1151        .and_then(|v| v.to_str().ok())
1152        .unwrap_or("application/octet-stream");
1153    let content_type = super::ContentType::from(content_type);
1154
1155    if !status.is_client_error() && !status.is_server_error() {
1156        let content = resp.text().await?;
1157        match content_type {
1158            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1159            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProvisionResult`"))),
1160            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::ProvisionResult`")))),
1161        }
1162    } else {
1163        let content = resp.text().await?;
1164        let entity: Option<PostProvisioningSearchError> = serde_json::from_str(&content).ok();
1165        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1166    }
1167}
1168
1169/// CreateSQL launches your org's OWN PostgreSQL instance and answers with its `postgres://` connection string.  The instance is yours alone — a deployment in your own tenant namespace, so its admin credential is naturally scoped to you and no other tenant shares the process. Off-cluster, where there is no orchestrator to launch one, this fails closed with 503 rather than handing back a shared one.
1170pub async fn post_provisioning_sql(configuration: &configuration::Configuration, provision_request: models::ProvisionRequest) -> Result<models::ProvisionResult, Error<PostProvisioningSqlError>> {
1171    // add a prefix to parameters to efficiently prevent name collisions
1172    let p_provision_request = provision_request;
1173
1174    let uri_str = format!("{}/v1/provisioning/sql", configuration.base_path);
1175    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1176
1177    if let Some(ref user_agent) = configuration.user_agent {
1178        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1179    }
1180    if let Some(ref token) = configuration.bearer_access_token {
1181        req_builder = req_builder.bearer_auth(token.to_owned());
1182    };
1183    req_builder = req_builder.json(&p_provision_request);
1184
1185    let req = req_builder.build()?;
1186    let resp = configuration.client.execute(req).await?;
1187
1188    let status = resp.status();
1189    let content_type = resp
1190        .headers()
1191        .get("content-type")
1192        .and_then(|v| v.to_str().ok())
1193        .unwrap_or("application/octet-stream");
1194    let content_type = super::ContentType::from(content_type);
1195
1196    if !status.is_client_error() && !status.is_server_error() {
1197        let content = resp.text().await?;
1198        match content_type {
1199            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1200            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProvisionResult`"))),
1201            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::ProvisionResult`")))),
1202        }
1203    } else {
1204        let content = resp.text().await?;
1205        let entity: Option<PostProvisioningSqlError> = serde_json::from_str(&content).ok();
1206        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1207    }
1208}
1209
1210/// Creates a vector collection inside the already-running shared vector backend and answers with the endpoint that reaches it.
1211pub async fn post_provisioning_vector(configuration: &configuration::Configuration, provision_request: models::ProvisionRequest) -> Result<models::ProvisionResult, Error<PostProvisioningVectorError>> {
1212    // add a prefix to parameters to efficiently prevent name collisions
1213    let p_provision_request = provision_request;
1214
1215    let uri_str = format!("{}/v1/provisioning/vector", configuration.base_path);
1216    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1217
1218    if let Some(ref user_agent) = configuration.user_agent {
1219        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1220    }
1221    if let Some(ref token) = configuration.bearer_access_token {
1222        req_builder = req_builder.bearer_auth(token.to_owned());
1223    };
1224    req_builder = req_builder.json(&p_provision_request);
1225
1226    let req = req_builder.build()?;
1227    let resp = configuration.client.execute(req).await?;
1228
1229    let status = resp.status();
1230    let content_type = resp
1231        .headers()
1232        .get("content-type")
1233        .and_then(|v| v.to_str().ok())
1234        .unwrap_or("application/octet-stream");
1235    let content_type = super::ContentType::from(content_type);
1236
1237    if !status.is_client_error() && !status.is_server_error() {
1238        let content = resp.text().await?;
1239        match content_type {
1240            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1241            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProvisionResult`"))),
1242            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::ProvisionResult`")))),
1243        }
1244    } else {
1245        let content = resp.text().await?;
1246        let entity: Option<PostProvisioningVectorError> = serde_json::from_str(&content).ok();
1247        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1248    }
1249}
1250