zsgf_client/apis/
service_setting_api.rs

1/*
2 * 全部  API 文档
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
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 [`service_setting`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum ServiceSettingError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`service_setting_delete`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum ServiceSettingDeleteError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`service_setting_group`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum ServiceSettingGroupError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`service_setting_group_delete`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum ServiceSettingGroupDeleteError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`service_setting_group_post`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum ServiceSettingGroupPostError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`service_setting_group_put`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum ServiceSettingGroupPutError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`service_setting_groups`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum ServiceSettingGroupsError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`service_setting_item`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum ServiceSettingItemError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`service_setting_item_delete`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum ServiceSettingItemDeleteError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`service_setting_item_post`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum ServiceSettingItemPostError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`service_setting_item_put`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum ServiceSettingItemPutError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`service_setting_items`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum ServiceSettingItemsError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`service_setting_post`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum ServiceSettingPostError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`service_setting_provider`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum ServiceSettingProviderError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`service_setting_provider_delete`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum ServiceSettingProviderDeleteError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`service_setting_provider_post`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum ServiceSettingProviderPostError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`service_setting_provider_put`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum ServiceSettingProviderPutError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`service_setting_providers`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum ServiceSettingProvidersError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`service_setting_put`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum ServiceSettingPutError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`service_settings`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum ServiceSettingsError {
155    UnknownValue(serde_json::Value),
156}
157
158
159/// 根据配置ID获取配置详情
160pub async fn service_setting(configuration: &configuration::Configuration, id: i64) -> Result<models::SettingsApiResponse, Error<ServiceSettingError>> {
161    // add a prefix to parameters to efficiently prevent name collisions
162    let p_id = id;
163
164    let uri_str = format!("{}/ServiceSetting/{id}", configuration.base_path, id=p_id);
165    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
166
167    if let Some(ref user_agent) = configuration.user_agent {
168        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
169    }
170    if let Some(ref token) = configuration.bearer_access_token {
171        req_builder = req_builder.bearer_auth(token.to_owned());
172    };
173
174    let req = req_builder.build()?;
175    let resp = configuration.client.execute(req).await?;
176
177    let status = resp.status();
178    let content_type = resp
179        .headers()
180        .get("content-type")
181        .and_then(|v| v.to_str().ok())
182        .unwrap_or("application/octet-stream");
183    let content_type = super::ContentType::from(content_type);
184
185    if !status.is_client_error() && !status.is_server_error() {
186        let content = resp.text().await?;
187        match content_type {
188            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
189            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SettingsApiResponse`"))),
190            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::SettingsApiResponse`")))),
191        }
192    } else {
193        let content = resp.text().await?;
194        let entity: Option<ServiceSettingError> = serde_json::from_str(&content).ok();
195        Err(Error::ResponseError(ResponseContent { status, content, entity }))
196    }
197}
198
199/// 根据配置ID删除配置
200pub async fn service_setting_delete(configuration: &configuration::Configuration, id: i64) -> Result<models::BooleanApiResponse, Error<ServiceSettingDeleteError>> {
201    // add a prefix to parameters to efficiently prevent name collisions
202    let p_id = id;
203
204    let uri_str = format!("{}/ServiceSetting/{id}", configuration.base_path, id=p_id);
205    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
206
207    if let Some(ref user_agent) = configuration.user_agent {
208        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
209    }
210    if let Some(ref token) = configuration.bearer_access_token {
211        req_builder = req_builder.bearer_auth(token.to_owned());
212    };
213
214    let req = req_builder.build()?;
215    let resp = configuration.client.execute(req).await?;
216
217    let status = resp.status();
218    let content_type = resp
219        .headers()
220        .get("content-type")
221        .and_then(|v| v.to_str().ok())
222        .unwrap_or("application/octet-stream");
223    let content_type = super::ContentType::from(content_type);
224
225    if !status.is_client_error() && !status.is_server_error() {
226        let content = resp.text().await?;
227        match content_type {
228            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
229            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
230            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::BooleanApiResponse`")))),
231        }
232    } else {
233        let content = resp.text().await?;
234        let entity: Option<ServiceSettingDeleteError> = serde_json::from_str(&content).ok();
235        Err(Error::ResponseError(ResponseContent { status, content, entity }))
236    }
237}
238
239/// 根据服务分组ID获取服务分组详情
240pub async fn service_setting_group(configuration: &configuration::Configuration, id: i64) -> Result<models::ServiceGroupApiResponse, Error<ServiceSettingGroupError>> {
241    // add a prefix to parameters to efficiently prevent name collisions
242    let p_id = id;
243
244    let uri_str = format!("{}/ServiceSetting/Groups/{id}", configuration.base_path, id=p_id);
245    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
246
247    if let Some(ref user_agent) = configuration.user_agent {
248        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
249    }
250    if let Some(ref token) = configuration.bearer_access_token {
251        req_builder = req_builder.bearer_auth(token.to_owned());
252    };
253
254    let req = req_builder.build()?;
255    let resp = configuration.client.execute(req).await?;
256
257    let status = resp.status();
258    let content_type = resp
259        .headers()
260        .get("content-type")
261        .and_then(|v| v.to_str().ok())
262        .unwrap_or("application/octet-stream");
263    let content_type = super::ContentType::from(content_type);
264
265    if !status.is_client_error() && !status.is_server_error() {
266        let content = resp.text().await?;
267        match content_type {
268            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
269            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceGroupApiResponse`"))),
270            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::ServiceGroupApiResponse`")))),
271        }
272    } else {
273        let content = resp.text().await?;
274        let entity: Option<ServiceSettingGroupError> = serde_json::from_str(&content).ok();
275        Err(Error::ResponseError(ResponseContent { status, content, entity }))
276    }
277}
278
279/// 根据服务分组ID删除服务分组
280pub async fn service_setting_group_delete(configuration: &configuration::Configuration, id: i64) -> Result<models::BooleanApiResponse, Error<ServiceSettingGroupDeleteError>> {
281    // add a prefix to parameters to efficiently prevent name collisions
282    let p_id = id;
283
284    let uri_str = format!("{}/ServiceSetting/Groups/{id}", configuration.base_path, id=p_id);
285    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
286
287    if let Some(ref user_agent) = configuration.user_agent {
288        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
289    }
290    if let Some(ref token) = configuration.bearer_access_token {
291        req_builder = req_builder.bearer_auth(token.to_owned());
292    };
293
294    let req = req_builder.build()?;
295    let resp = configuration.client.execute(req).await?;
296
297    let status = resp.status();
298    let content_type = resp
299        .headers()
300        .get("content-type")
301        .and_then(|v| v.to_str().ok())
302        .unwrap_or("application/octet-stream");
303    let content_type = super::ContentType::from(content_type);
304
305    if !status.is_client_error() && !status.is_server_error() {
306        let content = resp.text().await?;
307        match content_type {
308            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
309            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
310            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::BooleanApiResponse`")))),
311        }
312    } else {
313        let content = resp.text().await?;
314        let entity: Option<ServiceSettingGroupDeleteError> = serde_json::from_str(&content).ok();
315        Err(Error::ResponseError(ResponseContent { status, content, entity }))
316    }
317}
318
319/// 添加新的服务分组
320pub async fn service_setting_group_post(configuration: &configuration::Configuration, service_group: Option<models::ServiceGroup>) -> Result<models::ServiceSettingGroupPostResultApiResponse, Error<ServiceSettingGroupPostError>> {
321    // add a prefix to parameters to efficiently prevent name collisions
322    let p_service_group = service_group;
323
324    let uri_str = format!("{}/ServiceSetting/Groups", configuration.base_path);
325    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
326
327    if let Some(ref user_agent) = configuration.user_agent {
328        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
329    }
330    if let Some(ref token) = configuration.bearer_access_token {
331        req_builder = req_builder.bearer_auth(token.to_owned());
332    };
333    req_builder = req_builder.json(&p_service_group);
334
335    let req = req_builder.build()?;
336    let resp = configuration.client.execute(req).await?;
337
338    let status = resp.status();
339    let content_type = resp
340        .headers()
341        .get("content-type")
342        .and_then(|v| v.to_str().ok())
343        .unwrap_or("application/octet-stream");
344    let content_type = super::ContentType::from(content_type);
345
346    if !status.is_client_error() && !status.is_server_error() {
347        let content = resp.text().await?;
348        match content_type {
349            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
350            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceSettingGroupPostResultApiResponse`"))),
351            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::ServiceSettingGroupPostResultApiResponse`")))),
352        }
353    } else {
354        let content = resp.text().await?;
355        let entity: Option<ServiceSettingGroupPostError> = serde_json::from_str(&content).ok();
356        Err(Error::ResponseError(ResponseContent { status, content, entity }))
357    }
358}
359
360/// 根据服务分组ID更新服务分组信息
361pub async fn service_setting_group_put(configuration: &configuration::Configuration, id: i64, service_group: Option<models::ServiceGroup>) -> Result<models::BooleanApiResponse, Error<ServiceSettingGroupPutError>> {
362    // add a prefix to parameters to efficiently prevent name collisions
363    let p_id = id;
364    let p_service_group = service_group;
365
366    let uri_str = format!("{}/ServiceSetting/Groups/{id}", configuration.base_path, id=p_id);
367    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
368
369    if let Some(ref user_agent) = configuration.user_agent {
370        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
371    }
372    if let Some(ref token) = configuration.bearer_access_token {
373        req_builder = req_builder.bearer_auth(token.to_owned());
374    };
375    req_builder = req_builder.json(&p_service_group);
376
377    let req = req_builder.build()?;
378    let resp = configuration.client.execute(req).await?;
379
380    let status = resp.status();
381    let content_type = resp
382        .headers()
383        .get("content-type")
384        .and_then(|v| v.to_str().ok())
385        .unwrap_or("application/octet-stream");
386    let content_type = super::ContentType::from(content_type);
387
388    if !status.is_client_error() && !status.is_server_error() {
389        let content = resp.text().await?;
390        match content_type {
391            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
392            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
393            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::BooleanApiResponse`")))),
394        }
395    } else {
396        let content = resp.text().await?;
397        let entity: Option<ServiceSettingGroupPutError> = serde_json::from_str(&content).ok();
398        Err(Error::ResponseError(ResponseContent { status, content, entity }))
399    }
400}
401
402/// 根据服务商ID和显示标志获取服务分组列表
403pub async fn service_setting_groups(configuration: &configuration::Configuration, provider_id: Option<i64>, show_flag: Option<bool>) -> Result<models::ServiceGroupListApiResponse, Error<ServiceSettingGroupsError>> {
404    // add a prefix to parameters to efficiently prevent name collisions
405    let p_provider_id = provider_id;
406    let p_show_flag = show_flag;
407
408    let uri_str = format!("{}/ServiceSetting/Groups", configuration.base_path);
409    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
410
411    if let Some(ref param_value) = p_provider_id {
412        req_builder = req_builder.query(&[("providerId", &param_value.to_string())]);
413    }
414    if let Some(ref param_value) = p_show_flag {
415        req_builder = req_builder.query(&[("showFlag", &param_value.to_string())]);
416    }
417    if let Some(ref user_agent) = configuration.user_agent {
418        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
419    }
420    if let Some(ref token) = configuration.bearer_access_token {
421        req_builder = req_builder.bearer_auth(token.to_owned());
422    };
423
424    let req = req_builder.build()?;
425    let resp = configuration.client.execute(req).await?;
426
427    let status = resp.status();
428    let content_type = resp
429        .headers()
430        .get("content-type")
431        .and_then(|v| v.to_str().ok())
432        .unwrap_or("application/octet-stream");
433    let content_type = super::ContentType::from(content_type);
434
435    if !status.is_client_error() && !status.is_server_error() {
436        let content = resp.text().await?;
437        match content_type {
438            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
439            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceGroupListApiResponse`"))),
440            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::ServiceGroupListApiResponse`")))),
441        }
442    } else {
443        let content = resp.text().await?;
444        let entity: Option<ServiceSettingGroupsError> = serde_json::from_str(&content).ok();
445        Err(Error::ResponseError(ResponseContent { status, content, entity }))
446    }
447}
448
449/// 根据服务配置ID获取服务配置详情
450pub async fn service_setting_item(configuration: &configuration::Configuration, id: i64) -> Result<models::ServiceItemApiResponse, Error<ServiceSettingItemError>> {
451    // add a prefix to parameters to efficiently prevent name collisions
452    let p_id = id;
453
454    let uri_str = format!("{}/ServiceSetting/Items/{id}", configuration.base_path, id=p_id);
455    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
456
457    if let Some(ref user_agent) = configuration.user_agent {
458        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
459    }
460    if let Some(ref token) = configuration.bearer_access_token {
461        req_builder = req_builder.bearer_auth(token.to_owned());
462    };
463
464    let req = req_builder.build()?;
465    let resp = configuration.client.execute(req).await?;
466
467    let status = resp.status();
468    let content_type = resp
469        .headers()
470        .get("content-type")
471        .and_then(|v| v.to_str().ok())
472        .unwrap_or("application/octet-stream");
473    let content_type = super::ContentType::from(content_type);
474
475    if !status.is_client_error() && !status.is_server_error() {
476        let content = resp.text().await?;
477        match content_type {
478            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
479            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceItemApiResponse`"))),
480            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::ServiceItemApiResponse`")))),
481        }
482    } else {
483        let content = resp.text().await?;
484        let entity: Option<ServiceSettingItemError> = serde_json::from_str(&content).ok();
485        Err(Error::ResponseError(ResponseContent { status, content, entity }))
486    }
487}
488
489/// 根据服务配置ID删除服务配置
490pub async fn service_setting_item_delete(configuration: &configuration::Configuration, id: i64) -> Result<models::BooleanApiResponse, Error<ServiceSettingItemDeleteError>> {
491    // add a prefix to parameters to efficiently prevent name collisions
492    let p_id = id;
493
494    let uri_str = format!("{}/ServiceSetting/Items/{id}", configuration.base_path, id=p_id);
495    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
496
497    if let Some(ref user_agent) = configuration.user_agent {
498        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
499    }
500    if let Some(ref token) = configuration.bearer_access_token {
501        req_builder = req_builder.bearer_auth(token.to_owned());
502    };
503
504    let req = req_builder.build()?;
505    let resp = configuration.client.execute(req).await?;
506
507    let status = resp.status();
508    let content_type = resp
509        .headers()
510        .get("content-type")
511        .and_then(|v| v.to_str().ok())
512        .unwrap_or("application/octet-stream");
513    let content_type = super::ContentType::from(content_type);
514
515    if !status.is_client_error() && !status.is_server_error() {
516        let content = resp.text().await?;
517        match content_type {
518            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
519            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
520            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::BooleanApiResponse`")))),
521        }
522    } else {
523        let content = resp.text().await?;
524        let entity: Option<ServiceSettingItemDeleteError> = serde_json::from_str(&content).ok();
525        Err(Error::ResponseError(ResponseContent { status, content, entity }))
526    }
527}
528
529/// 添加新的服务配置
530pub async fn service_setting_item_post(configuration: &configuration::Configuration, service_item: Option<models::ServiceItem>) -> Result<models::ServiceSettingItemPostResultApiResponse, Error<ServiceSettingItemPostError>> {
531    // add a prefix to parameters to efficiently prevent name collisions
532    let p_service_item = service_item;
533
534    let uri_str = format!("{}/ServiceSetting/Items", configuration.base_path);
535    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
536
537    if let Some(ref user_agent) = configuration.user_agent {
538        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
539    }
540    if let Some(ref token) = configuration.bearer_access_token {
541        req_builder = req_builder.bearer_auth(token.to_owned());
542    };
543    req_builder = req_builder.json(&p_service_item);
544
545    let req = req_builder.build()?;
546    let resp = configuration.client.execute(req).await?;
547
548    let status = resp.status();
549    let content_type = resp
550        .headers()
551        .get("content-type")
552        .and_then(|v| v.to_str().ok())
553        .unwrap_or("application/octet-stream");
554    let content_type = super::ContentType::from(content_type);
555
556    if !status.is_client_error() && !status.is_server_error() {
557        let content = resp.text().await?;
558        match content_type {
559            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
560            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceSettingItemPostResultApiResponse`"))),
561            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::ServiceSettingItemPostResultApiResponse`")))),
562        }
563    } else {
564        let content = resp.text().await?;
565        let entity: Option<ServiceSettingItemPostError> = serde_json::from_str(&content).ok();
566        Err(Error::ResponseError(ResponseContent { status, content, entity }))
567    }
568}
569
570/// 根据服务配置ID更新服务配置信息
571pub async fn service_setting_item_put(configuration: &configuration::Configuration, id: i64, service_item: Option<models::ServiceItem>) -> Result<models::BooleanApiResponse, Error<ServiceSettingItemPutError>> {
572    // add a prefix to parameters to efficiently prevent name collisions
573    let p_id = id;
574    let p_service_item = service_item;
575
576    let uri_str = format!("{}/ServiceSetting/Items/{id}", configuration.base_path, id=p_id);
577    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
578
579    if let Some(ref user_agent) = configuration.user_agent {
580        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
581    }
582    if let Some(ref token) = configuration.bearer_access_token {
583        req_builder = req_builder.bearer_auth(token.to_owned());
584    };
585    req_builder = req_builder.json(&p_service_item);
586
587    let req = req_builder.build()?;
588    let resp = configuration.client.execute(req).await?;
589
590    let status = resp.status();
591    let content_type = resp
592        .headers()
593        .get("content-type")
594        .and_then(|v| v.to_str().ok())
595        .unwrap_or("application/octet-stream");
596    let content_type = super::ContentType::from(content_type);
597
598    if !status.is_client_error() && !status.is_server_error() {
599        let content = resp.text().await?;
600        match content_type {
601            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
602            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
603            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BooleanApiResponse`")))),
604        }
605    } else {
606        let content = resp.text().await?;
607        let entity: Option<ServiceSettingItemPutError> = serde_json::from_str(&content).ok();
608        Err(Error::ResponseError(ResponseContent { status, content, entity }))
609    }
610}
611
612/// 根据业务代码、服务商代码、分组代码和显示标志获取服务配置列表
613pub async fn service_setting_items(configuration: &configuration::Configuration, biz_code: Option<&str>, provider_code: Option<&str>, group_code: Option<&str>, show_flag: Option<bool>) -> Result<models::ServiceItemListApiResponse, Error<ServiceSettingItemsError>> {
614    // add a prefix to parameters to efficiently prevent name collisions
615    let p_biz_code = biz_code;
616    let p_provider_code = provider_code;
617    let p_group_code = group_code;
618    let p_show_flag = show_flag;
619
620    let uri_str = format!("{}/ServiceSetting/Items", configuration.base_path);
621    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
622
623    if let Some(ref param_value) = p_biz_code {
624        req_builder = req_builder.query(&[("bizCode", &param_value.to_string())]);
625    }
626    if let Some(ref param_value) = p_provider_code {
627        req_builder = req_builder.query(&[("providerCode", &param_value.to_string())]);
628    }
629    if let Some(ref param_value) = p_group_code {
630        req_builder = req_builder.query(&[("groupCode", &param_value.to_string())]);
631    }
632    if let Some(ref param_value) = p_show_flag {
633        req_builder = req_builder.query(&[("showFlag", &param_value.to_string())]);
634    }
635    if let Some(ref user_agent) = configuration.user_agent {
636        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
637    }
638    if let Some(ref token) = configuration.bearer_access_token {
639        req_builder = req_builder.bearer_auth(token.to_owned());
640    };
641
642    let req = req_builder.build()?;
643    let resp = configuration.client.execute(req).await?;
644
645    let status = resp.status();
646    let content_type = resp
647        .headers()
648        .get("content-type")
649        .and_then(|v| v.to_str().ok())
650        .unwrap_or("application/octet-stream");
651    let content_type = super::ContentType::from(content_type);
652
653    if !status.is_client_error() && !status.is_server_error() {
654        let content = resp.text().await?;
655        match content_type {
656            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
657            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceItemListApiResponse`"))),
658            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::ServiceItemListApiResponse`")))),
659        }
660    } else {
661        let content = resp.text().await?;
662        let entity: Option<ServiceSettingItemsError> = serde_json::from_str(&content).ok();
663        Err(Error::ResponseError(ResponseContent { status, content, entity }))
664    }
665}
666
667/// 添加新的配置
668pub async fn service_setting_post(configuration: &configuration::Configuration, settings: Option<models::Settings>) -> Result<models::ServiceSettingSettingPostResultApiResponse, Error<ServiceSettingPostError>> {
669    // add a prefix to parameters to efficiently prevent name collisions
670    let p_settings = settings;
671
672    let uri_str = format!("{}/ServiceSetting", configuration.base_path);
673    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
674
675    if let Some(ref user_agent) = configuration.user_agent {
676        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
677    }
678    if let Some(ref token) = configuration.bearer_access_token {
679        req_builder = req_builder.bearer_auth(token.to_owned());
680    };
681    req_builder = req_builder.json(&p_settings);
682
683    let req = req_builder.build()?;
684    let resp = configuration.client.execute(req).await?;
685
686    let status = resp.status();
687    let content_type = resp
688        .headers()
689        .get("content-type")
690        .and_then(|v| v.to_str().ok())
691        .unwrap_or("application/octet-stream");
692    let content_type = super::ContentType::from(content_type);
693
694    if !status.is_client_error() && !status.is_server_error() {
695        let content = resp.text().await?;
696        match content_type {
697            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
698            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceSettingSettingPostResultApiResponse`"))),
699            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::ServiceSettingSettingPostResultApiResponse`")))),
700        }
701    } else {
702        let content = resp.text().await?;
703        let entity: Option<ServiceSettingPostError> = serde_json::from_str(&content).ok();
704        Err(Error::ResponseError(ResponseContent { status, content, entity }))
705    }
706}
707
708/// 根据服务商ID获取服务商详情
709pub async fn service_setting_provider(configuration: &configuration::Configuration, id: i64) -> Result<models::ServiceProviderApiResponse, Error<ServiceSettingProviderError>> {
710    // add a prefix to parameters to efficiently prevent name collisions
711    let p_id = id;
712
713    let uri_str = format!("{}/ServiceSetting/Providers/{id}", configuration.base_path, id=p_id);
714    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
715
716    if let Some(ref user_agent) = configuration.user_agent {
717        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
718    }
719    if let Some(ref token) = configuration.bearer_access_token {
720        req_builder = req_builder.bearer_auth(token.to_owned());
721    };
722
723    let req = req_builder.build()?;
724    let resp = configuration.client.execute(req).await?;
725
726    let status = resp.status();
727    let content_type = resp
728        .headers()
729        .get("content-type")
730        .and_then(|v| v.to_str().ok())
731        .unwrap_or("application/octet-stream");
732    let content_type = super::ContentType::from(content_type);
733
734    if !status.is_client_error() && !status.is_server_error() {
735        let content = resp.text().await?;
736        match content_type {
737            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
738            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceProviderApiResponse`"))),
739            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::ServiceProviderApiResponse`")))),
740        }
741    } else {
742        let content = resp.text().await?;
743        let entity: Option<ServiceSettingProviderError> = serde_json::from_str(&content).ok();
744        Err(Error::ResponseError(ResponseContent { status, content, entity }))
745    }
746}
747
748/// 根据服务商ID删除服务商
749pub async fn service_setting_provider_delete(configuration: &configuration::Configuration, id: i64) -> Result<models::BooleanApiResponse, Error<ServiceSettingProviderDeleteError>> {
750    // add a prefix to parameters to efficiently prevent name collisions
751    let p_id = id;
752
753    let uri_str = format!("{}/ServiceSetting/Providers/{id}", configuration.base_path, id=p_id);
754    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
755
756    if let Some(ref user_agent) = configuration.user_agent {
757        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
758    }
759    if let Some(ref token) = configuration.bearer_access_token {
760        req_builder = req_builder.bearer_auth(token.to_owned());
761    };
762
763    let req = req_builder.build()?;
764    let resp = configuration.client.execute(req).await?;
765
766    let status = resp.status();
767    let content_type = resp
768        .headers()
769        .get("content-type")
770        .and_then(|v| v.to_str().ok())
771        .unwrap_or("application/octet-stream");
772    let content_type = super::ContentType::from(content_type);
773
774    if !status.is_client_error() && !status.is_server_error() {
775        let content = resp.text().await?;
776        match content_type {
777            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
778            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
779            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::BooleanApiResponse`")))),
780        }
781    } else {
782        let content = resp.text().await?;
783        let entity: Option<ServiceSettingProviderDeleteError> = serde_json::from_str(&content).ok();
784        Err(Error::ResponseError(ResponseContent { status, content, entity }))
785    }
786}
787
788/// 添加新的服务商
789pub async fn service_setting_provider_post(configuration: &configuration::Configuration, service_provider: Option<models::ServiceProvider>) -> Result<models::ServiceSettingProviderPostResultApiResponse, Error<ServiceSettingProviderPostError>> {
790    // add a prefix to parameters to efficiently prevent name collisions
791    let p_service_provider = service_provider;
792
793    let uri_str = format!("{}/ServiceSetting/Providers", configuration.base_path);
794    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
795
796    if let Some(ref user_agent) = configuration.user_agent {
797        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
798    }
799    if let Some(ref token) = configuration.bearer_access_token {
800        req_builder = req_builder.bearer_auth(token.to_owned());
801    };
802    req_builder = req_builder.json(&p_service_provider);
803
804    let req = req_builder.build()?;
805    let resp = configuration.client.execute(req).await?;
806
807    let status = resp.status();
808    let content_type = resp
809        .headers()
810        .get("content-type")
811        .and_then(|v| v.to_str().ok())
812        .unwrap_or("application/octet-stream");
813    let content_type = super::ContentType::from(content_type);
814
815    if !status.is_client_error() && !status.is_server_error() {
816        let content = resp.text().await?;
817        match content_type {
818            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
819            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceSettingProviderPostResultApiResponse`"))),
820            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::ServiceSettingProviderPostResultApiResponse`")))),
821        }
822    } else {
823        let content = resp.text().await?;
824        let entity: Option<ServiceSettingProviderPostError> = serde_json::from_str(&content).ok();
825        Err(Error::ResponseError(ResponseContent { status, content, entity }))
826    }
827}
828
829/// 根据服务商ID更新服务商信息
830pub async fn service_setting_provider_put(configuration: &configuration::Configuration, id: i64, service_provider: Option<models::ServiceProvider>) -> Result<models::BooleanApiResponse, Error<ServiceSettingProviderPutError>> {
831    // add a prefix to parameters to efficiently prevent name collisions
832    let p_id = id;
833    let p_service_provider = service_provider;
834
835    let uri_str = format!("{}/ServiceSetting/Providers/{id}", configuration.base_path, id=p_id);
836    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
837
838    if let Some(ref user_agent) = configuration.user_agent {
839        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
840    }
841    if let Some(ref token) = configuration.bearer_access_token {
842        req_builder = req_builder.bearer_auth(token.to_owned());
843    };
844    req_builder = req_builder.json(&p_service_provider);
845
846    let req = req_builder.build()?;
847    let resp = configuration.client.execute(req).await?;
848
849    let status = resp.status();
850    let content_type = resp
851        .headers()
852        .get("content-type")
853        .and_then(|v| v.to_str().ok())
854        .unwrap_or("application/octet-stream");
855    let content_type = super::ContentType::from(content_type);
856
857    if !status.is_client_error() && !status.is_server_error() {
858        let content = resp.text().await?;
859        match content_type {
860            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
861            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
862            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::BooleanApiResponse`")))),
863        }
864    } else {
865        let content = resp.text().await?;
866        let entity: Option<ServiceSettingProviderPutError> = serde_json::from_str(&content).ok();
867        Err(Error::ResponseError(ResponseContent { status, content, entity }))
868    }
869}
870
871/// 根据业务代码和显示标志获取服务商列表
872pub async fn service_setting_providers(configuration: &configuration::Configuration, biz_code: Option<&str>, show_flag: Option<bool>) -> Result<models::ServiceProviderListApiResponse, Error<ServiceSettingProvidersError>> {
873    // add a prefix to parameters to efficiently prevent name collisions
874    let p_biz_code = biz_code;
875    let p_show_flag = show_flag;
876
877    let uri_str = format!("{}/ServiceSetting/Providers", configuration.base_path);
878    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
879
880    if let Some(ref param_value) = p_biz_code {
881        req_builder = req_builder.query(&[("bizCode", &param_value.to_string())]);
882    }
883    if let Some(ref param_value) = p_show_flag {
884        req_builder = req_builder.query(&[("showFlag", &param_value.to_string())]);
885    }
886    if let Some(ref user_agent) = configuration.user_agent {
887        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
888    }
889    if let Some(ref token) = configuration.bearer_access_token {
890        req_builder = req_builder.bearer_auth(token.to_owned());
891    };
892
893    let req = req_builder.build()?;
894    let resp = configuration.client.execute(req).await?;
895
896    let status = resp.status();
897    let content_type = resp
898        .headers()
899        .get("content-type")
900        .and_then(|v| v.to_str().ok())
901        .unwrap_or("application/octet-stream");
902    let content_type = super::ContentType::from(content_type);
903
904    if !status.is_client_error() && !status.is_server_error() {
905        let content = resp.text().await?;
906        match content_type {
907            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
908            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServiceProviderListApiResponse`"))),
909            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::ServiceProviderListApiResponse`")))),
910        }
911    } else {
912        let content = resp.text().await?;
913        let entity: Option<ServiceSettingProvidersError> = serde_json::from_str(&content).ok();
914        Err(Error::ResponseError(ResponseContent { status, content, entity }))
915    }
916}
917
918/// 根据配置ID更新配置信息
919pub async fn service_setting_put(configuration: &configuration::Configuration, id: i64, settings: Option<models::Settings>) -> Result<models::BooleanApiResponse, Error<ServiceSettingPutError>> {
920    // add a prefix to parameters to efficiently prevent name collisions
921    let p_id = id;
922    let p_settings = settings;
923
924    let uri_str = format!("{}/ServiceSetting/{id}", configuration.base_path, id=p_id);
925    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
926
927    if let Some(ref user_agent) = configuration.user_agent {
928        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
929    }
930    if let Some(ref token) = configuration.bearer_access_token {
931        req_builder = req_builder.bearer_auth(token.to_owned());
932    };
933    req_builder = req_builder.json(&p_settings);
934
935    let req = req_builder.build()?;
936    let resp = configuration.client.execute(req).await?;
937
938    let status = resp.status();
939    let content_type = resp
940        .headers()
941        .get("content-type")
942        .and_then(|v| v.to_str().ok())
943        .unwrap_or("application/octet-stream");
944    let content_type = super::ContentType::from(content_type);
945
946    if !status.is_client_error() && !status.is_server_error() {
947        let content = resp.text().await?;
948        match content_type {
949            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
950            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BooleanApiResponse`"))),
951            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::BooleanApiResponse`")))),
952        }
953    } else {
954        let content = resp.text().await?;
955        let entity: Option<ServiceSettingPutError> = serde_json::from_str(&content).ok();
956        Err(Error::ResponseError(ResponseContent { status, content, entity }))
957    }
958}
959
960/// 根据业务代码、业务标识、服务商代码、分组代码、标签和配置项代码获取配置列表
961pub async fn service_settings(configuration: &configuration::Configuration, biz_code: &str, biz_id: &str, provider_code: Option<&str>, group_code: Option<&str>, tag: Option<&str>, code: Option<&str>) -> Result<models::SettingsListApiResponse, Error<ServiceSettingsError>> {
962    // add a prefix to parameters to efficiently prevent name collisions
963    let p_biz_code = biz_code;
964    let p_biz_id = biz_id;
965    let p_provider_code = provider_code;
966    let p_group_code = group_code;
967    let p_tag = tag;
968    let p_code = code;
969
970    let uri_str = format!("{}/ServiceSetting", configuration.base_path);
971    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
972
973    req_builder = req_builder.query(&[("bizCode", &p_biz_code.to_string())]);
974    req_builder = req_builder.query(&[("bizId", &p_biz_id.to_string())]);
975    if let Some(ref param_value) = p_provider_code {
976        req_builder = req_builder.query(&[("providerCode", &param_value.to_string())]);
977    }
978    if let Some(ref param_value) = p_group_code {
979        req_builder = req_builder.query(&[("groupCode", &param_value.to_string())]);
980    }
981    if let Some(ref param_value) = p_tag {
982        req_builder = req_builder.query(&[("tag", &param_value.to_string())]);
983    }
984    if let Some(ref param_value) = p_code {
985        req_builder = req_builder.query(&[("code", &param_value.to_string())]);
986    }
987    if let Some(ref user_agent) = configuration.user_agent {
988        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
989    }
990    if let Some(ref token) = configuration.bearer_access_token {
991        req_builder = req_builder.bearer_auth(token.to_owned());
992    };
993
994    let req = req_builder.build()?;
995    let resp = configuration.client.execute(req).await?;
996
997    let status = resp.status();
998    let content_type = resp
999        .headers()
1000        .get("content-type")
1001        .and_then(|v| v.to_str().ok())
1002        .unwrap_or("application/octet-stream");
1003    let content_type = super::ContentType::from(content_type);
1004
1005    if !status.is_client_error() && !status.is_server_error() {
1006        let content = resp.text().await?;
1007        match content_type {
1008            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1009            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SettingsListApiResponse`"))),
1010            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SettingsListApiResponse`")))),
1011        }
1012    } else {
1013        let content = resp.text().await?;
1014        let entity: Option<ServiceSettingsError> = serde_json::from_str(&content).ok();
1015        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1016    }
1017}
1018