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