Skip to main content

hanzo_client/apis/
pricing_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 [`get_pricing`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum GetPricingError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`get_pricing_base`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum GetPricingBaseError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`get_pricing_blockchain`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum GetPricingBlockchainError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`get_pricing_cloud`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum GetPricingCloudError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`get_pricing_cloud_plans`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum GetPricingCloudPlansError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`get_pricing_cloud_regions`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum GetPricingCloudRegionsError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`get_pricing_cloud_storage`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum GetPricingCloudStorageError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`get_pricing_compute`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetPricingComputeError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`get_pricing_compute_presets`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetPricingComputePresetsError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`get_pricing_datastore`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetPricingDatastoreError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`get_pricing_enablement`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetPricingEnablementError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`get_pricing_featured`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum GetPricingFeaturedError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`get_pricing_free`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum GetPricingFreeError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`get_pricing_gpu`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum GetPricingGpuError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`get_pricing_health`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum GetPricingHealthError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`get_pricing_iam`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetPricingIamError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`get_pricing_model_by_name`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum GetPricingModelByNameError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`get_pricing_models`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum GetPricingModelsError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`get_pricing_paas`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum GetPricingPaasError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`get_pricing_policy`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum GetPricingPolicyError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`get_pricing_providers`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum GetPricingProvidersError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`get_pricing_services`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum GetPricingServicesError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`get_pricing_subscriptions`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum GetPricingSubscriptionsError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`get_pricing_summary`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum GetPricingSummaryError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`get_pricing_tools`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum GetPricingToolsError {
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`post_pricing_enablement_optin`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum PostPricingEnablementOptinError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`post_pricing_enablement_optout`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum PostPricingEnablementOptoutError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`post_pricing_sync`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum PostPricingSyncError {
211    UnknownValue(serde_json::Value),
212}
213
214
215/// Returns the whole pricing catalog in one document: Zen and third-party models, providers, model families, the free-model list, plan and infrastructure pricing. Every model and provider it names is filtered to what the caller's org may see — the same gate the leaf routes apply, so this can never be an un-gated second source for what they hide.
216pub async fn get_pricing(configuration: &configuration::Configuration, ) -> Result<std::collections::HashMap<String, serde_json::Value>, Error<GetPricingError>> {
217
218    let uri_str = format!("{}/v1/pricing", configuration.base_path);
219    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
220
221    if let Some(ref user_agent) = configuration.user_agent {
222        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
223    }
224    if let Some(ref token) = configuration.bearer_access_token {
225        req_builder = req_builder.bearer_auth(token.to_owned());
226    };
227
228    let req = req_builder.build()?;
229    let resp = configuration.client.execute(req).await?;
230
231    let status = resp.status();
232    let content_type = resp
233        .headers()
234        .get("content-type")
235        .and_then(|v| v.to_str().ok())
236        .unwrap_or("application/octet-stream");
237    let content_type = super::ContentType::from(content_type);
238
239    if !status.is_client_error() && !status.is_server_error() {
240        let content = resp.text().await?;
241        match content_type {
242            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
243            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`"))),
244            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`")))),
245        }
246    } else {
247        let content = resp.text().await?;
248        let entity: Option<GetPricingError> = serde_json::from_str(&content).ok();
249        Err(Error::ResponseError(ResponseContent { status, content, entity }))
250    }
251}
252
253/// Returns the Hanzo Base plans — the managed-instance tiers, each with its monthly and annual price, storage and request allowances and feature list.
254pub async fn get_pricing_base(configuration: &configuration::Configuration, ) -> Result<models::PricingPlanList, Error<GetPricingBaseError>> {
255
256    let uri_str = format!("{}/v1/pricing/base", configuration.base_path);
257    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
258
259    if let Some(ref user_agent) = configuration.user_agent {
260        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
261    }
262    if let Some(ref token) = configuration.bearer_access_token {
263        req_builder = req_builder.bearer_auth(token.to_owned());
264    };
265
266    let req = req_builder.build()?;
267    let resp = configuration.client.execute(req).await?;
268
269    let status = resp.status();
270    let content_type = resp
271        .headers()
272        .get("content-type")
273        .and_then(|v| v.to_str().ok())
274        .unwrap_or("application/octet-stream");
275    let content_type = super::ContentType::from(content_type);
276
277    if !status.is_client_error() && !status.is_server_error() {
278        let content = resp.text().await?;
279        match content_type {
280            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
281            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PricingPlanList`"))),
282            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::PricingPlanList`")))),
283        }
284    } else {
285        let content = resp.text().await?;
286        let entity: Option<GetPricingBaseError> = serde_json::from_str(&content).ok();
287        Err(Error::ResponseError(ResponseContent { status, content, entity }))
288    }
289}
290
291/// Returns the blockchain access plans — the RPC and node tiers, each with its monthly price, compute-unit allowance and feature list.
292pub async fn get_pricing_blockchain(configuration: &configuration::Configuration, ) -> Result<models::PricingPlanList, Error<GetPricingBlockchainError>> {
293
294    let uri_str = format!("{}/v1/pricing/blockchain", configuration.base_path);
295    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
296
297    if let Some(ref user_agent) = configuration.user_agent {
298        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
299    }
300    if let Some(ref token) = configuration.bearer_access_token {
301        req_builder = req_builder.bearer_auth(token.to_owned());
302    };
303
304    let req = req_builder.build()?;
305    let resp = configuration.client.execute(req).await?;
306
307    let status = resp.status();
308    let content_type = resp
309        .headers()
310        .get("content-type")
311        .and_then(|v| v.to_str().ok())
312        .unwrap_or("application/octet-stream");
313    let content_type = super::ContentType::from(content_type);
314
315    if !status.is_client_error() && !status.is_server_error() {
316        let content = resp.text().await?;
317        match content_type {
318            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
319            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PricingPlanList`"))),
320            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::PricingPlanList`")))),
321        }
322    } else {
323        let content = resp.text().await?;
324        let entity: Option<GetPricingBlockchainError> = serde_json::from_str(&content).ok();
325        Err(Error::ResponseError(ResponseContent { status, content, entity }))
326    }
327}
328
329/// Returns the public cloud section of the catalog in one document: its instance plans, its regions and its block-storage prices. The section's internal half — the provider costs Hanzo pays and the plan-to- provider routing table — is stripped before it is served, so this is what a customer may see and nothing more.
330pub async fn get_pricing_cloud(configuration: &configuration::Configuration, ) -> Result<std::collections::HashMap<String, serde_json::Value>, Error<GetPricingCloudError>> {
331
332    let uri_str = format!("{}/v1/pricing/cloud", configuration.base_path);
333    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
334
335    if let Some(ref user_agent) = configuration.user_agent {
336        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
337    }
338    if let Some(ref token) = configuration.bearer_access_token {
339        req_builder = req_builder.bearer_auth(token.to_owned());
340    };
341
342    let req = req_builder.build()?;
343    let resp = configuration.client.execute(req).await?;
344
345    let status = resp.status();
346    let content_type = resp
347        .headers()
348        .get("content-type")
349        .and_then(|v| v.to_str().ok())
350        .unwrap_or("application/octet-stream");
351    let content_type = super::ContentType::from(content_type);
352
353    if !status.is_client_error() && !status.is_server_error() {
354        let content = resp.text().await?;
355        match content_type {
356            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
357            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`"))),
358            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`")))),
359        }
360    } else {
361        let content = resp.text().await?;
362        let entity: Option<GetPricingCloudError> = serde_json::from_str(&content).ok();
363        Err(Error::ResponseError(ResponseContent { status, content, entity }))
364    }
365}
366
367/// Returns just the cloud instance plans — each with its vCPU, memory, disk, CPU type, VM allowance, feature list and monthly and hourly price. It is the plans of the cloud section on their own.
368pub async fn get_pricing_cloud_plans(configuration: &configuration::Configuration, ) -> Result<models::PricingPlanList, Error<GetPricingCloudPlansError>> {
369
370    let uri_str = format!("{}/v1/pricing/cloud/plans", configuration.base_path);
371    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
372
373    if let Some(ref user_agent) = configuration.user_agent {
374        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
375    }
376    if let Some(ref token) = configuration.bearer_access_token {
377        req_builder = req_builder.bearer_auth(token.to_owned());
378    };
379
380    let req = req_builder.build()?;
381    let resp = configuration.client.execute(req).await?;
382
383    let status = resp.status();
384    let content_type = resp
385        .headers()
386        .get("content-type")
387        .and_then(|v| v.to_str().ok())
388        .unwrap_or("application/octet-stream");
389    let content_type = super::ContentType::from(content_type);
390
391    if !status.is_client_error() && !status.is_server_error() {
392        let content = resp.text().await?;
393        match content_type {
394            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
395            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PricingPlanList`"))),
396            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::PricingPlanList`")))),
397        }
398    } else {
399        let content = resp.text().await?;
400        let entity: Option<GetPricingCloudPlansError> = serde_json::from_str(&content).ok();
401        Err(Error::ResponseError(ResponseContent { status, content, entity }))
402    }
403}
404
405/// Returns the regions a cloud instance can be placed in, each with its id, display name and physical location. It is the regions of the cloud section on their own.
406pub async fn get_pricing_cloud_regions(configuration: &configuration::Configuration, ) -> Result<models::PricingRegionList, Error<GetPricingCloudRegionsError>> {
407
408    let uri_str = format!("{}/v1/pricing/cloud/regions", configuration.base_path);
409    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
410
411    if let Some(ref user_agent) = configuration.user_agent {
412        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
413    }
414    if let Some(ref token) = configuration.bearer_access_token {
415        req_builder = req_builder.bearer_auth(token.to_owned());
416    };
417
418    let req = req_builder.build()?;
419    let resp = configuration.client.execute(req).await?;
420
421    let status = resp.status();
422    let content_type = resp
423        .headers()
424        .get("content-type")
425        .and_then(|v| v.to_str().ok())
426        .unwrap_or("application/octet-stream");
427    let content_type = super::ContentType::from(content_type);
428
429    if !status.is_client_error() && !status.is_server_error() {
430        let content = resp.text().await?;
431        match content_type {
432            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
433            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PricingRegionList`"))),
434            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::PricingRegionList`")))),
435        }
436    } else {
437        let content = resp.text().await?;
438        let entity: Option<GetPricingCloudRegionsError> = serde_json::from_str(&content).ok();
439        Err(Error::ResponseError(ResponseContent { status, content, entity }))
440    }
441}
442
443/// Returns the block-storage prices of the cloud section: the per-GB monthly rate and the volume size bounds a caller may ask for.
444pub async fn get_pricing_cloud_storage(configuration: &configuration::Configuration, ) -> Result<std::collections::HashMap<String, serde_json::Value>, Error<GetPricingCloudStorageError>> {
445
446    let uri_str = format!("{}/v1/pricing/cloud/storage", configuration.base_path);
447    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
448
449    if let Some(ref user_agent) = configuration.user_agent {
450        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
451    }
452    if let Some(ref token) = configuration.bearer_access_token {
453        req_builder = req_builder.bearer_auth(token.to_owned());
454    };
455
456    let req = req_builder.build()?;
457    let resp = configuration.client.execute(req).await?;
458
459    let status = resp.status();
460    let content_type = resp
461        .headers()
462        .get("content-type")
463        .and_then(|v| v.to_str().ok())
464        .unwrap_or("application/octet-stream");
465    let content_type = super::ContentType::from(content_type);
466
467    if !status.is_client_error() && !status.is_server_error() {
468        let content = resp.text().await?;
469        match content_type {
470            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
471            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`"))),
472            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`")))),
473        }
474    } else {
475        let content = resp.text().await?;
476        let entity: Option<GetPricingCloudStorageError> = serde_json::from_str(&content).ok();
477        Err(Error::ResponseError(ResponseContent { status, content, entity }))
478    }
479}
480
481/// Returns the compute section of the catalog: the cloud provider and region the prices are quoted for, the monthly markup applied to them, the full instance-size tier list and the named presets. It is the whole section as the pricing source records it, un-gated — no model or provider identity appears in it.
482pub async fn get_pricing_compute(configuration: &configuration::Configuration, ) -> Result<std::collections::HashMap<String, serde_json::Value>, Error<GetPricingComputeError>> {
483
484    let uri_str = format!("{}/v1/pricing/compute", configuration.base_path);
485    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
486
487    if let Some(ref user_agent) = configuration.user_agent {
488        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
489    }
490    if let Some(ref token) = configuration.bearer_access_token {
491        req_builder = req_builder.bearer_auth(token.to_owned());
492    };
493
494    let req = req_builder.build()?;
495    let resp = configuration.client.execute(req).await?;
496
497    let status = resp.status();
498    let content_type = resp
499        .headers()
500        .get("content-type")
501        .and_then(|v| v.to_str().ok())
502        .unwrap_or("application/octet-stream");
503    let content_type = super::ContentType::from(content_type);
504
505    if !status.is_client_error() && !status.is_server_error() {
506        let content = resp.text().await?;
507        match content_type {
508            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
509            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`"))),
510            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`")))),
511        }
512    } else {
513        let content = resp.text().await?;
514        let entity: Option<GetPricingComputeError> = serde_json::from_str(&content).ok();
515        Err(Error::ResponseError(ResponseContent { status, content, entity }))
516    }
517}
518
519/// Returns just the named compute sizes — the short, human-labelled list (\"Starter\", \"Pro\") a size picker renders, each carrying its provider slug, vCPU, memory, disk and price. It is the presets of the compute section on their own, for a caller that does not need the full tier table.
520pub async fn get_pricing_compute_presets(configuration: &configuration::Configuration, ) -> Result<models::PricingPresetList, Error<GetPricingComputePresetsError>> {
521
522    let uri_str = format!("{}/v1/pricing/compute/presets", configuration.base_path);
523    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
524
525    if let Some(ref user_agent) = configuration.user_agent {
526        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
527    }
528    if let Some(ref token) = configuration.bearer_access_token {
529        req_builder = req_builder.bearer_auth(token.to_owned());
530    };
531
532    let req = req_builder.build()?;
533    let resp = configuration.client.execute(req).await?;
534
535    let status = resp.status();
536    let content_type = resp
537        .headers()
538        .get("content-type")
539        .and_then(|v| v.to_str().ok())
540        .unwrap_or("application/octet-stream");
541    let content_type = super::ContentType::from(content_type);
542
543    if !status.is_client_error() && !status.is_server_error() {
544        let content = resp.text().await?;
545        match content_type {
546            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
547            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PricingPresetList`"))),
548            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::PricingPresetList`")))),
549        }
550    } else {
551        let content = resp.text().await?;
552        let entity: Option<GetPricingComputePresetsError> = serde_json::from_str(&content).ok();
553        Err(Error::ResponseError(ResponseContent { status, content, entity }))
554    }
555}
556
557/// Returns the Hanzo Datastore rate card: the tier list, the per-GB storage and egress usage rates, the annual discount and the trial. It is the section as authored, un-gated — no provider identity appears in it.  The route was missing while the data existed, so this 404d and every visitor to hanzo.ai's Infrastructure tab was told pricing was \"temporarily unavailable\".
558pub async fn get_pricing_datastore(configuration: &configuration::Configuration, ) -> Result<std::collections::HashMap<String, serde_json::Value>, Error<GetPricingDatastoreError>> {
559
560    let uri_str = format!("{}/v1/pricing/datastore", configuration.base_path);
561    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
562
563    if let Some(ref user_agent) = configuration.user_agent {
564        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
565    }
566    if let Some(ref token) = configuration.bearer_access_token {
567        req_builder = req_builder.bearer_auth(token.to_owned());
568    };
569
570    let req = req_builder.build()?;
571    let resp = configuration.client.execute(req).await?;
572
573    let status = resp.status();
574    let content_type = resp
575        .headers()
576        .get("content-type")
577        .and_then(|v| v.to_str().ok())
578        .unwrap_or("application/octet-stream");
579    let content_type = super::ContentType::from(content_type);
580
581    if !status.is_client_error() && !status.is_server_error() {
582        let content = resp.text().await?;
583        match content_type {
584            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
585            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`"))),
586            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`")))),
587        }
588    } else {
589        let content = resp.text().await?;
590        let entity: Option<GetPricingDatastoreError> = serde_json::from_str(&content).ok();
591        Err(Error::ResponseError(ResponseContent { status, content, entity }))
592    }
593}
594
595/// Returns what the caller's org can actually use: every managed item with its global state, whether it is effective here, whether this org is already opted into its beta, and whether it may still opt in. Read-only and safe for any caller — one without a validated principal simply sees the generally-available items and no opt-in affordance, never another org's state.
596pub async fn get_pricing_enablement(configuration: &configuration::Configuration, ) -> Result<models::EnablementBoard, Error<GetPricingEnablementError>> {
597
598    let uri_str = format!("{}/v1/pricing/enablement", configuration.base_path);
599    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
600
601    if let Some(ref user_agent) = configuration.user_agent {
602        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
603    }
604    if let Some(ref token) = configuration.bearer_access_token {
605        req_builder = req_builder.bearer_auth(token.to_owned());
606    };
607
608    let req = req_builder.build()?;
609    let resp = configuration.client.execute(req).await?;
610
611    let status = resp.status();
612    let content_type = resp
613        .headers()
614        .get("content-type")
615        .and_then(|v| v.to_str().ok())
616        .unwrap_or("application/octet-stream");
617    let content_type = super::ContentType::from(content_type);
618
619    if !status.is_client_error() && !status.is_server_error() {
620        let content = resp.text().await?;
621        match content_type {
622            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
623            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EnablementBoard`"))),
624            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::EnablementBoard`")))),
625        }
626    } else {
627        let content = resp.text().await?;
628        let entity: Option<GetPricingEnablementError> = serde_json::from_str(&content).ok();
629        Err(Error::ResponseError(ResponseContent { status, content, entity }))
630    }
631}
632
633/// Returns the models the catalog highlights, filtered to what the caller's org may see. It is the same catalog as ListModels narrowed to entries the pricing source marks featured.
634pub async fn get_pricing_featured(configuration: &configuration::Configuration, ) -> Result<models::PricingModelList, Error<GetPricingFeaturedError>> {
635
636    let uri_str = format!("{}/v1/pricing/featured", configuration.base_path);
637    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
638
639    if let Some(ref user_agent) = configuration.user_agent {
640        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
641    }
642    if let Some(ref token) = configuration.bearer_access_token {
643        req_builder = req_builder.bearer_auth(token.to_owned());
644    };
645
646    let req = req_builder.build()?;
647    let resp = configuration.client.execute(req).await?;
648
649    let status = resp.status();
650    let content_type = resp
651        .headers()
652        .get("content-type")
653        .and_then(|v| v.to_str().ok())
654        .unwrap_or("application/octet-stream");
655    let content_type = super::ContentType::from(content_type);
656
657    if !status.is_client_error() && !status.is_server_error() {
658        let content = resp.text().await?;
659        match content_type {
660            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
661            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PricingModelList`"))),
662            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::PricingModelList`")))),
663        }
664    } else {
665        let content = resp.text().await?;
666        let entity: Option<GetPricingFeaturedError> = serde_json::from_str(&content).ok();
667        Err(Error::ResponseError(ResponseContent { status, content, entity }))
668    }
669}
670
671/// Returns the models that cost nothing to call, filtered to what the caller's org may see. It is the same catalog as ListModels narrowed to entries the pricing source marks free.
672pub async fn get_pricing_free(configuration: &configuration::Configuration, ) -> Result<models::PricingModelList, Error<GetPricingFreeError>> {
673
674    let uri_str = format!("{}/v1/pricing/free", configuration.base_path);
675    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
676
677    if let Some(ref user_agent) = configuration.user_agent {
678        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
679    }
680    if let Some(ref token) = configuration.bearer_access_token {
681        req_builder = req_builder.bearer_auth(token.to_owned());
682    };
683
684    let req = req_builder.build()?;
685    let resp = configuration.client.execute(req).await?;
686
687    let status = resp.status();
688    let content_type = resp
689        .headers()
690        .get("content-type")
691        .and_then(|v| v.to_str().ok())
692        .unwrap_or("application/octet-stream");
693    let content_type = super::ContentType::from(content_type);
694
695    if !status.is_client_error() && !status.is_server_error() {
696        let content = resp.text().await?;
697        match content_type {
698            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
699            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PricingModelList`"))),
700            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::PricingModelList`")))),
701        }
702    } else {
703        let content = resp.text().await?;
704        let entity: Option<GetPricingFreeError> = serde_json::from_str(&content).ok();
705        Err(Error::ResponseError(ResponseContent { status, content, entity }))
706    }
707}
708
709/// ListGPUTiers returns the rentable GPU configurations, each with its accelerator count and model, VRAM, vCPU, host memory and hourly price.
710pub async fn get_pricing_gpu(configuration: &configuration::Configuration, ) -> Result<models::PricingTierList, Error<GetPricingGpuError>> {
711
712    let uri_str = format!("{}/v1/pricing/gpu", configuration.base_path);
713    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
714
715    if let Some(ref user_agent) = configuration.user_agent {
716        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
717    }
718    if let Some(ref token) = configuration.bearer_access_token {
719        req_builder = req_builder.bearer_auth(token.to_owned());
720    };
721
722    let req = req_builder.build()?;
723    let resp = configuration.client.execute(req).await?;
724
725    let status = resp.status();
726    let content_type = resp
727        .headers()
728        .get("content-type")
729        .and_then(|v| v.to_str().ok())
730        .unwrap_or("application/octet-stream");
731    let content_type = super::ContentType::from(content_type);
732
733    if !status.is_client_error() && !status.is_server_error() {
734        let content = resp.text().await?;
735        match content_type {
736            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
737            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PricingTierList`"))),
738            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::PricingTierList`")))),
739        }
740    } else {
741        let content = resp.text().await?;
742        let entity: Option<GetPricingGpuError> = serde_json::from_str(&content).ok();
743        Err(Error::ResponseError(ResponseContent { status, content, entity }))
744    }
745}
746
747/// Health reports that the pricing subsystem is mounted and serving. It answers from the process itself and consults neither the catalog bundle nor the enablement store, so it stays \"ok\" while either is degraded.
748pub async fn get_pricing_health(configuration: &configuration::Configuration, ) -> Result<models::PricingHealth, Error<GetPricingHealthError>> {
749
750    let uri_str = format!("{}/v1/pricing/health", configuration.base_path);
751    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
752
753    if let Some(ref user_agent) = configuration.user_agent {
754        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
755    }
756    if let Some(ref token) = configuration.bearer_access_token {
757        req_builder = req_builder.bearer_auth(token.to_owned());
758    };
759
760    let req = req_builder.build()?;
761    let resp = configuration.client.execute(req).await?;
762
763    let status = resp.status();
764    let content_type = resp
765        .headers()
766        .get("content-type")
767        .and_then(|v| v.to_str().ok())
768        .unwrap_or("application/octet-stream");
769    let content_type = super::ContentType::from(content_type);
770
771    if !status.is_client_error() && !status.is_server_error() {
772        let content = resp.text().await?;
773        match content_type {
774            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
775            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PricingHealth`"))),
776            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::PricingHealth`")))),
777        }
778    } else {
779        let content = resp.text().await?;
780        let entity: Option<GetPricingHealthError> = serde_json::from_str(&content).ok();
781        Err(Error::ResponseError(ResponseContent { status, content, entity }))
782    }
783}
784
785/// ListIAMPlans returns the identity plans — the Hanzo IAM tiers, each with its monthly and annual price, monthly-active-user allowance and feature list.
786pub async fn get_pricing_iam(configuration: &configuration::Configuration, ) -> Result<models::PricingPlanList, Error<GetPricingIamError>> {
787
788    let uri_str = format!("{}/v1/pricing/iam", configuration.base_path);
789    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
790
791    if let Some(ref user_agent) = configuration.user_agent {
792        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
793    }
794    if let Some(ref token) = configuration.bearer_access_token {
795        req_builder = req_builder.bearer_auth(token.to_owned());
796    };
797
798    let req = req_builder.build()?;
799    let resp = configuration.client.execute(req).await?;
800
801    let status = resp.status();
802    let content_type = resp
803        .headers()
804        .get("content-type")
805        .and_then(|v| v.to_str().ok())
806        .unwrap_or("application/octet-stream");
807    let content_type = super::ContentType::from(content_type);
808
809    if !status.is_client_error() && !status.is_server_error() {
810        let content = resp.text().await?;
811        match content_type {
812            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
813            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PricingPlanList`"))),
814            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::PricingPlanList`")))),
815        }
816    } else {
817        let content = resp.text().await?;
818        let entity: Option<GetPricingIamError> = serde_json::from_str(&content).ok();
819        Err(Error::ResponseError(ResponseContent { status, content, entity }))
820    }
821}
822
823/// Returns one model's catalog entry — its pricing, context window and capabilities as the pricing source records them. A model hidden for the caller's org answers the same 404 an unknown name does, so a disabled model gets no existence oracle.
824pub async fn get_pricing_model_by_name(configuration: &configuration::Configuration, name: &str) -> Result<std::collections::HashMap<String, serde_json::Value>, Error<GetPricingModelByNameError>> {
825    // add a prefix to parameters to efficiently prevent name collisions
826    let p_name = name;
827
828    let uri_str = format!("{}/v1/pricing/model/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
829    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
830
831    if let Some(ref user_agent) = configuration.user_agent {
832        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
833    }
834    if let Some(ref token) = configuration.bearer_access_token {
835        req_builder = req_builder.bearer_auth(token.to_owned());
836    };
837
838    let req = req_builder.build()?;
839    let resp = configuration.client.execute(req).await?;
840
841    let status = resp.status();
842    let content_type = resp
843        .headers()
844        .get("content-type")
845        .and_then(|v| v.to_str().ok())
846        .unwrap_or("application/octet-stream");
847    let content_type = super::ContentType::from(content_type);
848
849    if !status.is_client_error() && !status.is_server_error() {
850        let content = resp.text().await?;
851        match content_type {
852            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
853            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`"))),
854            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`")))),
855        }
856    } else {
857        let content = resp.text().await?;
858        let entity: Option<GetPricingModelByNameError> = serde_json::from_str(&content).ok();
859        Err(Error::ResponseError(ResponseContent { status, content, entity }))
860    }
861}
862
863/// Returns the whole model catalog — every model the gateway serves, Zen and third-party alike — filtered to what the caller's org may see. A model an admin has disabled is absent; one in beta appears only for an org granted it. A SuperAdmin sees every model, each annotated with its enablement state.
864pub async fn get_pricing_models(configuration: &configuration::Configuration, ) -> Result<models::PricingModelList, Error<GetPricingModelsError>> {
865
866    let uri_str = format!("{}/v1/pricing/models", configuration.base_path);
867    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
868
869    if let Some(ref user_agent) = configuration.user_agent {
870        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
871    }
872    if let Some(ref token) = configuration.bearer_access_token {
873        req_builder = req_builder.bearer_auth(token.to_owned());
874    };
875
876    let req = req_builder.build()?;
877    let resp = configuration.client.execute(req).await?;
878
879    let status = resp.status();
880    let content_type = resp
881        .headers()
882        .get("content-type")
883        .and_then(|v| v.to_str().ok())
884        .unwrap_or("application/octet-stream");
885    let content_type = super::ContentType::from(content_type);
886
887    if !status.is_client_error() && !status.is_server_error() {
888        let content = resp.text().await?;
889        match content_type {
890            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
891            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PricingModelList`"))),
892            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::PricingModelList`")))),
893        }
894    } else {
895        let content = resp.text().await?;
896        let entity: Option<GetPricingModelsError> = serde_json::from_str(&content).ok();
897        Err(Error::ResponseError(ResponseContent { status, content, entity }))
898    }
899}
900
901/// ListPaaSPlans returns the application-hosting plans — the deploy-and-host tiers, each with its monthly and annual price, app and memory allowances and feature list.
902pub async fn get_pricing_paas(configuration: &configuration::Configuration, ) -> Result<models::PricingPlanList, Error<GetPricingPaasError>> {
903
904    let uri_str = format!("{}/v1/pricing/paas", configuration.base_path);
905    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
906
907    if let Some(ref user_agent) = configuration.user_agent {
908        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
909    }
910    if let Some(ref token) = configuration.bearer_access_token {
911        req_builder = req_builder.bearer_auth(token.to_owned());
912    };
913
914    let req = req_builder.build()?;
915    let resp = configuration.client.execute(req).await?;
916
917    let status = resp.status();
918    let content_type = resp
919        .headers()
920        .get("content-type")
921        .and_then(|v| v.to_str().ok())
922        .unwrap_or("application/octet-stream");
923    let content_type = super::ContentType::from(content_type);
924
925    if !status.is_client_error() && !status.is_server_error() {
926        let content = resp.text().await?;
927        match content_type {
928            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
929            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PricingPlanList`"))),
930            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::PricingPlanList`")))),
931        }
932    } else {
933        let content = resp.text().await?;
934        let entity: Option<GetPricingPaasError> = serde_json::from_str(&content).ok();
935        Err(Error::ResponseError(ResponseContent { status, content, entity }))
936    }
937}
938
939/// Returns the pricing policy document: the revenue-sharing terms (the idle-resale share and the open-source share, each with its percentage and who is eligible) and the commitments Hanzo makes about how it bills — no hidden fees, no egress charges, no surprise bills.
940pub async fn get_pricing_policy(configuration: &configuration::Configuration, ) -> Result<std::collections::HashMap<String, serde_json::Value>, Error<GetPricingPolicyError>> {
941
942    let uri_str = format!("{}/v1/pricing/policy", configuration.base_path);
943    let mut req_builder = configuration.client.request(reqwest::Method::GET, &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
952    let req = req_builder.build()?;
953    let resp = configuration.client.execute(req).await?;
954
955    let status = resp.status();
956    let content_type = resp
957        .headers()
958        .get("content-type")
959        .and_then(|v| v.to_str().ok())
960        .unwrap_or("application/octet-stream");
961    let content_type = super::ContentType::from(content_type);
962
963    if !status.is_client_error() && !status.is_server_error() {
964        let content = resp.text().await?;
965        match content_type {
966            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
967            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`"))),
968            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`")))),
969        }
970    } else {
971        let content = resp.text().await?;
972        let entity: Option<GetPricingPolicyError> = serde_json::from_str(&content).ok();
973        Err(Error::ResponseError(ResponseContent { status, content, entity }))
974    }
975}
976
977/// Returns the model providers the catalog knows, each with its info object, filtered to what the caller's org may see. A provider an admin has disabled is absent — and so are its models everywhere else on this surface, because a provider's state cascades to what it serves.
978pub async fn get_pricing_providers(configuration: &configuration::Configuration, ) -> Result<models::PricingProviderList, Error<GetPricingProvidersError>> {
979
980    let uri_str = format!("{}/v1/pricing/providers", configuration.base_path);
981    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
982
983    if let Some(ref user_agent) = configuration.user_agent {
984        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
985    }
986    if let Some(ref token) = configuration.bearer_access_token {
987        req_builder = req_builder.bearer_auth(token.to_owned());
988    };
989
990    let req = req_builder.build()?;
991    let resp = configuration.client.execute(req).await?;
992
993    let status = resp.status();
994    let content_type = resp
995        .headers()
996        .get("content-type")
997        .and_then(|v| v.to_str().ok())
998        .unwrap_or("application/octet-stream");
999    let content_type = super::ContentType::from(content_type);
1000
1001    if !status.is_client_error() && !status.is_server_error() {
1002        let content = resp.text().await?;
1003        match content_type {
1004            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1005            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PricingProviderList`"))),
1006            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::PricingProviderList`")))),
1007        }
1008    } else {
1009        let content = resp.text().await?;
1010        let entity: Option<GetPricingProvidersError> = serde_json::from_str(&content).ok();
1011        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1012    }
1013}
1014
1015/// Returns the managed-service rate cards — Search, Crawl, Vector, Console and Managed Services — each with its own tiers, and some with usage rates or a comparison table. It is the section as authored, un-gated.  These are DISPLAY rate cards: what a product costs, not what a plan grants. No entitlement or limit fields ride here, so nothing can bill off them.
1016pub async fn get_pricing_services(configuration: &configuration::Configuration, ) -> Result<std::collections::HashMap<String, serde_json::Value>, Error<GetPricingServicesError>> {
1017
1018    let uri_str = format!("{}/v1/pricing/services", configuration.base_path);
1019    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1020
1021    if let Some(ref user_agent) = configuration.user_agent {
1022        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1023    }
1024    if let Some(ref token) = configuration.bearer_access_token {
1025        req_builder = req_builder.bearer_auth(token.to_owned());
1026    };
1027
1028    let req = req_builder.build()?;
1029    let resp = configuration.client.execute(req).await?;
1030
1031    let status = resp.status();
1032    let content_type = resp
1033        .headers()
1034        .get("content-type")
1035        .and_then(|v| v.to_str().ok())
1036        .unwrap_or("application/octet-stream");
1037    let content_type = super::ContentType::from(content_type);
1038
1039    if !status.is_client_error() && !status.is_server_error() {
1040        let content = resp.text().await?;
1041        match content_type {
1042            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1043            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`"))),
1044            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`")))),
1045        }
1046    } else {
1047        let content = resp.text().await?;
1048        let entity: Option<GetPricingServicesError> = serde_json::from_str(&content).ok();
1049        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1050    }
1051}
1052
1053/// Returns the API subscription plans — the account-level tiers a customer subscribes to, each with its monthly and annual price, included credit, rate limits and feature list.
1054pub async fn get_pricing_subscriptions(configuration: &configuration::Configuration, ) -> Result<models::PricingPlanList, Error<GetPricingSubscriptionsError>> {
1055
1056    let uri_str = format!("{}/v1/pricing/subscriptions", configuration.base_path);
1057    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1058
1059    if let Some(ref user_agent) = configuration.user_agent {
1060        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1061    }
1062    if let Some(ref token) = configuration.bearer_access_token {
1063        req_builder = req_builder.bearer_auth(token.to_owned());
1064    };
1065
1066    let req = req_builder.build()?;
1067    let resp = configuration.client.execute(req).await?;
1068
1069    let status = resp.status();
1070    let content_type = resp
1071        .headers()
1072        .get("content-type")
1073        .and_then(|v| v.to_str().ok())
1074        .unwrap_or("application/octet-stream");
1075    let content_type = super::ContentType::from(content_type);
1076
1077    if !status.is_client_error() && !status.is_server_error() {
1078        let content = resp.text().await?;
1079        match content_type {
1080            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1081            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PricingPlanList`"))),
1082            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::PricingPlanList`")))),
1083        }
1084    } else {
1085        let content = resp.text().await?;
1086        let entity: Option<GetPricingSubscriptionsError> = serde_json::from_str(&content).ok();
1087        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1088    }
1089}
1090
1091/// Returns the catalog's headline statistics — model counts by family and the provider directory. The provider sub-object is filtered to what the caller's org may see, so a disabled provider's name never leaks; the aggregate counts are the catalog's own, over everything it holds.
1092pub async fn get_pricing_summary(configuration: &configuration::Configuration, ) -> Result<std::collections::HashMap<String, serde_json::Value>, Error<GetPricingSummaryError>> {
1093
1094    let uri_str = format!("{}/v1/pricing/summary", configuration.base_path);
1095    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1096
1097    if let Some(ref user_agent) = configuration.user_agent {
1098        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1099    }
1100    if let Some(ref token) = configuration.bearer_access_token {
1101        req_builder = req_builder.bearer_auth(token.to_owned());
1102    };
1103
1104    let req = req_builder.build()?;
1105    let resp = configuration.client.execute(req).await?;
1106
1107    let status = resp.status();
1108    let content_type = resp
1109        .headers()
1110        .get("content-type")
1111        .and_then(|v| v.to_str().ok())
1112        .unwrap_or("application/octet-stream");
1113    let content_type = super::ContentType::from(content_type);
1114
1115    if !status.is_client_error() && !status.is_server_error() {
1116        let content = resp.text().await?;
1117        match content_type {
1118            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1119            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`"))),
1120            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `std::collections::HashMap&lt;String, serde_json::Value&gt;`")))),
1121        }
1122    } else {
1123        let content = resp.text().await?;
1124        let entity: Option<GetPricingSummaryError> = serde_json::from_str(&content).ok();
1125        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1126    }
1127}
1128
1129/// Returns the per-use tool prices — web search, code interpreter, file storage, image generation, speech-to-text and text-to-speech — each with the unit it is billed by and its price in that unit.
1130pub async fn get_pricing_tools(configuration: &configuration::Configuration, ) -> Result<models::PricingToolList, Error<GetPricingToolsError>> {
1131
1132    let uri_str = format!("{}/v1/pricing/tools", configuration.base_path);
1133    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1134
1135    if let Some(ref user_agent) = configuration.user_agent {
1136        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1137    }
1138    if let Some(ref token) = configuration.bearer_access_token {
1139        req_builder = req_builder.bearer_auth(token.to_owned());
1140    };
1141
1142    let req = req_builder.build()?;
1143    let resp = configuration.client.execute(req).await?;
1144
1145    let status = resp.status();
1146    let content_type = resp
1147        .headers()
1148        .get("content-type")
1149        .and_then(|v| v.to_str().ok())
1150        .unwrap_or("application/octet-stream");
1151    let content_type = super::ContentType::from(content_type);
1152
1153    if !status.is_client_error() && !status.is_server_error() {
1154        let content = resp.text().await?;
1155        match content_type {
1156            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1157            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PricingToolList`"))),
1158            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::PricingToolList`")))),
1159        }
1160    } else {
1161        let content = resp.text().await?;
1162        let entity: Option<GetPricingToolsError> = serde_json::from_str(&content).ok();
1163        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1164    }
1165}
1166
1167/// Opts the caller's OWN org into a beta item. The org is the caller's validated one, so this can never target another org, and the registry refuses anything not in beta — so it can neither re-open an item an operator turned off nor touch one that is already generally available. Requires a signed-in caller with an org.
1168pub async fn post_pricing_enablement_optin(configuration: &configuration::Configuration, enablement_opt_ref: models::EnablementOptRef) -> Result<models::UserEnablementItem, Error<PostPricingEnablementOptinError>> {
1169    // add a prefix to parameters to efficiently prevent name collisions
1170    let p_enablement_opt_ref = enablement_opt_ref;
1171
1172    let uri_str = format!("{}/v1/pricing/enablement/optin", configuration.base_path);
1173    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1174
1175    if let Some(ref user_agent) = configuration.user_agent {
1176        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1177    }
1178    if let Some(ref token) = configuration.bearer_access_token {
1179        req_builder = req_builder.bearer_auth(token.to_owned());
1180    };
1181    req_builder = req_builder.json(&p_enablement_opt_ref);
1182
1183    let req = req_builder.build()?;
1184    let resp = configuration.client.execute(req).await?;
1185
1186    let status = resp.status();
1187    let content_type = resp
1188        .headers()
1189        .get("content-type")
1190        .and_then(|v| v.to_str().ok())
1191        .unwrap_or("application/octet-stream");
1192    let content_type = super::ContentType::from(content_type);
1193
1194    if !status.is_client_error() && !status.is_server_error() {
1195        let content = resp.text().await?;
1196        match content_type {
1197            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1198            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserEnablementItem`"))),
1199            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::UserEnablementItem`")))),
1200        }
1201    } else {
1202        let content = resp.text().await?;
1203        let entity: Option<PostPricingEnablementOptinError> = serde_json::from_str(&content).ok();
1204        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1205    }
1206}
1207
1208/// Removes the caller's OWN org from a beta item's grant list, the reverse of OptIntoBeta and idempotent. The org is the caller's validated one, so this can never revoke another org's grant. Requires a signed-in caller with an org.
1209pub async fn post_pricing_enablement_optout(configuration: &configuration::Configuration, enablement_opt_ref: models::EnablementOptRef) -> Result<models::UserEnablementItem, Error<PostPricingEnablementOptoutError>> {
1210    // add a prefix to parameters to efficiently prevent name collisions
1211    let p_enablement_opt_ref = enablement_opt_ref;
1212
1213    let uri_str = format!("{}/v1/pricing/enablement/optout", configuration.base_path);
1214    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1215
1216    if let Some(ref user_agent) = configuration.user_agent {
1217        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1218    }
1219    if let Some(ref token) = configuration.bearer_access_token {
1220        req_builder = req_builder.bearer_auth(token.to_owned());
1221    };
1222    req_builder = req_builder.json(&p_enablement_opt_ref);
1223
1224    let req = req_builder.build()?;
1225    let resp = configuration.client.execute(req).await?;
1226
1227    let status = resp.status();
1228    let content_type = resp
1229        .headers()
1230        .get("content-type")
1231        .and_then(|v| v.to_str().ok())
1232        .unwrap_or("application/octet-stream");
1233    let content_type = super::ContentType::from(content_type);
1234
1235    if !status.is_client_error() && !status.is_server_error() {
1236        let content = resp.text().await?;
1237        match content_type {
1238            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1239            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserEnablementItem`"))),
1240            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::UserEnablementItem`")))),
1241        }
1242    } else {
1243        let content = resp.text().await?;
1244        let entity: Option<PostPricingEnablementOptoutError> = serde_json::from_str(&content).ok();
1245        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1246    }
1247}
1248
1249/// Refreshes the third-party section of the catalog from its upstream listings and returns the time the refreshed catalog was stamped with. The fetch runs in Go and the markup transform in the pricing bundle. SuperAdmin only; every other caller is refused.
1250pub async fn post_pricing_sync(configuration: &configuration::Configuration, ) -> Result<models::PricingSyncOut, Error<PostPricingSyncError>> {
1251
1252    let uri_str = format!("{}/v1/pricing/sync", configuration.base_path);
1253    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1254
1255    if let Some(ref user_agent) = configuration.user_agent {
1256        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1257    }
1258    if let Some(ref token) = configuration.bearer_access_token {
1259        req_builder = req_builder.bearer_auth(token.to_owned());
1260    };
1261
1262    let req = req_builder.build()?;
1263    let resp = configuration.client.execute(req).await?;
1264
1265    let status = resp.status();
1266    let content_type = resp
1267        .headers()
1268        .get("content-type")
1269        .and_then(|v| v.to_str().ok())
1270        .unwrap_or("application/octet-stream");
1271    let content_type = super::ContentType::from(content_type);
1272
1273    if !status.is_client_error() && !status.is_server_error() {
1274        let content = resp.text().await?;
1275        match content_type {
1276            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1277            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PricingSyncOut`"))),
1278            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::PricingSyncOut`")))),
1279        }
1280    } else {
1281        let content = resp.text().await?;
1282        let entity: Option<PostPricingSyncError> = serde_json::from_str(&content).ok();
1283        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1284    }
1285}
1286