1use super::{configuration, Error};
12use crate::communications::{apis::ResponseContent, models};
13use reqwest;
14use serde::{Deserialize, Serialize};
15
16#[derive(Debug, Clone, Serialize, Deserialize)]
18#[serde(untagged)]
19pub enum DeleteV1PinsError {
20 Status400(models::RespondPeriodResultErr),
21 Status401(models::GetV1NewFeedbacksQuestions401Response),
22 Status402(models::GetV1NewFeedbacksQuestions402Response),
23 Status403(models::PostV1FeedbacksAnswer403Response),
24 Status429(models::GetV1NewFeedbacksQuestions401Response),
25 UnknownValue(serde_json::Value),
26}
27
28#[derive(Debug, Clone, Serialize, Deserialize)]
30#[serde(untagged)]
31pub enum GetV1ClaimsError {
32 Status400(models::GetV1Claims400Response),
33 Status401(models::GetV1NewFeedbacksQuestions401Response),
34 Status402(models::GetV1NewFeedbacksQuestions402Response),
35 Status403(models::PostV1FeedbacksAnswer403Response),
36 Status429(models::GetV1NewFeedbacksQuestions401Response),
37 UnknownValue(serde_json::Value),
38}
39
40#[derive(Debug, Clone, Serialize, Deserialize)]
42#[serde(untagged)]
43pub enum GetV1FeedbackError {
44 Status401(models::GetV1NewFeedbacksQuestions401Response),
45 Status402(models::GetV1NewFeedbacksQuestions402Response),
46 Status403(models::PostV1FeedbacksAnswer403Response),
47 Status422(models::ResponseFeedbackQuestionErr),
48 Status429(models::GetV1NewFeedbacksQuestions401Response),
49 UnknownValue(serde_json::Value),
50}
51
52#[derive(Debug, Clone, Serialize, Deserialize)]
54#[serde(untagged)]
55pub enum GetV1FeedbacksError {
56 Status400(models::ResponseFeedbackQuestionErr),
57 Status401(models::GetV1NewFeedbacksQuestions401Response),
58 Status402(models::GetV1NewFeedbacksQuestions402Response),
59 Status403(models::ResponseFeedbackQuestionErr),
60 Status429(models::GetV1NewFeedbacksQuestions401Response),
61 UnknownValue(serde_json::Value),
62}
63
64#[derive(Debug, Clone, Serialize, Deserialize)]
66#[serde(untagged)]
67pub enum GetV1FeedbacksArchiveError {
68 Status400(models::ResponseFeedbackQuestionErr),
69 Status401(models::GetV1NewFeedbacksQuestions401Response),
70 Status402(models::GetV1NewFeedbacksQuestions402Response),
71 Status403(models::ResponseFeedbackQuestionErr),
72 Status422(models::ResponseFeedbackQuestionErr),
73 Status429(models::GetV1NewFeedbacksQuestions401Response),
74 UnknownValue(serde_json::Value),
75}
76
77#[derive(Debug, Clone, Serialize, Deserialize)]
79#[serde(untagged)]
80pub enum GetV1FeedbacksCountError {
81 Status400(models::ResponseFeedbackQuestionErr),
82 Status401(models::GetV1NewFeedbacksQuestions401Response),
83 Status402(models::GetV1NewFeedbacksQuestions402Response),
84 Status403(models::ResponseFeedbackQuestionErr),
85 Status429(models::GetV1NewFeedbacksQuestions401Response),
86 UnknownValue(serde_json::Value),
87}
88
89#[derive(Debug, Clone, Serialize, Deserialize)]
91#[serde(untagged)]
92pub enum GetV1FeedbacksCountUnansweredError {
93 Status401(models::GetV1NewFeedbacksQuestions401Response),
94 Status402(models::GetV1NewFeedbacksQuestions402Response),
95 Status403(models::ResponseFeedbackQuestionErr),
96 Status429(models::GetV1NewFeedbacksQuestions401Response),
97 UnknownValue(serde_json::Value),
98}
99
100#[derive(Debug, Clone, Serialize, Deserialize)]
102#[serde(untagged)]
103pub enum GetV1NewFeedbacksQuestionsError {
104 Status401(models::GetV1NewFeedbacksQuestions401Response),
105 Status402(models::GetV1NewFeedbacksQuestions402Response),
106 Status403(models::ResponseFeedbackQuestionErr),
107 Status429(models::GetV1NewFeedbacksQuestions401Response),
108 UnknownValue(serde_json::Value),
109}
110
111#[derive(Debug, Clone, Serialize, Deserialize)]
113#[serde(untagged)]
114pub enum GetV1PinsError {
115 Status400(models::RespondPeriodResultErr),
116 Status401(models::GetV1NewFeedbacksQuestions401Response),
117 Status402(models::GetV1NewFeedbacksQuestions402Response),
118 Status403(models::PostV1FeedbacksAnswer403Response),
119 Status429(models::GetV1NewFeedbacksQuestions401Response),
120 UnknownValue(serde_json::Value),
121}
122
123#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum GetV1PinsCountError {
127 Status400(models::RespondPeriodResultErr),
128 Status401(models::GetV1NewFeedbacksQuestions401Response),
129 Status402(models::GetV1NewFeedbacksQuestions402Response),
130 Status403(models::PostV1FeedbacksAnswer403Response),
131 Status429(models::GetV1NewFeedbacksQuestions401Response),
132 UnknownValue(serde_json::Value),
133}
134
135#[derive(Debug, Clone, Serialize, Deserialize)]
137#[serde(untagged)]
138pub enum GetV1PinsLimitsError {
139 Status401(models::GetV1NewFeedbacksQuestions401Response),
140 Status402(models::GetV1NewFeedbacksQuestions402Response),
141 Status403(models::PostV1FeedbacksAnswer403Response),
142 Status429(models::GetV1NewFeedbacksQuestions401Response),
143 UnknownValue(serde_json::Value),
144}
145
146#[derive(Debug, Clone, Serialize, Deserialize)]
148#[serde(untagged)]
149pub enum GetV1QuestionError {
150 Status401(models::GetV1NewFeedbacksQuestions401Response),
151 Status402(models::GetV1NewFeedbacksQuestions402Response),
152 Status403(models::ResponseFeedbackQuestionErr),
153 Status422(models::ResponseFeedbackQuestionErr),
154 Status429(models::GetV1NewFeedbacksQuestions401Response),
155 UnknownValue(serde_json::Value),
156}
157
158#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum GetV1QuestionsError {
162 Status400(models::ResponseFeedbackQuestionErr),
163 Status401(models::GetV1NewFeedbacksQuestions401Response),
164 Status402(models::GetV1NewFeedbacksQuestions402Response),
165 Status403(models::ResponseFeedbackQuestionErr),
166 Status429(models::GetV1NewFeedbacksQuestions401Response),
167 UnknownValue(serde_json::Value),
168}
169
170#[derive(Debug, Clone, Serialize, Deserialize)]
172#[serde(untagged)]
173pub enum GetV1QuestionsCountError {
174 Status400(models::ResponseFeedbackQuestionErr),
175 Status401(models::GetV1NewFeedbacksQuestions401Response),
176 Status402(models::GetV1NewFeedbacksQuestions402Response),
177 Status403(models::ResponseFeedbackQuestionErr),
178 Status429(models::GetV1NewFeedbacksQuestions401Response),
179 UnknownValue(serde_json::Value),
180}
181
182#[derive(Debug, Clone, Serialize, Deserialize)]
184#[serde(untagged)]
185pub enum GetV1QuestionsCountUnansweredError {
186 Status401(models::GetV1NewFeedbacksQuestions401Response),
187 Status402(models::GetV1NewFeedbacksQuestions402Response),
188 Status403(models::ResponseFeedbackQuestionErr),
189 Status429(models::GetV1NewFeedbacksQuestions401Response),
190 UnknownValue(serde_json::Value),
191}
192
193#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum GetV1SellerChatsError {
197 Status401(models::GetV1NewFeedbacksQuestions401Response),
198 Status402(models::GetV1NewFeedbacksQuestions402Response),
199 Status403(models::PostV1FeedbacksAnswer403Response),
200 Status429(models::GetV1NewFeedbacksQuestions401Response),
201 UnknownValue(serde_json::Value),
202}
203
204#[derive(Debug, Clone, Serialize, Deserialize)]
206#[serde(untagged)]
207pub enum GetV1SellerDownloadIdError {
208 Status400(models::GetV1SellerDownloadIdResponse400),
209 Status401(models::GetV1NewFeedbacksQuestions401Response),
210 Status402(models::GetV1NewFeedbacksQuestions402Response),
211 Status403(models::PostV1FeedbacksAnswer403Response),
212 Status429(models::GetV1NewFeedbacksQuestions401Response),
213 Status451(models::GetV1SellerDownloadIdResponse451),
214 UnknownValue(serde_json::Value),
215}
216
217#[derive(Debug, Clone, Serialize, Deserialize)]
219#[serde(untagged)]
220pub enum GetV1SellerEventsError {
221 Status400(models::GetV1SellerEventsResponse400),
222 Status401(models::GetV1NewFeedbacksQuestions401Response),
223 Status402(models::GetV1NewFeedbacksQuestions402Response),
224 Status403(models::PostV1FeedbacksAnswer403Response),
225 Status429(models::GetV1NewFeedbacksQuestions401Response),
226 UnknownValue(serde_json::Value),
227}
228
229#[derive(Debug, Clone, Serialize, Deserialize)]
231#[serde(untagged)]
232pub enum PatchV1ClaimError {
233 Status400(models::PatchV1Claim400Response),
234 Status401(models::GetV1NewFeedbacksQuestions401Response),
235 Status402(models::GetV1NewFeedbacksQuestions402Response),
236 Status403(models::PostV1FeedbacksAnswer403Response),
237 Status429(models::GetV1NewFeedbacksQuestions401Response),
238 UnknownValue(serde_json::Value),
239}
240
241#[derive(Debug, Clone, Serialize, Deserialize)]
243#[serde(untagged)]
244pub enum PatchV1FeedbacksAnswerError {
245 Status401(models::GetV1NewFeedbacksQuestions401Response),
246 Status402(models::GetV1NewFeedbacksQuestions402Response),
247 Status403(models::PostV1FeedbacksAnswer403Response),
248 Status429(models::GetV1NewFeedbacksQuestions401Response),
249 UnknownValue(serde_json::Value),
250}
251
252#[derive(Debug, Clone, Serialize, Deserialize)]
254#[serde(untagged)]
255pub enum PatchV1QuestionsError {
256 Status400(models::ResponseFeedbackQuestionErr),
257 Status401(models::GetV1NewFeedbacksQuestions401Response),
258 Status402(models::GetV1NewFeedbacksQuestions402Response),
259 Status403(models::ResponseFeedbackQuestionErr),
260 Status404(models::ResponseFeedbackQuestionErr),
261 Status422(models::ResponseFeedbackQuestionErr),
262 Status429(models::GetV1NewFeedbacksQuestions401Response),
263 UnknownValue(serde_json::Value),
264}
265
266#[derive(Debug, Clone, Serialize, Deserialize)]
268#[serde(untagged)]
269pub enum PostV1FeedbacksAnswerError {
270 Status400(models::StandardizedFqError),
271 Status401(models::GetV1NewFeedbacksQuestions401Response),
272 Status402(models::GetV1NewFeedbacksQuestions402Response),
273 Status403(models::PostV1FeedbacksAnswer403Response),
274 Status429(models::GetV1NewFeedbacksQuestions401Response),
275 UnknownValue(serde_json::Value),
276}
277
278#[derive(Debug, Clone, Serialize, Deserialize)]
280#[serde(untagged)]
281pub enum PostV1FeedbacksOrderReturnError {
282 Status400(models::ResponseFeedbackQuestionErr),
283 Status401(models::GetV1NewFeedbacksQuestions401Response),
284 Status402(models::GetV1NewFeedbacksQuestions402Response),
285 Status403(models::PostV1FeedbacksAnswer403Response),
286 Status422(models::ResponseFeedbackQuestionErr),
287 Status429(models::GetV1NewFeedbacksQuestions401Response),
288 UnknownValue(serde_json::Value),
289}
290
291#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(untagged)]
294pub enum PostV1PinsError {
295 Status400(models::RespondPeriodResultErr),
296 Status401(models::GetV1NewFeedbacksQuestions401Response),
297 Status402(models::GetV1NewFeedbacksQuestions402Response),
298 Status403(models::RespondPeriodResultErr),
299 Status429(models::GetV1NewFeedbacksQuestions401Response),
300 UnknownValue(serde_json::Value),
301}
302
303#[derive(Debug, Clone, Serialize, Deserialize)]
305#[serde(untagged)]
306pub enum PostV1SellerMessageError {
307 Status400(models::PostV1SellerMessageResponse400),
308 Status401(models::GetV1NewFeedbacksQuestions401Response),
309 Status402(models::GetV1NewFeedbacksQuestions402Response),
310 Status403(models::PostV1FeedbacksAnswer403Response),
311 Status429(models::GetV1NewFeedbacksQuestions401Response),
312 UnknownValue(serde_json::Value),
313}
314
315pub async fn delete_v1_pins(
317 configuration: &configuration::Configuration,
318 request_body: Vec<i64>,
319) -> Result<models::DeleteV1PinsResponse200, Error<DeleteV1PinsError>> {
320 let local_var_configuration = configuration;
321
322 let local_var_client = &local_var_configuration.client;
323
324 let local_var_uri_str = format!(
325 "{}/api/feedbacks/v1/pins",
326 local_var_configuration.base_path
327 );
328 let mut local_var_req_builder =
329 local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
330
331 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
332 local_var_req_builder =
333 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
334 }
335 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
336 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
337 };
338 local_var_req_builder = local_var_req_builder.json(&request_body);
339
340 let local_var_req = local_var_req_builder.build()?;
341 let local_var_resp = local_var_client.execute(local_var_req).await?;
342
343 let local_var_status = local_var_resp.status();
344 let local_var_content = local_var_resp.text().await?;
345
346 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
347 serde_json::from_str(&local_var_content).map_err(Error::from)
348 } else {
349 let local_var_entity: Option<DeleteV1PinsError> =
350 serde_json::from_str(&local_var_content).ok();
351 let local_var_error = ResponseContent {
352 status: local_var_status,
353 content: local_var_content,
354 entity: local_var_entity,
355 };
356 Err(Error::ResponseError(local_var_error))
357 }
358}
359
360pub async fn get_v1_claims(
362 configuration: &configuration::Configuration,
363 is_archive: bool,
364 id: Option<&str>,
365 limit: Option<i32>,
366 offset: Option<i32>,
367 nm_id: Option<i64>,
368) -> Result<models::GetV1Claims200Response, Error<GetV1ClaimsError>> {
369 let local_var_configuration = configuration;
370
371 let local_var_client = &local_var_configuration.client;
372
373 let local_var_uri_str = format!("{}/api/v1/claims", local_var_configuration.base_path);
374 let mut local_var_req_builder =
375 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
376
377 local_var_req_builder = local_var_req_builder.query(&[("is_archive", &is_archive.to_string())]);
378 if let Some(ref local_var_str) = id {
379 local_var_req_builder = local_var_req_builder.query(&[("id", &local_var_str.to_string())]);
380 }
381 if let Some(ref local_var_str) = limit {
382 local_var_req_builder =
383 local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
384 }
385 if let Some(ref local_var_str) = offset {
386 local_var_req_builder =
387 local_var_req_builder.query(&[("offset", &local_var_str.to_string())]);
388 }
389 if let Some(ref local_var_str) = nm_id {
390 local_var_req_builder =
391 local_var_req_builder.query(&[("nm_id", &local_var_str.to_string())]);
392 }
393 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
394 local_var_req_builder =
395 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
396 }
397 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
398 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
399 };
400
401 let local_var_req = local_var_req_builder.build()?;
402 let local_var_resp = local_var_client.execute(local_var_req).await?;
403
404 let local_var_status = local_var_resp.status();
405 let local_var_content = local_var_resp.text().await?;
406
407 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
408 serde_json::from_str(&local_var_content).map_err(Error::from)
409 } else {
410 let local_var_entity: Option<GetV1ClaimsError> =
411 serde_json::from_str(&local_var_content).ok();
412 let local_var_error = ResponseContent {
413 status: local_var_status,
414 content: local_var_content,
415 entity: local_var_entity,
416 };
417 Err(Error::ResponseError(local_var_error))
418 }
419}
420
421pub async fn get_v1_feedback(
423 configuration: &configuration::Configuration,
424 id: &str,
425) -> Result<models::GetV1FeedbackResponse200, Error<GetV1FeedbackError>> {
426 let local_var_configuration = configuration;
427
428 let local_var_client = &local_var_configuration.client;
429
430 let local_var_uri_str = format!("{}/api/v1/feedback", local_var_configuration.base_path);
431 let mut local_var_req_builder =
432 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
433
434 local_var_req_builder = local_var_req_builder.query(&[("id", &id.to_string())]);
435 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
436 local_var_req_builder =
437 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
438 }
439 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
440 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
441 };
442
443 let local_var_req = local_var_req_builder.build()?;
444 let local_var_resp = local_var_client.execute(local_var_req).await?;
445
446 let local_var_status = local_var_resp.status();
447 let local_var_content = local_var_resp.text().await?;
448
449 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
450 serde_json::from_str(&local_var_content).map_err(Error::from)
451 } else {
452 let local_var_entity: Option<GetV1FeedbackError> =
453 serde_json::from_str(&local_var_content).ok();
454 let local_var_error = ResponseContent {
455 status: local_var_status,
456 content: local_var_content,
457 entity: local_var_entity,
458 };
459 Err(Error::ResponseError(local_var_error))
460 }
461}
462
463pub async fn get_v1_feedbacks(
465 configuration: &configuration::Configuration,
466 is_answered: bool,
467 take: i64,
468 skip: i64,
469 nm_id: Option<i64>,
470 order: Option<&str>,
471 date_from: Option<i64>,
472 date_to: Option<i64>,
473) -> Result<models::GetV1FeedbacksResponse200, Error<GetV1FeedbacksError>> {
474 let local_var_configuration = configuration;
475
476 let local_var_client = &local_var_configuration.client;
477
478 let local_var_uri_str = format!("{}/api/v1/feedbacks", local_var_configuration.base_path);
479 let mut local_var_req_builder =
480 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
481
482 local_var_req_builder =
483 local_var_req_builder.query(&[("isAnswered", &is_answered.to_string())]);
484 if let Some(ref local_var_str) = nm_id {
485 local_var_req_builder =
486 local_var_req_builder.query(&[("nmId", &local_var_str.to_string())]);
487 }
488 local_var_req_builder = local_var_req_builder.query(&[("take", &take.to_string())]);
489 local_var_req_builder = local_var_req_builder.query(&[("skip", &skip.to_string())]);
490 if let Some(ref local_var_str) = order {
491 local_var_req_builder =
492 local_var_req_builder.query(&[("order", &local_var_str.to_string())]);
493 }
494 if let Some(ref local_var_str) = date_from {
495 local_var_req_builder =
496 local_var_req_builder.query(&[("dateFrom", &local_var_str.to_string())]);
497 }
498 if let Some(ref local_var_str) = date_to {
499 local_var_req_builder =
500 local_var_req_builder.query(&[("dateTo", &local_var_str.to_string())]);
501 }
502 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
503 local_var_req_builder =
504 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
505 }
506 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
507 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
508 };
509
510 let local_var_req = local_var_req_builder.build()?;
511 let local_var_resp = local_var_client.execute(local_var_req).await?;
512
513 let local_var_status = local_var_resp.status();
514 let local_var_content = local_var_resp.text().await?;
515
516 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
517 serde_json::from_str(&local_var_content).map_err(Error::from)
518 } else {
519 let local_var_entity: Option<GetV1FeedbacksError> =
520 serde_json::from_str(&local_var_content).ok();
521 let local_var_error = ResponseContent {
522 status: local_var_status,
523 content: local_var_content,
524 entity: local_var_entity,
525 };
526 Err(Error::ResponseError(local_var_error))
527 }
528}
529
530pub async fn get_v1_feedbacks_archive(
532 configuration: &configuration::Configuration,
533 take: i64,
534 skip: i64,
535 nm_id: Option<i64>,
536 order: Option<&str>,
537) -> Result<models::GetV1FeedbacksArchiveResponse200, Error<GetV1FeedbacksArchiveError>> {
538 let local_var_configuration = configuration;
539
540 let local_var_client = &local_var_configuration.client;
541
542 let local_var_uri_str = format!(
543 "{}/api/v1/feedbacks/archive",
544 local_var_configuration.base_path
545 );
546 let mut local_var_req_builder =
547 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
548
549 if let Some(ref local_var_str) = nm_id {
550 local_var_req_builder =
551 local_var_req_builder.query(&[("nmId", &local_var_str.to_string())]);
552 }
553 local_var_req_builder = local_var_req_builder.query(&[("take", &take.to_string())]);
554 local_var_req_builder = local_var_req_builder.query(&[("skip", &skip.to_string())]);
555 if let Some(ref local_var_str) = order {
556 local_var_req_builder =
557 local_var_req_builder.query(&[("order", &local_var_str.to_string())]);
558 }
559 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
560 local_var_req_builder =
561 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
562 }
563 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
564 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
565 };
566
567 let local_var_req = local_var_req_builder.build()?;
568 let local_var_resp = local_var_client.execute(local_var_req).await?;
569
570 let local_var_status = local_var_resp.status();
571 let local_var_content = local_var_resp.text().await?;
572
573 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
574 serde_json::from_str(&local_var_content).map_err(Error::from)
575 } else {
576 let local_var_entity: Option<GetV1FeedbacksArchiveError> =
577 serde_json::from_str(&local_var_content).ok();
578 let local_var_error = ResponseContent {
579 status: local_var_status,
580 content: local_var_content,
581 entity: local_var_entity,
582 };
583 Err(Error::ResponseError(local_var_error))
584 }
585}
586
587pub async fn get_v1_feedbacks_count(
589 configuration: &configuration::Configuration,
590 is_answered: bool,
591 date_from: Option<i64>,
592 date_to: Option<i64>,
593) -> Result<models::GetV1FeedbacksCountResponse200, Error<GetV1FeedbacksCountError>> {
594 let local_var_configuration = configuration;
595
596 let local_var_client = &local_var_configuration.client;
597
598 let local_var_uri_str = format!(
599 "{}/api/v1/feedbacks/count",
600 local_var_configuration.base_path
601 );
602 let mut local_var_req_builder =
603 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
604
605 if let Some(ref local_var_str) = date_from {
606 local_var_req_builder =
607 local_var_req_builder.query(&[("dateFrom", &local_var_str.to_string())]);
608 }
609 if let Some(ref local_var_str) = date_to {
610 local_var_req_builder =
611 local_var_req_builder.query(&[("dateTo", &local_var_str.to_string())]);
612 }
613 local_var_req_builder =
614 local_var_req_builder.query(&[("isAnswered", &is_answered.to_string())]);
615 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
616 local_var_req_builder =
617 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
618 }
619 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
620 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
621 };
622
623 let local_var_req = local_var_req_builder.build()?;
624 let local_var_resp = local_var_client.execute(local_var_req).await?;
625
626 let local_var_status = local_var_resp.status();
627 let local_var_content = local_var_resp.text().await?;
628
629 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
630 serde_json::from_str(&local_var_content).map_err(Error::from)
631 } else {
632 let local_var_entity: Option<GetV1FeedbacksCountError> =
633 serde_json::from_str(&local_var_content).ok();
634 let local_var_error = ResponseContent {
635 status: local_var_status,
636 content: local_var_content,
637 entity: local_var_entity,
638 };
639 Err(Error::ResponseError(local_var_error))
640 }
641}
642
643pub async fn get_v1_feedbacks_count_unanswered(
645 configuration: &configuration::Configuration,
646) -> Result<
647 models::GetV1FeedbacksCountUnansweredResponse200,
648 Error<GetV1FeedbacksCountUnansweredError>,
649> {
650 let local_var_configuration = configuration;
651
652 let local_var_client = &local_var_configuration.client;
653
654 let local_var_uri_str = format!(
655 "{}/api/v1/feedbacks/count-unanswered",
656 local_var_configuration.base_path
657 );
658 let mut local_var_req_builder =
659 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
660
661 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
662 local_var_req_builder =
663 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
664 }
665 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
666 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
667 };
668
669 let local_var_req = local_var_req_builder.build()?;
670 let local_var_resp = local_var_client.execute(local_var_req).await?;
671
672 let local_var_status = local_var_resp.status();
673 let local_var_content = local_var_resp.text().await?;
674
675 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
676 serde_json::from_str(&local_var_content).map_err(Error::from)
677 } else {
678 let local_var_entity: Option<GetV1FeedbacksCountUnansweredError> =
679 serde_json::from_str(&local_var_content).ok();
680 let local_var_error = ResponseContent {
681 status: local_var_status,
682 content: local_var_content,
683 entity: local_var_entity,
684 };
685 Err(Error::ResponseError(local_var_error))
686 }
687}
688
689pub async fn get_v1_new_feedbacks_questions(
691 configuration: &configuration::Configuration,
692) -> Result<models::GetV1NewFeedbacksQuestionsResponse200, Error<GetV1NewFeedbacksQuestionsError>> {
693 let local_var_configuration = configuration;
694
695 let local_var_client = &local_var_configuration.client;
696
697 let local_var_uri_str = format!(
698 "{}/api/v1/new-feedbacks-questions",
699 local_var_configuration.base_path
700 );
701 let mut local_var_req_builder =
702 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
703
704 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
705 local_var_req_builder =
706 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
707 }
708 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
709 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
710 };
711
712 let local_var_req = local_var_req_builder.build()?;
713 let local_var_resp = local_var_client.execute(local_var_req).await?;
714
715 let local_var_status = local_var_resp.status();
716 let local_var_content = local_var_resp.text().await?;
717
718 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
719 serde_json::from_str(&local_var_content).map_err(Error::from)
720 } else {
721 let local_var_entity: Option<GetV1NewFeedbacksQuestionsError> =
722 serde_json::from_str(&local_var_content).ok();
723 let local_var_error = ResponseContent {
724 status: local_var_status,
725 content: local_var_content,
726 entity: local_var_entity,
727 };
728 Err(Error::ResponseError(local_var_error))
729 }
730}
731
732pub async fn get_v1_pins(
734 configuration: &configuration::Configuration,
735 state: Option<&str>,
736 pin_on: Option<&str>,
737 imt_id: Option<i64>,
738 nm_id: Option<i64>,
739 feedback_id: Option<i64>,
740 date_from: Option<&str>,
741 date_to: Option<&str>,
742 next: Option<i64>,
743 limit: Option<i64>,
744) -> Result<models::GetV1PinsResponse200, Error<GetV1PinsError>> {
745 let local_var_configuration = configuration;
746
747 let local_var_client = &local_var_configuration.client;
748
749 let local_var_uri_str = format!(
750 "{}/api/feedbacks/v1/pins",
751 local_var_configuration.base_path
752 );
753 let mut local_var_req_builder =
754 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
755
756 if let Some(ref local_var_str) = state {
757 local_var_req_builder =
758 local_var_req_builder.query(&[("state", &local_var_str.to_string())]);
759 }
760 if let Some(ref local_var_str) = pin_on {
761 local_var_req_builder =
762 local_var_req_builder.query(&[("pinOn", &local_var_str.to_string())]);
763 }
764 if let Some(ref local_var_str) = imt_id {
765 local_var_req_builder =
766 local_var_req_builder.query(&[("imtId", &local_var_str.to_string())]);
767 }
768 if let Some(ref local_var_str) = nm_id {
769 local_var_req_builder =
770 local_var_req_builder.query(&[("nmId", &local_var_str.to_string())]);
771 }
772 if let Some(ref local_var_str) = feedback_id {
773 local_var_req_builder =
774 local_var_req_builder.query(&[("feedbackId", &local_var_str.to_string())]);
775 }
776 if let Some(ref local_var_str) = date_from {
777 local_var_req_builder =
778 local_var_req_builder.query(&[("dateFrom", &local_var_str.to_string())]);
779 }
780 if let Some(ref local_var_str) = date_to {
781 local_var_req_builder =
782 local_var_req_builder.query(&[("dateTo", &local_var_str.to_string())]);
783 }
784 if let Some(ref local_var_str) = next {
785 local_var_req_builder =
786 local_var_req_builder.query(&[("next", &local_var_str.to_string())]);
787 }
788 if let Some(ref local_var_str) = limit {
789 local_var_req_builder =
790 local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
791 }
792 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
793 local_var_req_builder =
794 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
795 }
796 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
797 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
798 };
799
800 let local_var_req = local_var_req_builder.build()?;
801 let local_var_resp = local_var_client.execute(local_var_req).await?;
802
803 let local_var_status = local_var_resp.status();
804 let local_var_content = local_var_resp.text().await?;
805
806 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
807 serde_json::from_str(&local_var_content).map_err(Error::from)
808 } else {
809 let local_var_entity: Option<GetV1PinsError> =
810 serde_json::from_str(&local_var_content).ok();
811 let local_var_error = ResponseContent {
812 status: local_var_status,
813 content: local_var_content,
814 entity: local_var_entity,
815 };
816 Err(Error::ResponseError(local_var_error))
817 }
818}
819
820pub async fn get_v1_pins_count(
822 configuration: &configuration::Configuration,
823 state: Option<&str>,
824 pin_on: Option<&str>,
825 imt_id: Option<i64>,
826 nm_id: Option<i64>,
827 feedback_id: Option<i64>,
828 date_from: Option<&str>,
829 date_to: Option<&str>,
830) -> Result<models::GetV1PinsCountResponse200, Error<GetV1PinsCountError>> {
831 let local_var_configuration = configuration;
832
833 let local_var_client = &local_var_configuration.client;
834
835 let local_var_uri_str = format!(
836 "{}/api/feedbacks/v1/pins/count",
837 local_var_configuration.base_path
838 );
839 let mut local_var_req_builder =
840 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
841
842 if let Some(ref local_var_str) = state {
843 local_var_req_builder =
844 local_var_req_builder.query(&[("state", &local_var_str.to_string())]);
845 }
846 if let Some(ref local_var_str) = pin_on {
847 local_var_req_builder =
848 local_var_req_builder.query(&[("pinOn", &local_var_str.to_string())]);
849 }
850 if let Some(ref local_var_str) = imt_id {
851 local_var_req_builder =
852 local_var_req_builder.query(&[("imtId", &local_var_str.to_string())]);
853 }
854 if let Some(ref local_var_str) = nm_id {
855 local_var_req_builder =
856 local_var_req_builder.query(&[("nmId", &local_var_str.to_string())]);
857 }
858 if let Some(ref local_var_str) = feedback_id {
859 local_var_req_builder =
860 local_var_req_builder.query(&[("feedbackId", &local_var_str.to_string())]);
861 }
862 if let Some(ref local_var_str) = date_from {
863 local_var_req_builder =
864 local_var_req_builder.query(&[("dateFrom", &local_var_str.to_string())]);
865 }
866 if let Some(ref local_var_str) = date_to {
867 local_var_req_builder =
868 local_var_req_builder.query(&[("dateTo", &local_var_str.to_string())]);
869 }
870 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
871 local_var_req_builder =
872 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
873 }
874 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
875 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
876 };
877
878 let local_var_req = local_var_req_builder.build()?;
879 let local_var_resp = local_var_client.execute(local_var_req).await?;
880
881 let local_var_status = local_var_resp.status();
882 let local_var_content = local_var_resp.text().await?;
883
884 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
885 serde_json::from_str(&local_var_content).map_err(Error::from)
886 } else {
887 let local_var_entity: Option<GetV1PinsCountError> =
888 serde_json::from_str(&local_var_content).ok();
889 let local_var_error = ResponseContent {
890 status: local_var_status,
891 content: local_var_content,
892 entity: local_var_entity,
893 };
894 Err(Error::ResponseError(local_var_error))
895 }
896}
897
898pub async fn get_v1_pins_limits(
900 configuration: &configuration::Configuration,
901) -> Result<models::GetV1PinsLimitsResponse200, Error<GetV1PinsLimitsError>> {
902 let local_var_configuration = configuration;
903
904 let local_var_client = &local_var_configuration.client;
905
906 let local_var_uri_str = format!(
907 "{}/api/feedbacks/v1/pins/limits",
908 local_var_configuration.base_path
909 );
910 let mut local_var_req_builder =
911 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
912
913 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
914 local_var_req_builder =
915 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
916 }
917 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
918 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
919 };
920
921 let local_var_req = local_var_req_builder.build()?;
922 let local_var_resp = local_var_client.execute(local_var_req).await?;
923
924 let local_var_status = local_var_resp.status();
925 let local_var_content = local_var_resp.text().await?;
926
927 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
928 serde_json::from_str(&local_var_content).map_err(Error::from)
929 } else {
930 let local_var_entity: Option<GetV1PinsLimitsError> =
931 serde_json::from_str(&local_var_content).ok();
932 let local_var_error = ResponseContent {
933 status: local_var_status,
934 content: local_var_content,
935 entity: local_var_entity,
936 };
937 Err(Error::ResponseError(local_var_error))
938 }
939}
940
941pub async fn get_v1_question(
943 configuration: &configuration::Configuration,
944 id: &str,
945) -> Result<models::GetV1QuestionResponse200, Error<GetV1QuestionError>> {
946 let local_var_configuration = configuration;
947
948 let local_var_client = &local_var_configuration.client;
949
950 let local_var_uri_str = format!("{}/api/v1/question", local_var_configuration.base_path);
951 let mut local_var_req_builder =
952 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
953
954 local_var_req_builder = local_var_req_builder.query(&[("id", &id.to_string())]);
955 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
956 local_var_req_builder =
957 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
958 }
959 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
960 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
961 };
962
963 let local_var_req = local_var_req_builder.build()?;
964 let local_var_resp = local_var_client.execute(local_var_req).await?;
965
966 let local_var_status = local_var_resp.status();
967 let local_var_content = local_var_resp.text().await?;
968
969 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
970 serde_json::from_str(&local_var_content).map_err(Error::from)
971 } else {
972 let local_var_entity: Option<GetV1QuestionError> =
973 serde_json::from_str(&local_var_content).ok();
974 let local_var_error = ResponseContent {
975 status: local_var_status,
976 content: local_var_content,
977 entity: local_var_entity,
978 };
979 Err(Error::ResponseError(local_var_error))
980 }
981}
982
983pub async fn get_v1_questions(
985 configuration: &configuration::Configuration,
986 is_answered: bool,
987 take: i64,
988 skip: i64,
989 nm_id: Option<i64>,
990 order: Option<&str>,
991 date_from: Option<i64>,
992 date_to: Option<i64>,
993) -> Result<models::GetV1QuestionsResponse200, Error<GetV1QuestionsError>> {
994 let local_var_configuration = configuration;
995
996 let local_var_client = &local_var_configuration.client;
997
998 let local_var_uri_str = format!("{}/api/v1/questions", local_var_configuration.base_path);
999 let mut local_var_req_builder =
1000 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1001
1002 local_var_req_builder =
1003 local_var_req_builder.query(&[("isAnswered", &is_answered.to_string())]);
1004 if let Some(ref local_var_str) = nm_id {
1005 local_var_req_builder =
1006 local_var_req_builder.query(&[("nmId", &local_var_str.to_string())]);
1007 }
1008 local_var_req_builder = local_var_req_builder.query(&[("take", &take.to_string())]);
1009 local_var_req_builder = local_var_req_builder.query(&[("skip", &skip.to_string())]);
1010 if let Some(ref local_var_str) = order {
1011 local_var_req_builder =
1012 local_var_req_builder.query(&[("order", &local_var_str.to_string())]);
1013 }
1014 if let Some(ref local_var_str) = date_from {
1015 local_var_req_builder =
1016 local_var_req_builder.query(&[("dateFrom", &local_var_str.to_string())]);
1017 }
1018 if let Some(ref local_var_str) = date_to {
1019 local_var_req_builder =
1020 local_var_req_builder.query(&[("dateTo", &local_var_str.to_string())]);
1021 }
1022 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1023 local_var_req_builder =
1024 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1025 }
1026 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1027 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
1028 };
1029
1030 let local_var_req = local_var_req_builder.build()?;
1031 let local_var_resp = local_var_client.execute(local_var_req).await?;
1032
1033 let local_var_status = local_var_resp.status();
1034 let local_var_content = local_var_resp.text().await?;
1035
1036 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1037 serde_json::from_str(&local_var_content).map_err(Error::from)
1038 } else {
1039 let local_var_entity: Option<GetV1QuestionsError> =
1040 serde_json::from_str(&local_var_content).ok();
1041 let local_var_error = ResponseContent {
1042 status: local_var_status,
1043 content: local_var_content,
1044 entity: local_var_entity,
1045 };
1046 Err(Error::ResponseError(local_var_error))
1047 }
1048}
1049
1050pub async fn get_v1_questions_count(
1052 configuration: &configuration::Configuration,
1053 date_from: Option<i64>,
1054 date_to: Option<i64>,
1055 is_answered: Option<bool>,
1056) -> Result<models::GetV1QuestionsCountResponse200, Error<GetV1QuestionsCountError>> {
1057 let local_var_configuration = configuration;
1058
1059 let local_var_client = &local_var_configuration.client;
1060
1061 let local_var_uri_str = format!(
1062 "{}/api/v1/questions/count",
1063 local_var_configuration.base_path
1064 );
1065 let mut local_var_req_builder =
1066 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1067
1068 if let Some(ref local_var_str) = date_from {
1069 local_var_req_builder =
1070 local_var_req_builder.query(&[("dateFrom", &local_var_str.to_string())]);
1071 }
1072 if let Some(ref local_var_str) = date_to {
1073 local_var_req_builder =
1074 local_var_req_builder.query(&[("dateTo", &local_var_str.to_string())]);
1075 }
1076 if let Some(ref local_var_str) = is_answered {
1077 local_var_req_builder =
1078 local_var_req_builder.query(&[("isAnswered", &local_var_str.to_string())]);
1079 }
1080 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1081 local_var_req_builder =
1082 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1083 }
1084 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1085 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
1086 };
1087
1088 let local_var_req = local_var_req_builder.build()?;
1089 let local_var_resp = local_var_client.execute(local_var_req).await?;
1090
1091 let local_var_status = local_var_resp.status();
1092 let local_var_content = local_var_resp.text().await?;
1093
1094 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1095 serde_json::from_str(&local_var_content).map_err(Error::from)
1096 } else {
1097 let local_var_entity: Option<GetV1QuestionsCountError> =
1098 serde_json::from_str(&local_var_content).ok();
1099 let local_var_error = ResponseContent {
1100 status: local_var_status,
1101 content: local_var_content,
1102 entity: local_var_entity,
1103 };
1104 Err(Error::ResponseError(local_var_error))
1105 }
1106}
1107
1108pub async fn get_v1_questions_count_unanswered(
1110 configuration: &configuration::Configuration,
1111) -> Result<
1112 models::GetV1QuestionsCountUnansweredResponse200,
1113 Error<GetV1QuestionsCountUnansweredError>,
1114> {
1115 let local_var_configuration = configuration;
1116
1117 let local_var_client = &local_var_configuration.client;
1118
1119 let local_var_uri_str = format!(
1120 "{}/api/v1/questions/count-unanswered",
1121 local_var_configuration.base_path
1122 );
1123 let mut local_var_req_builder =
1124 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1125
1126 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1127 local_var_req_builder =
1128 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1129 }
1130 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1131 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
1132 };
1133
1134 let local_var_req = local_var_req_builder.build()?;
1135 let local_var_resp = local_var_client.execute(local_var_req).await?;
1136
1137 let local_var_status = local_var_resp.status();
1138 let local_var_content = local_var_resp.text().await?;
1139
1140 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1141 serde_json::from_str(&local_var_content).map_err(Error::from)
1142 } else {
1143 let local_var_entity: Option<GetV1QuestionsCountUnansweredError> =
1144 serde_json::from_str(&local_var_content).ok();
1145 let local_var_error = ResponseContent {
1146 status: local_var_status,
1147 content: local_var_content,
1148 entity: local_var_entity,
1149 };
1150 Err(Error::ResponseError(local_var_error))
1151 }
1152}
1153
1154pub async fn get_v1_seller_chats(
1156 configuration: &configuration::Configuration,
1157) -> Result<models::ChatsResponse, Error<GetV1SellerChatsError>> {
1158 let local_var_configuration = configuration;
1159
1160 let local_var_client = &local_var_configuration.client;
1161
1162 let local_var_uri_str = format!("{}/api/v1/seller/chats", local_var_configuration.base_path);
1163 let mut local_var_req_builder =
1164 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1165
1166 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1167 local_var_req_builder =
1168 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1169 }
1170 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1171 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
1172 };
1173
1174 let local_var_req = local_var_req_builder.build()?;
1175 let local_var_resp = local_var_client.execute(local_var_req).await?;
1176
1177 let local_var_status = local_var_resp.status();
1178 let local_var_content = local_var_resp.text().await?;
1179
1180 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1181 serde_json::from_str(&local_var_content).map_err(Error::from)
1182 } else {
1183 let local_var_entity: Option<GetV1SellerChatsError> =
1184 serde_json::from_str(&local_var_content).ok();
1185 let local_var_error = ResponseContent {
1186 status: local_var_status,
1187 content: local_var_content,
1188 entity: local_var_entity,
1189 };
1190 Err(Error::ResponseError(local_var_error))
1191 }
1192}
1193
1194pub async fn get_v1_seller_download_id(
1196 configuration: &configuration::Configuration,
1197 id: &str,
1198) -> Result<std::path::PathBuf, Error<GetV1SellerDownloadIdError>> {
1199 let local_var_configuration = configuration;
1200
1201 let local_var_client = &local_var_configuration.client;
1202
1203 let local_var_uri_str = format!(
1204 "{}/api/v1/seller/download/{id}",
1205 local_var_configuration.base_path,
1206 id = crate::communications::apis::urlencode(id)
1207 );
1208 let mut local_var_req_builder =
1209 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1210
1211 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1212 local_var_req_builder =
1213 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1214 }
1215 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1216 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
1217 };
1218
1219 let local_var_req = local_var_req_builder.build()?;
1220 let local_var_resp = local_var_client.execute(local_var_req).await?;
1221
1222 let local_var_status = local_var_resp.status();
1223 let local_var_content = local_var_resp.text().await?;
1224
1225 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1226 serde_json::from_str(&local_var_content).map_err(Error::from)
1227 } else {
1228 let local_var_entity: Option<GetV1SellerDownloadIdError> =
1229 serde_json::from_str(&local_var_content).ok();
1230 let local_var_error = ResponseContent {
1231 status: local_var_status,
1232 content: local_var_content,
1233 entity: local_var_entity,
1234 };
1235 Err(Error::ResponseError(local_var_error))
1236 }
1237}
1238
1239pub async fn get_v1_seller_events(
1241 configuration: &configuration::Configuration,
1242 next: Option<i64>,
1243) -> Result<models::EventsResponse, Error<GetV1SellerEventsError>> {
1244 let local_var_configuration = configuration;
1245
1246 let local_var_client = &local_var_configuration.client;
1247
1248 let local_var_uri_str = format!("{}/api/v1/seller/events", local_var_configuration.base_path);
1249 let mut local_var_req_builder =
1250 local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1251
1252 if let Some(ref local_var_str) = next {
1253 local_var_req_builder =
1254 local_var_req_builder.query(&[("next", &local_var_str.to_string())]);
1255 }
1256 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1257 local_var_req_builder =
1258 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1259 }
1260 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1261 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
1262 };
1263
1264 let local_var_req = local_var_req_builder.build()?;
1265 let local_var_resp = local_var_client.execute(local_var_req).await?;
1266
1267 let local_var_status = local_var_resp.status();
1268 let local_var_content = local_var_resp.text().await?;
1269
1270 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1271 serde_json::from_str(&local_var_content).map_err(Error::from)
1272 } else {
1273 let local_var_entity: Option<GetV1SellerEventsError> =
1274 serde_json::from_str(&local_var_content).ok();
1275 let local_var_error = ResponseContent {
1276 status: local_var_status,
1277 content: local_var_content,
1278 entity: local_var_entity,
1279 };
1280 Err(Error::ResponseError(local_var_error))
1281 }
1282}
1283
1284pub async fn patch_v1_claim(
1286 configuration: &configuration::Configuration,
1287 patch_v1_claim_request: models::PatchV1ClaimRequest,
1288) -> Result<(), Error<PatchV1ClaimError>> {
1289 let local_var_configuration = configuration;
1290
1291 let local_var_client = &local_var_configuration.client;
1292
1293 let local_var_uri_str = format!("{}/api/v1/claim", local_var_configuration.base_path);
1294 let mut local_var_req_builder =
1295 local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1296
1297 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1298 local_var_req_builder =
1299 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1300 }
1301 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1302 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
1303 };
1304 local_var_req_builder = local_var_req_builder.json(&patch_v1_claim_request);
1305
1306 let local_var_req = local_var_req_builder.build()?;
1307 let local_var_resp = local_var_client.execute(local_var_req).await?;
1308
1309 let local_var_status = local_var_resp.status();
1310 let local_var_content = local_var_resp.text().await?;
1311
1312 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1313 Ok(())
1314 } else {
1315 let local_var_entity: Option<PatchV1ClaimError> =
1316 serde_json::from_str(&local_var_content).ok();
1317 let local_var_error = ResponseContent {
1318 status: local_var_status,
1319 content: local_var_content,
1320 entity: local_var_entity,
1321 };
1322 Err(Error::ResponseError(local_var_error))
1323 }
1324}
1325
1326pub async fn patch_v1_feedbacks_answer(
1328 configuration: &configuration::Configuration,
1329 patch_v1_feedbacks_answer_request: Option<models::PatchV1FeedbacksAnswerRequest>,
1330) -> Result<(), Error<PatchV1FeedbacksAnswerError>> {
1331 let local_var_configuration = configuration;
1332
1333 let local_var_client = &local_var_configuration.client;
1334
1335 let local_var_uri_str = format!(
1336 "{}/api/v1/feedbacks/answer",
1337 local_var_configuration.base_path
1338 );
1339 let mut local_var_req_builder =
1340 local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1341
1342 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1343 local_var_req_builder =
1344 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1345 }
1346 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1347 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
1348 };
1349 local_var_req_builder = local_var_req_builder.json(&patch_v1_feedbacks_answer_request);
1350
1351 let local_var_req = local_var_req_builder.build()?;
1352 let local_var_resp = local_var_client.execute(local_var_req).await?;
1353
1354 let local_var_status = local_var_resp.status();
1355 let local_var_content = local_var_resp.text().await?;
1356
1357 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1358 Ok(())
1359 } else {
1360 let local_var_entity: Option<PatchV1FeedbacksAnswerError> =
1361 serde_json::from_str(&local_var_content).ok();
1362 let local_var_error = ResponseContent {
1363 status: local_var_status,
1364 content: local_var_content,
1365 entity: local_var_entity,
1366 };
1367 Err(Error::ResponseError(local_var_error))
1368 }
1369}
1370
1371pub async fn patch_v1_questions(
1373 configuration: &configuration::Configuration,
1374 patch_v1_questions_request: Option<models::PatchV1QuestionsRequest>,
1375) -> Result<models::PatchV1QuestionsResponse200, Error<PatchV1QuestionsError>> {
1376 let local_var_configuration = configuration;
1377
1378 let local_var_client = &local_var_configuration.client;
1379
1380 let local_var_uri_str = format!("{}/api/v1/questions", local_var_configuration.base_path);
1381 let mut local_var_req_builder =
1382 local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1383
1384 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1385 local_var_req_builder =
1386 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1387 }
1388 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1389 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
1390 };
1391 local_var_req_builder = local_var_req_builder.json(&patch_v1_questions_request);
1392
1393 let local_var_req = local_var_req_builder.build()?;
1394 let local_var_resp = local_var_client.execute(local_var_req).await?;
1395
1396 let local_var_status = local_var_resp.status();
1397 let local_var_content = local_var_resp.text().await?;
1398
1399 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1400 serde_json::from_str(&local_var_content).map_err(Error::from)
1401 } else {
1402 let local_var_entity: Option<PatchV1QuestionsError> =
1403 serde_json::from_str(&local_var_content).ok();
1404 let local_var_error = ResponseContent {
1405 status: local_var_status,
1406 content: local_var_content,
1407 entity: local_var_entity,
1408 };
1409 Err(Error::ResponseError(local_var_error))
1410 }
1411}
1412
1413pub async fn post_v1_feedbacks_answer(
1415 configuration: &configuration::Configuration,
1416 post_v1_feedbacks_answer_request: Option<models::PostV1FeedbacksAnswerRequest>,
1417) -> Result<(), Error<PostV1FeedbacksAnswerError>> {
1418 let local_var_configuration = configuration;
1419
1420 let local_var_client = &local_var_configuration.client;
1421
1422 let local_var_uri_str = format!(
1423 "{}/api/v1/feedbacks/answer",
1424 local_var_configuration.base_path
1425 );
1426 let mut local_var_req_builder =
1427 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1428
1429 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1430 local_var_req_builder =
1431 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1432 }
1433 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1434 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
1435 };
1436 local_var_req_builder = local_var_req_builder.json(&post_v1_feedbacks_answer_request);
1437
1438 let local_var_req = local_var_req_builder.build()?;
1439 let local_var_resp = local_var_client.execute(local_var_req).await?;
1440
1441 let local_var_status = local_var_resp.status();
1442 let local_var_content = local_var_resp.text().await?;
1443
1444 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1445 Ok(())
1446 } else {
1447 let local_var_entity: Option<PostV1FeedbacksAnswerError> =
1448 serde_json::from_str(&local_var_content).ok();
1449 let local_var_error = ResponseContent {
1450 status: local_var_status,
1451 content: local_var_content,
1452 entity: local_var_entity,
1453 };
1454 Err(Error::ResponseError(local_var_error))
1455 }
1456}
1457
1458pub async fn post_v1_feedbacks_order_return(
1460 configuration: &configuration::Configuration,
1461 post_v1_feedbacks_order_return_request: models::PostV1FeedbacksOrderReturnRequest,
1462) -> Result<models::PostV1FeedbacksOrderReturnResponse200, Error<PostV1FeedbacksOrderReturnError>> {
1463 let local_var_configuration = configuration;
1464
1465 let local_var_client = &local_var_configuration.client;
1466
1467 let local_var_uri_str = format!(
1468 "{}/api/v1/feedbacks/order/return",
1469 local_var_configuration.base_path
1470 );
1471 let mut local_var_req_builder =
1472 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1473
1474 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1475 local_var_req_builder =
1476 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1477 }
1478 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1479 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
1480 };
1481 local_var_req_builder = local_var_req_builder.json(&post_v1_feedbacks_order_return_request);
1482
1483 let local_var_req = local_var_req_builder.build()?;
1484 let local_var_resp = local_var_client.execute(local_var_req).await?;
1485
1486 let local_var_status = local_var_resp.status();
1487 let local_var_content = local_var_resp.text().await?;
1488
1489 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1490 serde_json::from_str(&local_var_content).map_err(Error::from)
1491 } else {
1492 let local_var_entity: Option<PostV1FeedbacksOrderReturnError> =
1493 serde_json::from_str(&local_var_content).ok();
1494 let local_var_error = ResponseContent {
1495 status: local_var_status,
1496 content: local_var_content,
1497 entity: local_var_entity,
1498 };
1499 Err(Error::ResponseError(local_var_error))
1500 }
1501}
1502
1503pub async fn post_v1_pins(
1505 configuration: &configuration::Configuration,
1506 openapi_period_pin_review_item: Vec<models::OpenapiPeriodPinReviewItem>,
1507) -> Result<models::PostV1PinsResponse200, Error<PostV1PinsError>> {
1508 let local_var_configuration = configuration;
1509
1510 let local_var_client = &local_var_configuration.client;
1511
1512 let local_var_uri_str = format!(
1513 "{}/api/feedbacks/v1/pins",
1514 local_var_configuration.base_path
1515 );
1516 let mut local_var_req_builder =
1517 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1518
1519 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1520 local_var_req_builder =
1521 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1522 }
1523 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1524 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
1525 };
1526 local_var_req_builder = local_var_req_builder.json(&openapi_period_pin_review_item);
1527
1528 let local_var_req = local_var_req_builder.build()?;
1529 let local_var_resp = local_var_client.execute(local_var_req).await?;
1530
1531 let local_var_status = local_var_resp.status();
1532 let local_var_content = local_var_resp.text().await?;
1533
1534 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1535 serde_json::from_str(&local_var_content).map_err(Error::from)
1536 } else {
1537 let local_var_entity: Option<PostV1PinsError> =
1538 serde_json::from_str(&local_var_content).ok();
1539 let local_var_error = ResponseContent {
1540 status: local_var_status,
1541 content: local_var_content,
1542 entity: local_var_entity,
1543 };
1544 Err(Error::ResponseError(local_var_error))
1545 }
1546}
1547
1548pub async fn post_v1_seller_message(
1550 configuration: &configuration::Configuration,
1551 reply_sign: &str,
1552 message: Option<&str>,
1553 file: Option<Vec<std::path::PathBuf>>,
1554) -> Result<models::MessageResponse, Error<PostV1SellerMessageError>> {
1555 let local_var_configuration = configuration;
1556
1557 let local_var_client = &local_var_configuration.client;
1558
1559 let local_var_uri_str = format!(
1560 "{}/api/v1/seller/message",
1561 local_var_configuration.base_path
1562 );
1563 let mut local_var_req_builder =
1564 local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1565
1566 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1567 local_var_req_builder =
1568 local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1569 }
1570 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
1571 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.expose_secret());
1572 };
1573 let mut local_var_form = reqwest::multipart::Form::new();
1574 local_var_form = local_var_form.text("replySign", reply_sign.to_string());
1575 if let Some(local_var_param_value) = message {
1576 local_var_form = local_var_form.text("message", local_var_param_value.to_string());
1577 }
1578 if let Some(local_var_files) = file {
1579 for local_var_file in local_var_files {
1580 let local_var_part = reqwest::multipart::Part::file(local_var_file).await?;
1581 local_var_form = local_var_form.part("file", local_var_part);
1582 }
1583 }
1584 local_var_req_builder = local_var_req_builder.multipart(local_var_form);
1585
1586 let local_var_req = local_var_req_builder.build()?;
1587 let local_var_resp = local_var_client.execute(local_var_req).await?;
1588
1589 let local_var_status = local_var_resp.status();
1590 let local_var_content = local_var_resp.text().await?;
1591
1592 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1593 serde_json::from_str(&local_var_content).map_err(Error::from)
1594 } else {
1595 let local_var_entity: Option<PostV1SellerMessageError> =
1596 serde_json::from_str(&local_var_content).ok();
1597 let local_var_error = ResponseContent {
1598 status: local_var_status,
1599 content: local_var_content,
1600 entity: local_var_entity,
1601 };
1602 Err(Error::ResponseError(local_var_error))
1603 }
1604}