mattermost_rust_client/apis/
cloud_api.rs

1/*
2 * Mattermost API Reference
3 *
4 * There is also a work-in-progress [Postman API reference](https://documenter.getpostman.com/view/4508214/RW8FERUn). 
5 *
6 * The version of the OpenAPI document: 4.0.0
7 * Contact: feedback@mattermost.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13
14use crate::apis::ResponseContent;
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method [`confirm_customer_payment`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum ConfirmCustomerPaymentError {
22    Status400(crate::models::AppError),
23    Status401(crate::models::AppError),
24    Status403(crate::models::AppError),
25    Status501(crate::models::AppError),
26    UnknownValue(serde_json::Value),
27}
28
29/// struct for typed errors of method [`create_customer_payment`]
30#[derive(Debug, Clone, Serialize, Deserialize)]
31#[serde(untagged)]
32pub enum CreateCustomerPaymentError {
33    Status400(crate::models::AppError),
34    Status401(crate::models::AppError),
35    Status403(crate::models::AppError),
36    Status501(crate::models::AppError),
37    UnknownValue(serde_json::Value),
38}
39
40/// struct for typed errors of method [`get_cloud_customer`]
41#[derive(Debug, Clone, Serialize, Deserialize)]
42#[serde(untagged)]
43pub enum GetCloudCustomerError {
44    Status400(crate::models::AppError),
45    Status401(crate::models::AppError),
46    Status403(crate::models::AppError),
47    Status501(crate::models::AppError),
48    UnknownValue(serde_json::Value),
49}
50
51/// struct for typed errors of method [`get_cloud_limits`]
52#[derive(Debug, Clone, Serialize, Deserialize)]
53#[serde(untagged)]
54pub enum GetCloudLimitsError {
55    Status401(crate::models::AppError),
56    Status500(crate::models::AppError),
57    Status501(crate::models::AppError),
58    UnknownValue(serde_json::Value),
59}
60
61/// struct for typed errors of method [`get_cloud_products`]
62#[derive(Debug, Clone, Serialize, Deserialize)]
63#[serde(untagged)]
64pub enum GetCloudProductsError {
65    Status400(crate::models::AppError),
66    Status401(crate::models::AppError),
67    Status403(crate::models::AppError),
68    Status501(crate::models::AppError),
69    UnknownValue(serde_json::Value),
70}
71
72/// struct for typed errors of method [`get_invoice_for_subscription_as_pdf`]
73#[derive(Debug, Clone, Serialize, Deserialize)]
74#[serde(untagged)]
75pub enum GetInvoiceForSubscriptionAsPdfError {
76    Status400(crate::models::AppError),
77    Status401(crate::models::AppError),
78    Status403(crate::models::AppError),
79    Status501(crate::models::AppError),
80    UnknownValue(serde_json::Value),
81}
82
83/// struct for typed errors of method [`get_invoices_for_subscription`]
84#[derive(Debug, Clone, Serialize, Deserialize)]
85#[serde(untagged)]
86pub enum GetInvoicesForSubscriptionError {
87    Status400(crate::models::AppError),
88    Status401(crate::models::AppError),
89    Status403(crate::models::AppError),
90    Status501(crate::models::AppError),
91    UnknownValue(serde_json::Value),
92}
93
94/// struct for typed errors of method [`get_subscription`]
95#[derive(Debug, Clone, Serialize, Deserialize)]
96#[serde(untagged)]
97pub enum GetSubscriptionError {
98    Status400(crate::models::AppError),
99    Status401(crate::models::AppError),
100    Status403(crate::models::AppError),
101    Status501(crate::models::AppError),
102    UnknownValue(serde_json::Value),
103}
104
105/// struct for typed errors of method [`post_endpoint_for_cws_webhooks`]
106#[derive(Debug, Clone, Serialize, Deserialize)]
107#[serde(untagged)]
108pub enum PostEndpointForCwsWebhooksError {
109    Status400(crate::models::AppError),
110    Status401(crate::models::AppError),
111    Status403(crate::models::AppError),
112    Status501(crate::models::AppError),
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`update_cloud_customer`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum UpdateCloudCustomerError {
120    Status400(crate::models::AppError),
121    Status401(crate::models::AppError),
122    Status403(crate::models::AppError),
123    Status501(crate::models::AppError),
124    UnknownValue(serde_json::Value),
125}
126
127/// struct for typed errors of method [`update_cloud_customer_address`]
128#[derive(Debug, Clone, Serialize, Deserialize)]
129#[serde(untagged)]
130pub enum UpdateCloudCustomerAddressError {
131    Status400(crate::models::AppError),
132    Status401(crate::models::AppError),
133    Status403(crate::models::AppError),
134    Status501(crate::models::AppError),
135    UnknownValue(serde_json::Value),
136}
137
138
139/// Confirms the payment setup intent initiated when posting to `/cloud/payment`. ##### Permissions Must have `manage_system` permission and be licensed for Cloud. __Minimum server version__: 5.28 __Note:__ This is intended for internal use and is subject to change. 
140pub async fn confirm_customer_payment(configuration: &configuration::Configuration, stripe_setup_intent_id: Option<&str>) -> Result<(), Error<ConfirmCustomerPaymentError>> {
141    let local_var_configuration = configuration;
142
143    let local_var_client = &local_var_configuration.client;
144
145    let local_var_uri_str = format!("{}/cloud/payment/confirm", local_var_configuration.base_path);
146    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
147
148    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
149        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
150    }
151    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
152        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
153    };
154    let mut local_var_form = reqwest::multipart::Form::new();
155    if let Some(local_var_param_value) = stripe_setup_intent_id {
156        local_var_form = local_var_form.text("stripe_setup_intent_id", local_var_param_value.to_string());
157    }
158    local_var_req_builder = local_var_req_builder.multipart(local_var_form);
159
160    let local_var_req = local_var_req_builder.build()?;
161    let local_var_resp = local_var_client.execute(local_var_req).await?;
162
163    let local_var_status = local_var_resp.status();
164    let local_var_content = local_var_resp.text().await?;
165
166    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
167        Ok(())
168    } else {
169        let local_var_entity: Option<ConfirmCustomerPaymentError> = serde_json::from_str(&local_var_content).ok();
170        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
171        Err(Error::ResponseError(local_var_error))
172    }
173}
174
175/// Creates a customer setup payment intent for the given Mattermost cloud installation.  ##### Permissions  Must have `manage_system` permission and be licensed for Cloud.  __Minimum server version__: 5.28 __Note:__: This is intended for internal use and is subject to change. 
176pub async fn create_customer_payment(configuration: &configuration::Configuration, ) -> Result<crate::models::PaymentSetupIntent, Error<CreateCustomerPaymentError>> {
177    let local_var_configuration = configuration;
178
179    let local_var_client = &local_var_configuration.client;
180
181    let local_var_uri_str = format!("{}/cloud/payment", local_var_configuration.base_path);
182    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
183
184    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
185        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
186    }
187    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
188        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
189    };
190
191    let local_var_req = local_var_req_builder.build()?;
192    let local_var_resp = local_var_client.execute(local_var_req).await?;
193
194    let local_var_status = local_var_resp.status();
195    let local_var_content = local_var_resp.text().await?;
196
197    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
198        serde_json::from_str(&local_var_content).map_err(Error::from)
199    } else {
200        let local_var_entity: Option<CreateCustomerPaymentError> = serde_json::from_str(&local_var_content).ok();
201        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
202        Err(Error::ResponseError(local_var_error))
203    }
204}
205
206/// Retrieves the customer information for the Mattermost Cloud customer bound to this installation. ##### Permissions Must have `manage_system` permission and be licensed for Cloud. __Minimum server version__: 5.28 __Note:__ This is intended for internal use and is subject to change. 
207pub async fn get_cloud_customer(configuration: &configuration::Configuration, ) -> Result<crate::models::CloudCustomer, Error<GetCloudCustomerError>> {
208    let local_var_configuration = configuration;
209
210    let local_var_client = &local_var_configuration.client;
211
212    let local_var_uri_str = format!("{}/cloud/customer", local_var_configuration.base_path);
213    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
214
215    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
216        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
217    }
218    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
219        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
220    };
221
222    let local_var_req = local_var_req_builder.build()?;
223    let local_var_resp = local_var_client.execute(local_var_req).await?;
224
225    let local_var_status = local_var_resp.status();
226    let local_var_content = local_var_resp.text().await?;
227
228    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
229        serde_json::from_str(&local_var_content).map_err(Error::from)
230    } else {
231        let local_var_entity: Option<GetCloudCustomerError> = serde_json::from_str(&local_var_content).ok();
232        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
233        Err(Error::ResponseError(local_var_error))
234    }
235}
236
237/// Retrieve any cloud workspace limits applicable to this instance. ##### Permissions Must be authenticated and be licensed for Cloud. __Minimum server version__: 7.0 __Note:__ This is intended for internal use and is subject to change. 
238pub async fn get_cloud_limits(configuration: &configuration::Configuration, ) -> Result<crate::models::ProductLimits, Error<GetCloudLimitsError>> {
239    let local_var_configuration = configuration;
240
241    let local_var_client = &local_var_configuration.client;
242
243    let local_var_uri_str = format!("{}/cloud/limits", local_var_configuration.base_path);
244    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
245
246    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
247        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
248    }
249    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
250        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
251    };
252
253    let local_var_req = local_var_req_builder.build()?;
254    let local_var_resp = local_var_client.execute(local_var_req).await?;
255
256    let local_var_status = local_var_resp.status();
257    let local_var_content = local_var_resp.text().await?;
258
259    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
260        serde_json::from_str(&local_var_content).map_err(Error::from)
261    } else {
262        let local_var_entity: Option<GetCloudLimitsError> = serde_json::from_str(&local_var_content).ok();
263        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
264        Err(Error::ResponseError(local_var_error))
265    }
266}
267
268/// Retrieve a list of all products that are offered for Mattermost Cloud. ##### Permissions Must have `manage_system` permission and be licensed for Cloud. __Minimum server version__: 5.28 __Note:__ This is intended for internal use and is subject to change. 
269pub async fn get_cloud_products(configuration: &configuration::Configuration, ) -> Result<Vec<crate::models::Product>, Error<GetCloudProductsError>> {
270    let local_var_configuration = configuration;
271
272    let local_var_client = &local_var_configuration.client;
273
274    let local_var_uri_str = format!("{}/cloud/products", local_var_configuration.base_path);
275    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
276
277    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
278        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
279    }
280    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
281        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
282    };
283
284    let local_var_req = local_var_req_builder.build()?;
285    let local_var_resp = local_var_client.execute(local_var_req).await?;
286
287    let local_var_status = local_var_resp.status();
288    let local_var_content = local_var_resp.text().await?;
289
290    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
291        serde_json::from_str(&local_var_content).map_err(Error::from)
292    } else {
293        let local_var_entity: Option<GetCloudProductsError> = serde_json::from_str(&local_var_content).ok();
294        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
295        Err(Error::ResponseError(local_var_error))
296    }
297}
298
299/// Retrieves the PDF for the invoice passed as parameter ##### Permissions Must have `manage_system` permission and be licensed for Cloud. __Minimum server version__: 5.30 __Note:__ This is intended for internal use and is subject to change. 
300pub async fn get_invoice_for_subscription_as_pdf(configuration: &configuration::Configuration, invoice_id: &str) -> Result<(), Error<GetInvoiceForSubscriptionAsPdfError>> {
301    let local_var_configuration = configuration;
302
303    let local_var_client = &local_var_configuration.client;
304
305    let local_var_uri_str = format!("{}/cloud/subscription/invoices/{invoice_id}/pdf", local_var_configuration.base_path, invoice_id=crate::apis::urlencode(invoice_id));
306    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
307
308    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
309        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
310    }
311    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
312        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
313    };
314
315    let local_var_req = local_var_req_builder.build()?;
316    let local_var_resp = local_var_client.execute(local_var_req).await?;
317
318    let local_var_status = local_var_resp.status();
319    let local_var_content = local_var_resp.text().await?;
320
321    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
322        Ok(())
323    } else {
324        let local_var_entity: Option<GetInvoiceForSubscriptionAsPdfError> = serde_json::from_str(&local_var_content).ok();
325        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
326        Err(Error::ResponseError(local_var_error))
327    }
328}
329
330/// Retrieves the invoices for the subscription bound to this installation. ##### Permissions Must have `manage_system` permission and be licensed for Cloud. __Minimum server version__: 5.30 __Note:__ This is intended for internal use and is subject to change. 
331pub async fn get_invoices_for_subscription(configuration: &configuration::Configuration, ) -> Result<Vec<crate::models::Invoice>, Error<GetInvoicesForSubscriptionError>> {
332    let local_var_configuration = configuration;
333
334    let local_var_client = &local_var_configuration.client;
335
336    let local_var_uri_str = format!("{}/cloud/subscription/invoices", local_var_configuration.base_path);
337    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
338
339    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
340        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
341    }
342    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
343        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
344    };
345
346    let local_var_req = local_var_req_builder.build()?;
347    let local_var_resp = local_var_client.execute(local_var_req).await?;
348
349    let local_var_status = local_var_resp.status();
350    let local_var_content = local_var_resp.text().await?;
351
352    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
353        serde_json::from_str(&local_var_content).map_err(Error::from)
354    } else {
355        let local_var_entity: Option<GetInvoicesForSubscriptionError> = serde_json::from_str(&local_var_content).ok();
356        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
357        Err(Error::ResponseError(local_var_error))
358    }
359}
360
361/// Retrieves the subscription information for the Mattermost Cloud customer bound to this installation. ##### Permissions Must have `manage_system` permission and be licensed for Cloud. __Minimum server version__: 5.28 __Note:__ This is intended for internal use and is subject to change. 
362pub async fn get_subscription(configuration: &configuration::Configuration, ) -> Result<crate::models::Subscription, Error<GetSubscriptionError>> {
363    let local_var_configuration = configuration;
364
365    let local_var_client = &local_var_configuration.client;
366
367    let local_var_uri_str = format!("{}/cloud/subscription", local_var_configuration.base_path);
368    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
369
370    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
371        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
372    }
373    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
374        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
375    };
376
377    let local_var_req = local_var_req_builder.build()?;
378    let local_var_resp = local_var_client.execute(local_var_req).await?;
379
380    let local_var_status = local_var_resp.status();
381    let local_var_content = local_var_resp.text().await?;
382
383    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
384        serde_json::from_str(&local_var_content).map_err(Error::from)
385    } else {
386        let local_var_entity: Option<GetSubscriptionError> = serde_json::from_str(&local_var_content).ok();
387        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
388        Err(Error::ResponseError(local_var_error))
389    }
390}
391
392/// An endpoint for processing webhooks from the Customer Portal ##### Permissions This endpoint should only be accessed by CWS, in a Mattermost Cloud instance __Minimum server version__: 5.30 __Note:__ This is intended for internal use and is subject to change. 
393pub async fn post_endpoint_for_cws_webhooks(configuration: &configuration::Configuration, ) -> Result<(), Error<PostEndpointForCwsWebhooksError>> {
394    let local_var_configuration = configuration;
395
396    let local_var_client = &local_var_configuration.client;
397
398    let local_var_uri_str = format!("{}/cloud/webhook", local_var_configuration.base_path);
399    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
400
401    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
402        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
403    }
404    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
405        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
406    };
407
408    let local_var_req = local_var_req_builder.build()?;
409    let local_var_resp = local_var_client.execute(local_var_req).await?;
410
411    let local_var_status = local_var_resp.status();
412    let local_var_content = local_var_resp.text().await?;
413
414    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
415        Ok(())
416    } else {
417        let local_var_entity: Option<PostEndpointForCwsWebhooksError> = serde_json::from_str(&local_var_content).ok();
418        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
419        Err(Error::ResponseError(local_var_error))
420    }
421}
422
423/// Updates the customer information for the Mattermost Cloud customer bound to this installation. ##### Permissions Must have `manage_system` permission and be licensed for Cloud. __Minimum server version__: 5.29 __Note:__ This is intended for internal use and is subject to change. 
424pub async fn update_cloud_customer(configuration: &configuration::Configuration, update_cloud_customer_request: crate::models::UpdateCloudCustomerRequest) -> Result<crate::models::CloudCustomer, Error<UpdateCloudCustomerError>> {
425    let local_var_configuration = configuration;
426
427    let local_var_client = &local_var_configuration.client;
428
429    let local_var_uri_str = format!("{}/cloud/customer", local_var_configuration.base_path);
430    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
431
432    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
433        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
434    }
435    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
436        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
437    };
438    local_var_req_builder = local_var_req_builder.json(&update_cloud_customer_request);
439
440    let local_var_req = local_var_req_builder.build()?;
441    let local_var_resp = local_var_client.execute(local_var_req).await?;
442
443    let local_var_status = local_var_resp.status();
444    let local_var_content = local_var_resp.text().await?;
445
446    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
447        serde_json::from_str(&local_var_content).map_err(Error::from)
448    } else {
449        let local_var_entity: Option<UpdateCloudCustomerError> = serde_json::from_str(&local_var_content).ok();
450        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
451        Err(Error::ResponseError(local_var_error))
452    }
453}
454
455/// Updates the company address for the Mattermost Cloud customer bound to this installation. ##### Permissions Must have `manage_system` permission and be licensed for Cloud. __Minimum server version__: 5.29 __Note:__ This is intended for internal use and is subject to change. 
456pub async fn update_cloud_customer_address(configuration: &configuration::Configuration, address: crate::models::Address) -> Result<crate::models::CloudCustomer, Error<UpdateCloudCustomerAddressError>> {
457    let local_var_configuration = configuration;
458
459    let local_var_client = &local_var_configuration.client;
460
461    let local_var_uri_str = format!("{}/cloud/customer/address", local_var_configuration.base_path);
462    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
463
464    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
465        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
466    }
467    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
468        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
469    };
470    local_var_req_builder = local_var_req_builder.json(&address);
471
472    let local_var_req = local_var_req_builder.build()?;
473    let local_var_resp = local_var_client.execute(local_var_req).await?;
474
475    let local_var_status = local_var_resp.status();
476    let local_var_content = local_var_resp.text().await?;
477
478    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
479        serde_json::from_str(&local_var_content).map_err(Error::from)
480    } else {
481        let local_var_entity: Option<UpdateCloudCustomerAddressError> = serde_json::from_str(&local_var_content).ok();
482        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
483        Err(Error::ResponseError(local_var_error))
484    }
485}
486