Skip to main content

fastcomments_sdk/client/src/apis/
default_api.rs

1/*
2 * fastcomments
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 0.0.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::client::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17/// struct for passing parameters to the method [`add_domain_config`]
18#[derive(Clone, Debug)]
19pub struct AddDomainConfigParams {
20    pub tenant_id: String,
21    pub add_domain_config_params: models::AddDomainConfigParams
22}
23
24/// struct for passing parameters to the method [`add_hash_tag`]
25#[derive(Clone, Debug)]
26pub struct AddHashTagParams {
27    pub tenant_id: String,
28    pub create_hash_tag_body: Option<models::CreateHashTagBody>
29}
30
31/// struct for passing parameters to the method [`add_hash_tags_bulk`]
32#[derive(Clone, Debug)]
33pub struct AddHashTagsBulkParams {
34    pub tenant_id: String,
35    pub bulk_create_hash_tags_body: Option<models::BulkCreateHashTagsBody>
36}
37
38/// struct for passing parameters to the method [`add_page`]
39#[derive(Clone, Debug)]
40pub struct AddPageParams {
41    pub tenant_id: String,
42    pub create_api_page_data: models::CreateApiPageData
43}
44
45/// struct for passing parameters to the method [`add_sso_user`]
46#[derive(Clone, Debug)]
47pub struct AddSsoUserParams {
48    pub tenant_id: String,
49    pub create_apisso_user_data: models::CreateApissoUserData
50}
51
52/// struct for passing parameters to the method [`aggregate`]
53#[derive(Clone, Debug)]
54pub struct AggregateParams {
55    pub tenant_id: String,
56    pub aggregation_request: models::AggregationRequest,
57    pub parent_tenant_id: Option<String>,
58    pub include_stats: Option<bool>
59}
60
61/// struct for passing parameters to the method [`aggregate_question_results`]
62#[derive(Clone, Debug)]
63pub struct AggregateQuestionResultsParams {
64    pub tenant_id: String,
65    pub question_id: Option<String>,
66    pub question_ids: Option<Vec<String>>,
67    pub url_id: Option<String>,
68    pub time_bucket: Option<models::AggregateTimeBucket>,
69    pub start_date: Option<chrono::DateTime<chrono::FixedOffset>>,
70    pub force_recalculate: Option<bool>
71}
72
73/// struct for passing parameters to the method [`block_user_from_comment`]
74#[derive(Clone, Debug)]
75pub struct BlockUserFromCommentParams {
76    pub tenant_id: String,
77    pub id: String,
78    pub block_from_comment_params: models::BlockFromCommentParams,
79    pub user_id: Option<String>,
80    pub anon_user_id: Option<String>
81}
82
83/// struct for passing parameters to the method [`bulk_aggregate_question_results`]
84#[derive(Clone, Debug)]
85pub struct BulkAggregateQuestionResultsParams {
86    pub tenant_id: String,
87    pub bulk_aggregate_question_results_request: models::BulkAggregateQuestionResultsRequest,
88    pub force_recalculate: Option<bool>
89}
90
91/// struct for passing parameters to the method [`change_ticket_state`]
92#[derive(Clone, Debug)]
93pub struct ChangeTicketStateParams {
94    pub tenant_id: String,
95    pub user_id: String,
96    pub id: String,
97    pub change_ticket_state_body: models::ChangeTicketStateBody
98}
99
100/// struct for passing parameters to the method [`combine_comments_with_question_results`]
101#[derive(Clone, Debug)]
102pub struct CombineCommentsWithQuestionResultsParams {
103    pub tenant_id: String,
104    pub question_id: Option<String>,
105    pub question_ids: Option<Vec<String>>,
106    pub url_id: Option<String>,
107    pub start_date: Option<chrono::DateTime<chrono::FixedOffset>>,
108    pub force_recalculate: Option<bool>,
109    pub min_value: Option<f64>,
110    pub max_value: Option<f64>,
111    pub limit: Option<f64>
112}
113
114/// struct for passing parameters to the method [`create_email_template`]
115#[derive(Clone, Debug)]
116pub struct CreateEmailTemplateParams {
117    pub tenant_id: String,
118    pub create_email_template_body: models::CreateEmailTemplateBody
119}
120
121/// struct for passing parameters to the method [`create_feed_post`]
122#[derive(Clone, Debug)]
123pub struct CreateFeedPostParams {
124    pub tenant_id: String,
125    pub create_feed_post_params: models::CreateFeedPostParams,
126    pub broadcast_id: Option<String>,
127    pub is_live: Option<bool>,
128    pub do_spam_check: Option<bool>,
129    pub skip_dup_check: Option<bool>
130}
131
132/// struct for passing parameters to the method [`create_moderator`]
133#[derive(Clone, Debug)]
134pub struct CreateModeratorParams {
135    pub tenant_id: String,
136    pub create_moderator_body: models::CreateModeratorBody
137}
138
139/// struct for passing parameters to the method [`create_question_config`]
140#[derive(Clone, Debug)]
141pub struct CreateQuestionConfigParams {
142    pub tenant_id: String,
143    pub create_question_config_body: models::CreateQuestionConfigBody
144}
145
146/// struct for passing parameters to the method [`create_question_result`]
147#[derive(Clone, Debug)]
148pub struct CreateQuestionResultParams {
149    pub tenant_id: String,
150    pub create_question_result_body: models::CreateQuestionResultBody
151}
152
153/// struct for passing parameters to the method [`create_subscription`]
154#[derive(Clone, Debug)]
155pub struct CreateSubscriptionParams {
156    pub tenant_id: String,
157    pub create_api_user_subscription_data: models::CreateApiUserSubscriptionData
158}
159
160/// struct for passing parameters to the method [`create_tenant`]
161#[derive(Clone, Debug)]
162pub struct CreateTenantParams {
163    pub tenant_id: String,
164    pub create_tenant_body: models::CreateTenantBody
165}
166
167/// struct for passing parameters to the method [`create_tenant_package`]
168#[derive(Clone, Debug)]
169pub struct CreateTenantPackageParams {
170    pub tenant_id: String,
171    pub create_tenant_package_body: models::CreateTenantPackageBody
172}
173
174/// struct for passing parameters to the method [`create_tenant_user`]
175#[derive(Clone, Debug)]
176pub struct CreateTenantUserParams {
177    pub tenant_id: String,
178    pub create_tenant_user_body: models::CreateTenantUserBody
179}
180
181/// struct for passing parameters to the method [`create_ticket`]
182#[derive(Clone, Debug)]
183pub struct CreateTicketParams {
184    pub tenant_id: String,
185    pub user_id: String,
186    pub create_ticket_body: models::CreateTicketBody
187}
188
189/// struct for passing parameters to the method [`create_user_badge`]
190#[derive(Clone, Debug)]
191pub struct CreateUserBadgeParams {
192    pub tenant_id: String,
193    pub create_user_badge_params: models::CreateUserBadgeParams
194}
195
196/// struct for passing parameters to the method [`create_vote`]
197#[derive(Clone, Debug)]
198pub struct CreateVoteParams {
199    pub tenant_id: String,
200    pub comment_id: String,
201    pub direction: String,
202    pub user_id: Option<String>,
203    pub anon_user_id: Option<String>
204}
205
206/// struct for passing parameters to the method [`delete_comment`]
207#[derive(Clone, Debug)]
208pub struct DeleteCommentParams {
209    pub tenant_id: String,
210    pub id: String,
211    pub context_user_id: Option<String>,
212    pub is_live: Option<bool>
213}
214
215/// struct for passing parameters to the method [`delete_domain_config`]
216#[derive(Clone, Debug)]
217pub struct DeleteDomainConfigParams {
218    pub tenant_id: String,
219    pub domain: String
220}
221
222/// struct for passing parameters to the method [`delete_email_template`]
223#[derive(Clone, Debug)]
224pub struct DeleteEmailTemplateParams {
225    pub tenant_id: String,
226    pub id: String
227}
228
229/// struct for passing parameters to the method [`delete_email_template_render_error`]
230#[derive(Clone, Debug)]
231pub struct DeleteEmailTemplateRenderErrorParams {
232    pub tenant_id: String,
233    pub id: String,
234    pub error_id: String
235}
236
237/// struct for passing parameters to the method [`delete_hash_tag`]
238#[derive(Clone, Debug)]
239pub struct DeleteHashTagParams {
240    pub tenant_id: String,
241    pub tag: String,
242    pub delete_hash_tag_request_body: Option<models::DeleteHashTagRequestBody>
243}
244
245/// struct for passing parameters to the method [`delete_moderator`]
246#[derive(Clone, Debug)]
247pub struct DeleteModeratorParams {
248    pub tenant_id: String,
249    pub id: String,
250    pub send_email: Option<String>
251}
252
253/// struct for passing parameters to the method [`delete_notification_count`]
254#[derive(Clone, Debug)]
255pub struct DeleteNotificationCountParams {
256    pub tenant_id: String,
257    pub id: String
258}
259
260/// struct for passing parameters to the method [`delete_page`]
261#[derive(Clone, Debug)]
262pub struct DeletePageParams {
263    pub tenant_id: String,
264    pub id: String
265}
266
267/// struct for passing parameters to the method [`delete_pending_webhook_event`]
268#[derive(Clone, Debug)]
269pub struct DeletePendingWebhookEventParams {
270    pub tenant_id: String,
271    pub id: String
272}
273
274/// struct for passing parameters to the method [`delete_question_config`]
275#[derive(Clone, Debug)]
276pub struct DeleteQuestionConfigParams {
277    pub tenant_id: String,
278    pub id: String
279}
280
281/// struct for passing parameters to the method [`delete_question_result`]
282#[derive(Clone, Debug)]
283pub struct DeleteQuestionResultParams {
284    pub tenant_id: String,
285    pub id: String
286}
287
288/// struct for passing parameters to the method [`delete_sso_user`]
289#[derive(Clone, Debug)]
290pub struct DeleteSsoUserParams {
291    pub tenant_id: String,
292    pub id: String,
293    pub delete_comments: Option<bool>,
294    pub comment_delete_mode: Option<String>
295}
296
297/// struct for passing parameters to the method [`delete_subscription`]
298#[derive(Clone, Debug)]
299pub struct DeleteSubscriptionParams {
300    pub tenant_id: String,
301    pub id: String,
302    pub user_id: Option<String>
303}
304
305/// struct for passing parameters to the method [`delete_tenant`]
306#[derive(Clone, Debug)]
307pub struct DeleteTenantParams {
308    pub tenant_id: String,
309    pub id: String,
310    pub sure: Option<String>
311}
312
313/// struct for passing parameters to the method [`delete_tenant_package`]
314#[derive(Clone, Debug)]
315pub struct DeleteTenantPackageParams {
316    pub tenant_id: String,
317    pub id: String
318}
319
320/// struct for passing parameters to the method [`delete_tenant_user`]
321#[derive(Clone, Debug)]
322pub struct DeleteTenantUserParams {
323    pub tenant_id: String,
324    pub id: String,
325    pub delete_comments: Option<String>,
326    pub comment_delete_mode: Option<String>
327}
328
329/// struct for passing parameters to the method [`delete_user_badge`]
330#[derive(Clone, Debug)]
331pub struct DeleteUserBadgeParams {
332    pub tenant_id: String,
333    pub id: String
334}
335
336/// struct for passing parameters to the method [`delete_vote`]
337#[derive(Clone, Debug)]
338pub struct DeleteVoteParams {
339    pub tenant_id: String,
340    pub id: String,
341    pub edit_key: Option<String>
342}
343
344/// struct for passing parameters to the method [`flag_comment`]
345#[derive(Clone, Debug)]
346pub struct FlagCommentParams {
347    pub tenant_id: String,
348    pub id: String,
349    pub user_id: Option<String>,
350    pub anon_user_id: Option<String>
351}
352
353/// struct for passing parameters to the method [`get_audit_logs`]
354#[derive(Clone, Debug)]
355pub struct GetAuditLogsParams {
356    pub tenant_id: String,
357    pub limit: Option<f64>,
358    pub skip: Option<f64>,
359    pub order: Option<models::SortDir>,
360    pub after: Option<f64>,
361    pub before: Option<f64>
362}
363
364/// struct for passing parameters to the method [`get_cached_notification_count`]
365#[derive(Clone, Debug)]
366pub struct GetCachedNotificationCountParams {
367    pub tenant_id: String,
368    pub id: String
369}
370
371/// struct for passing parameters to the method [`get_comment`]
372#[derive(Clone, Debug)]
373pub struct GetCommentParams {
374    pub tenant_id: String,
375    pub id: String
376}
377
378/// struct for passing parameters to the method [`get_comments`]
379#[derive(Clone, Debug)]
380pub struct GetCommentsParams {
381    pub tenant_id: String,
382    pub page: Option<i32>,
383    pub limit: Option<i32>,
384    pub skip: Option<i32>,
385    pub as_tree: Option<bool>,
386    pub skip_children: Option<i32>,
387    pub limit_children: Option<i32>,
388    pub max_tree_depth: Option<i32>,
389    pub url_id: Option<String>,
390    pub user_id: Option<String>,
391    pub anon_user_id: Option<String>,
392    pub context_user_id: Option<String>,
393    pub hash_tag: Option<String>,
394    pub parent_id: Option<String>,
395    pub direction: Option<models::SortDirections>,
396    pub from_date: Option<i64>,
397    pub to_date: Option<i64>
398}
399
400/// struct for passing parameters to the method [`get_domain_config`]
401#[derive(Clone, Debug)]
402pub struct GetDomainConfigParams {
403    pub tenant_id: String,
404    pub domain: String
405}
406
407/// struct for passing parameters to the method [`get_domain_configs`]
408#[derive(Clone, Debug)]
409pub struct GetDomainConfigsParams {
410    pub tenant_id: String
411}
412
413/// struct for passing parameters to the method [`get_email_template`]
414#[derive(Clone, Debug)]
415pub struct GetEmailTemplateParams {
416    pub tenant_id: String,
417    pub id: String
418}
419
420/// struct for passing parameters to the method [`get_email_template_definitions`]
421#[derive(Clone, Debug)]
422pub struct GetEmailTemplateDefinitionsParams {
423    pub tenant_id: String
424}
425
426/// struct for passing parameters to the method [`get_email_template_render_errors`]
427#[derive(Clone, Debug)]
428pub struct GetEmailTemplateRenderErrorsParams {
429    pub tenant_id: String,
430    pub id: String,
431    pub skip: Option<f64>
432}
433
434/// struct for passing parameters to the method [`get_email_templates`]
435#[derive(Clone, Debug)]
436pub struct GetEmailTemplatesParams {
437    pub tenant_id: String,
438    pub skip: Option<f64>
439}
440
441/// struct for passing parameters to the method [`get_feed_posts`]
442#[derive(Clone, Debug)]
443pub struct GetFeedPostsParams {
444    pub tenant_id: String,
445    pub after_id: Option<String>,
446    pub limit: Option<i32>,
447    pub tags: Option<Vec<String>>
448}
449
450/// struct for passing parameters to the method [`get_hash_tags`]
451#[derive(Clone, Debug)]
452pub struct GetHashTagsParams {
453    pub tenant_id: String,
454    pub page: Option<f64>
455}
456
457/// struct for passing parameters to the method [`get_moderator`]
458#[derive(Clone, Debug)]
459pub struct GetModeratorParams {
460    pub tenant_id: String,
461    pub id: String
462}
463
464/// struct for passing parameters to the method [`get_moderators`]
465#[derive(Clone, Debug)]
466pub struct GetModeratorsParams {
467    pub tenant_id: String,
468    pub skip: Option<f64>
469}
470
471/// struct for passing parameters to the method [`get_notification_count`]
472#[derive(Clone, Debug)]
473pub struct GetNotificationCountParams {
474    pub tenant_id: String,
475    pub user_id: Option<String>,
476    pub url_id: Option<String>,
477    pub from_comment_id: Option<String>,
478    pub viewed: Option<bool>,
479    pub r#type: Option<String>
480}
481
482/// struct for passing parameters to the method [`get_notifications`]
483#[derive(Clone, Debug)]
484pub struct GetNotificationsParams {
485    pub tenant_id: String,
486    pub user_id: Option<String>,
487    pub url_id: Option<String>,
488    pub from_comment_id: Option<String>,
489    pub viewed: Option<bool>,
490    pub r#type: Option<String>,
491    pub skip: Option<f64>
492}
493
494/// struct for passing parameters to the method [`get_page_by_urlid`]
495#[derive(Clone, Debug)]
496pub struct GetPageByUrlidParams {
497    pub tenant_id: String,
498    pub url_id: String
499}
500
501/// struct for passing parameters to the method [`get_pages`]
502#[derive(Clone, Debug)]
503pub struct GetPagesParams {
504    pub tenant_id: String
505}
506
507/// struct for passing parameters to the method [`get_pending_webhook_event_count`]
508#[derive(Clone, Debug)]
509pub struct GetPendingWebhookEventCountParams {
510    pub tenant_id: String,
511    pub comment_id: Option<String>,
512    pub external_id: Option<String>,
513    pub event_type: Option<String>,
514    pub r#type: Option<String>,
515    pub domain: Option<String>,
516    pub attempt_count_gt: Option<f64>
517}
518
519/// struct for passing parameters to the method [`get_pending_webhook_events`]
520#[derive(Clone, Debug)]
521pub struct GetPendingWebhookEventsParams {
522    pub tenant_id: String,
523    pub comment_id: Option<String>,
524    pub external_id: Option<String>,
525    pub event_type: Option<String>,
526    pub r#type: Option<String>,
527    pub domain: Option<String>,
528    pub attempt_count_gt: Option<f64>,
529    pub skip: Option<f64>
530}
531
532/// struct for passing parameters to the method [`get_question_config`]
533#[derive(Clone, Debug)]
534pub struct GetQuestionConfigParams {
535    pub tenant_id: String,
536    pub id: String
537}
538
539/// struct for passing parameters to the method [`get_question_configs`]
540#[derive(Clone, Debug)]
541pub struct GetQuestionConfigsParams {
542    pub tenant_id: String,
543    pub skip: Option<f64>
544}
545
546/// struct for passing parameters to the method [`get_question_result`]
547#[derive(Clone, Debug)]
548pub struct GetQuestionResultParams {
549    pub tenant_id: String,
550    pub id: String
551}
552
553/// struct for passing parameters to the method [`get_question_results`]
554#[derive(Clone, Debug)]
555pub struct GetQuestionResultsParams {
556    pub tenant_id: String,
557    pub url_id: Option<String>,
558    pub user_id: Option<String>,
559    pub start_date: Option<String>,
560    pub question_id: Option<String>,
561    pub question_ids: Option<String>,
562    pub skip: Option<f64>
563}
564
565/// struct for passing parameters to the method [`get_sso_user_by_email`]
566#[derive(Clone, Debug)]
567pub struct GetSsoUserByEmailParams {
568    pub tenant_id: String,
569    pub email: String
570}
571
572/// struct for passing parameters to the method [`get_sso_user_by_id`]
573#[derive(Clone, Debug)]
574pub struct GetSsoUserByIdParams {
575    pub tenant_id: String,
576    pub id: String
577}
578
579/// struct for passing parameters to the method [`get_sso_users`]
580#[derive(Clone, Debug)]
581pub struct GetSsoUsersParams {
582    pub tenant_id: String,
583    pub skip: Option<i32>
584}
585
586/// struct for passing parameters to the method [`get_subscriptions`]
587#[derive(Clone, Debug)]
588pub struct GetSubscriptionsParams {
589    pub tenant_id: String,
590    pub user_id: Option<String>
591}
592
593/// struct for passing parameters to the method [`get_tenant`]
594#[derive(Clone, Debug)]
595pub struct GetTenantParams {
596    pub tenant_id: String,
597    pub id: String
598}
599
600/// struct for passing parameters to the method [`get_tenant_daily_usages`]
601#[derive(Clone, Debug)]
602pub struct GetTenantDailyUsagesParams {
603    pub tenant_id: String,
604    pub year_number: Option<f64>,
605    pub month_number: Option<f64>,
606    pub day_number: Option<f64>,
607    pub skip: Option<f64>
608}
609
610/// struct for passing parameters to the method [`get_tenant_package`]
611#[derive(Clone, Debug)]
612pub struct GetTenantPackageParams {
613    pub tenant_id: String,
614    pub id: String
615}
616
617/// struct for passing parameters to the method [`get_tenant_packages`]
618#[derive(Clone, Debug)]
619pub struct GetTenantPackagesParams {
620    pub tenant_id: String,
621    pub skip: Option<f64>
622}
623
624/// struct for passing parameters to the method [`get_tenant_user`]
625#[derive(Clone, Debug)]
626pub struct GetTenantUserParams {
627    pub tenant_id: String,
628    pub id: String
629}
630
631/// struct for passing parameters to the method [`get_tenant_users`]
632#[derive(Clone, Debug)]
633pub struct GetTenantUsersParams {
634    pub tenant_id: String,
635    pub skip: Option<f64>
636}
637
638/// struct for passing parameters to the method [`get_tenants`]
639#[derive(Clone, Debug)]
640pub struct GetTenantsParams {
641    pub tenant_id: String,
642    pub meta: Option<String>,
643    pub skip: Option<f64>
644}
645
646/// struct for passing parameters to the method [`get_ticket`]
647#[derive(Clone, Debug)]
648pub struct GetTicketParams {
649    pub tenant_id: String,
650    pub id: String,
651    pub user_id: Option<String>
652}
653
654/// struct for passing parameters to the method [`get_tickets`]
655#[derive(Clone, Debug)]
656pub struct GetTicketsParams {
657    pub tenant_id: String,
658    pub user_id: Option<String>,
659    pub state: Option<f64>,
660    pub skip: Option<f64>,
661    pub limit: Option<f64>
662}
663
664/// struct for passing parameters to the method [`get_user`]
665#[derive(Clone, Debug)]
666pub struct GetUserParams {
667    pub tenant_id: String,
668    pub id: String
669}
670
671/// struct for passing parameters to the method [`get_user_badge`]
672#[derive(Clone, Debug)]
673pub struct GetUserBadgeParams {
674    pub tenant_id: String,
675    pub id: String
676}
677
678/// struct for passing parameters to the method [`get_user_badge_progress_by_id`]
679#[derive(Clone, Debug)]
680pub struct GetUserBadgeProgressByIdParams {
681    pub tenant_id: String,
682    pub id: String
683}
684
685/// struct for passing parameters to the method [`get_user_badge_progress_by_user_id`]
686#[derive(Clone, Debug)]
687pub struct GetUserBadgeProgressByUserIdParams {
688    pub tenant_id: String,
689    pub user_id: String
690}
691
692/// struct for passing parameters to the method [`get_user_badge_progress_list`]
693#[derive(Clone, Debug)]
694pub struct GetUserBadgeProgressListParams {
695    pub tenant_id: String,
696    pub user_id: Option<String>,
697    pub limit: Option<f64>,
698    pub skip: Option<f64>
699}
700
701/// struct for passing parameters to the method [`get_user_badges`]
702#[derive(Clone, Debug)]
703pub struct GetUserBadgesParams {
704    pub tenant_id: String,
705    pub user_id: Option<String>,
706    pub badge_id: Option<String>,
707    pub r#type: Option<f64>,
708    pub displayed_on_comments: Option<bool>,
709    pub limit: Option<f64>,
710    pub skip: Option<f64>
711}
712
713/// struct for passing parameters to the method [`get_votes`]
714#[derive(Clone, Debug)]
715pub struct GetVotesParams {
716    pub tenant_id: String,
717    pub url_id: String
718}
719
720/// struct for passing parameters to the method [`get_votes_for_user`]
721#[derive(Clone, Debug)]
722pub struct GetVotesForUserParams {
723    pub tenant_id: String,
724    pub url_id: String,
725    pub user_id: Option<String>,
726    pub anon_user_id: Option<String>
727}
728
729/// struct for passing parameters to the method [`patch_domain_config`]
730#[derive(Clone, Debug)]
731pub struct PatchDomainConfigParams {
732    pub tenant_id: String,
733    pub domain_to_update: String,
734    pub patch_domain_config_params: models::PatchDomainConfigParams
735}
736
737/// struct for passing parameters to the method [`patch_hash_tag`]
738#[derive(Clone, Debug)]
739pub struct PatchHashTagParams {
740    pub tenant_id: String,
741    pub tag: String,
742    pub update_hash_tag_body: Option<models::UpdateHashTagBody>
743}
744
745/// struct for passing parameters to the method [`patch_page`]
746#[derive(Clone, Debug)]
747pub struct PatchPageParams {
748    pub tenant_id: String,
749    pub id: String,
750    pub update_api_page_data: models::UpdateApiPageData
751}
752
753/// struct for passing parameters to the method [`patch_sso_user`]
754#[derive(Clone, Debug)]
755pub struct PatchSsoUserParams {
756    pub tenant_id: String,
757    pub id: String,
758    pub update_apisso_user_data: models::UpdateApissoUserData,
759    pub update_comments: Option<bool>
760}
761
762/// struct for passing parameters to the method [`put_domain_config`]
763#[derive(Clone, Debug)]
764pub struct PutDomainConfigParams {
765    pub tenant_id: String,
766    pub domain_to_update: String,
767    pub update_domain_config_params: models::UpdateDomainConfigParams
768}
769
770/// struct for passing parameters to the method [`put_sso_user`]
771#[derive(Clone, Debug)]
772pub struct PutSsoUserParams {
773    pub tenant_id: String,
774    pub id: String,
775    pub update_apisso_user_data: models::UpdateApissoUserData,
776    pub update_comments: Option<bool>
777}
778
779/// struct for passing parameters to the method [`render_email_template`]
780#[derive(Clone, Debug)]
781pub struct RenderEmailTemplateParams {
782    pub tenant_id: String,
783    pub render_email_template_body: models::RenderEmailTemplateBody,
784    pub locale: Option<String>
785}
786
787/// struct for passing parameters to the method [`replace_tenant_package`]
788#[derive(Clone, Debug)]
789pub struct ReplaceTenantPackageParams {
790    pub tenant_id: String,
791    pub id: String,
792    pub replace_tenant_package_body: models::ReplaceTenantPackageBody
793}
794
795/// struct for passing parameters to the method [`replace_tenant_user`]
796#[derive(Clone, Debug)]
797pub struct ReplaceTenantUserParams {
798    pub tenant_id: String,
799    pub id: String,
800    pub replace_tenant_user_body: models::ReplaceTenantUserBody,
801    pub update_comments: Option<String>
802}
803
804/// struct for passing parameters to the method [`save_comment`]
805#[derive(Clone, Debug)]
806pub struct SaveCommentParams {
807    pub tenant_id: String,
808    pub create_comment_params: models::CreateCommentParams,
809    pub is_live: Option<bool>,
810    pub do_spam_check: Option<bool>,
811    pub send_emails: Option<bool>,
812    pub populate_notifications: Option<bool>
813}
814
815/// struct for passing parameters to the method [`save_comments_bulk`]
816#[derive(Clone, Debug)]
817pub struct SaveCommentsBulkParams {
818    pub tenant_id: String,
819    pub create_comment_params: Vec<models::CreateCommentParams>,
820    pub is_live: Option<bool>,
821    pub do_spam_check: Option<bool>,
822    pub send_emails: Option<bool>,
823    pub populate_notifications: Option<bool>
824}
825
826/// struct for passing parameters to the method [`send_invite`]
827#[derive(Clone, Debug)]
828pub struct SendInviteParams {
829    pub tenant_id: String,
830    pub id: String,
831    pub from_name: String
832}
833
834/// struct for passing parameters to the method [`send_login_link`]
835#[derive(Clone, Debug)]
836pub struct SendLoginLinkParams {
837    pub tenant_id: String,
838    pub id: String,
839    pub redirect_url: Option<String>
840}
841
842/// struct for passing parameters to the method [`un_block_user_from_comment`]
843#[derive(Clone, Debug)]
844pub struct UnBlockUserFromCommentParams {
845    pub tenant_id: String,
846    pub id: String,
847    pub un_block_from_comment_params: models::UnBlockFromCommentParams,
848    pub user_id: Option<String>,
849    pub anon_user_id: Option<String>
850}
851
852/// struct for passing parameters to the method [`un_flag_comment`]
853#[derive(Clone, Debug)]
854pub struct UnFlagCommentParams {
855    pub tenant_id: String,
856    pub id: String,
857    pub user_id: Option<String>,
858    pub anon_user_id: Option<String>
859}
860
861/// struct for passing parameters to the method [`update_comment`]
862#[derive(Clone, Debug)]
863pub struct UpdateCommentParams {
864    pub tenant_id: String,
865    pub id: String,
866    pub updatable_comment_params: models::UpdatableCommentParams,
867    pub context_user_id: Option<String>,
868    pub do_spam_check: Option<bool>,
869    pub is_live: Option<bool>
870}
871
872/// struct for passing parameters to the method [`update_email_template`]
873#[derive(Clone, Debug)]
874pub struct UpdateEmailTemplateParams {
875    pub tenant_id: String,
876    pub id: String,
877    pub update_email_template_body: models::UpdateEmailTemplateBody
878}
879
880/// struct for passing parameters to the method [`update_feed_post`]
881#[derive(Clone, Debug)]
882pub struct UpdateFeedPostParams {
883    pub tenant_id: String,
884    pub id: String,
885    pub feed_post: models::FeedPost
886}
887
888/// struct for passing parameters to the method [`update_moderator`]
889#[derive(Clone, Debug)]
890pub struct UpdateModeratorParams {
891    pub tenant_id: String,
892    pub id: String,
893    pub update_moderator_body: models::UpdateModeratorBody
894}
895
896/// struct for passing parameters to the method [`update_notification`]
897#[derive(Clone, Debug)]
898pub struct UpdateNotificationParams {
899    pub tenant_id: String,
900    pub id: String,
901    pub update_notification_body: models::UpdateNotificationBody,
902    pub user_id: Option<String>
903}
904
905/// struct for passing parameters to the method [`update_question_config`]
906#[derive(Clone, Debug)]
907pub struct UpdateQuestionConfigParams {
908    pub tenant_id: String,
909    pub id: String,
910    pub update_question_config_body: models::UpdateQuestionConfigBody
911}
912
913/// struct for passing parameters to the method [`update_question_result`]
914#[derive(Clone, Debug)]
915pub struct UpdateQuestionResultParams {
916    pub tenant_id: String,
917    pub id: String,
918    pub update_question_result_body: models::UpdateQuestionResultBody
919}
920
921/// struct for passing parameters to the method [`update_subscription`]
922#[derive(Clone, Debug)]
923pub struct UpdateSubscriptionParams {
924    pub tenant_id: String,
925    pub id: String,
926    pub update_api_user_subscription_data: models::UpdateApiUserSubscriptionData,
927    pub user_id: Option<String>
928}
929
930/// struct for passing parameters to the method [`update_tenant`]
931#[derive(Clone, Debug)]
932pub struct UpdateTenantParams {
933    pub tenant_id: String,
934    pub id: String,
935    pub update_tenant_body: models::UpdateTenantBody
936}
937
938/// struct for passing parameters to the method [`update_tenant_package`]
939#[derive(Clone, Debug)]
940pub struct UpdateTenantPackageParams {
941    pub tenant_id: String,
942    pub id: String,
943    pub update_tenant_package_body: models::UpdateTenantPackageBody
944}
945
946/// struct for passing parameters to the method [`update_tenant_user`]
947#[derive(Clone, Debug)]
948pub struct UpdateTenantUserParams {
949    pub tenant_id: String,
950    pub id: String,
951    pub update_tenant_user_body: models::UpdateTenantUserBody,
952    pub update_comments: Option<String>
953}
954
955/// struct for passing parameters to the method [`update_user_badge`]
956#[derive(Clone, Debug)]
957pub struct UpdateUserBadgeParams {
958    pub tenant_id: String,
959    pub id: String,
960    pub update_user_badge_params: models::UpdateUserBadgeParams
961}
962
963
964/// struct for typed errors of method [`add_domain_config`]
965#[derive(Debug, Clone, Serialize, Deserialize)]
966#[serde(untagged)]
967pub enum AddDomainConfigError {
968    UnknownValue(serde_json::Value),
969}
970
971/// struct for typed errors of method [`add_hash_tag`]
972#[derive(Debug, Clone, Serialize, Deserialize)]
973#[serde(untagged)]
974pub enum AddHashTagError {
975    DefaultResponse(models::ApiError),
976    UnknownValue(serde_json::Value),
977}
978
979/// struct for typed errors of method [`add_hash_tags_bulk`]
980#[derive(Debug, Clone, Serialize, Deserialize)]
981#[serde(untagged)]
982pub enum AddHashTagsBulkError {
983    DefaultResponse(models::ApiError),
984    UnknownValue(serde_json::Value),
985}
986
987/// struct for typed errors of method [`add_page`]
988#[derive(Debug, Clone, Serialize, Deserialize)]
989#[serde(untagged)]
990pub enum AddPageError {
991    UnknownValue(serde_json::Value),
992}
993
994/// struct for typed errors of method [`add_sso_user`]
995#[derive(Debug, Clone, Serialize, Deserialize)]
996#[serde(untagged)]
997pub enum AddSsoUserError {
998    UnknownValue(serde_json::Value),
999}
1000
1001/// struct for typed errors of method [`aggregate`]
1002#[derive(Debug, Clone, Serialize, Deserialize)]
1003#[serde(untagged)]
1004pub enum AggregateError {
1005    UnknownValue(serde_json::Value),
1006}
1007
1008/// struct for typed errors of method [`aggregate_question_results`]
1009#[derive(Debug, Clone, Serialize, Deserialize)]
1010#[serde(untagged)]
1011pub enum AggregateQuestionResultsError {
1012    DefaultResponse(models::ApiError),
1013    UnknownValue(serde_json::Value),
1014}
1015
1016/// struct for typed errors of method [`block_user_from_comment`]
1017#[derive(Debug, Clone, Serialize, Deserialize)]
1018#[serde(untagged)]
1019pub enum BlockUserFromCommentError {
1020    DefaultResponse(models::ApiError),
1021    UnknownValue(serde_json::Value),
1022}
1023
1024/// struct for typed errors of method [`bulk_aggregate_question_results`]
1025#[derive(Debug, Clone, Serialize, Deserialize)]
1026#[serde(untagged)]
1027pub enum BulkAggregateQuestionResultsError {
1028    DefaultResponse(models::ApiError),
1029    UnknownValue(serde_json::Value),
1030}
1031
1032/// struct for typed errors of method [`change_ticket_state`]
1033#[derive(Debug, Clone, Serialize, Deserialize)]
1034#[serde(untagged)]
1035pub enum ChangeTicketStateError {
1036    DefaultResponse(models::ApiError),
1037    UnknownValue(serde_json::Value),
1038}
1039
1040/// struct for typed errors of method [`combine_comments_with_question_results`]
1041#[derive(Debug, Clone, Serialize, Deserialize)]
1042#[serde(untagged)]
1043pub enum CombineCommentsWithQuestionResultsError {
1044    DefaultResponse(models::ApiError),
1045    UnknownValue(serde_json::Value),
1046}
1047
1048/// struct for typed errors of method [`create_email_template`]
1049#[derive(Debug, Clone, Serialize, Deserialize)]
1050#[serde(untagged)]
1051pub enum CreateEmailTemplateError {
1052    DefaultResponse(models::ApiError),
1053    UnknownValue(serde_json::Value),
1054}
1055
1056/// struct for typed errors of method [`create_feed_post`]
1057#[derive(Debug, Clone, Serialize, Deserialize)]
1058#[serde(untagged)]
1059pub enum CreateFeedPostError {
1060    DefaultResponse(models::ApiError),
1061    UnknownValue(serde_json::Value),
1062}
1063
1064/// struct for typed errors of method [`create_moderator`]
1065#[derive(Debug, Clone, Serialize, Deserialize)]
1066#[serde(untagged)]
1067pub enum CreateModeratorError {
1068    DefaultResponse(models::ApiError),
1069    UnknownValue(serde_json::Value),
1070}
1071
1072/// struct for typed errors of method [`create_question_config`]
1073#[derive(Debug, Clone, Serialize, Deserialize)]
1074#[serde(untagged)]
1075pub enum CreateQuestionConfigError {
1076    DefaultResponse(models::ApiError),
1077    UnknownValue(serde_json::Value),
1078}
1079
1080/// struct for typed errors of method [`create_question_result`]
1081#[derive(Debug, Clone, Serialize, Deserialize)]
1082#[serde(untagged)]
1083pub enum CreateQuestionResultError {
1084    DefaultResponse(models::ApiError),
1085    UnknownValue(serde_json::Value),
1086}
1087
1088/// struct for typed errors of method [`create_subscription`]
1089#[derive(Debug, Clone, Serialize, Deserialize)]
1090#[serde(untagged)]
1091pub enum CreateSubscriptionError {
1092    UnknownValue(serde_json::Value),
1093}
1094
1095/// struct for typed errors of method [`create_tenant`]
1096#[derive(Debug, Clone, Serialize, Deserialize)]
1097#[serde(untagged)]
1098pub enum CreateTenantError {
1099    DefaultResponse(models::ApiError),
1100    UnknownValue(serde_json::Value),
1101}
1102
1103/// struct for typed errors of method [`create_tenant_package`]
1104#[derive(Debug, Clone, Serialize, Deserialize)]
1105#[serde(untagged)]
1106pub enum CreateTenantPackageError {
1107    DefaultResponse(models::ApiError),
1108    UnknownValue(serde_json::Value),
1109}
1110
1111/// struct for typed errors of method [`create_tenant_user`]
1112#[derive(Debug, Clone, Serialize, Deserialize)]
1113#[serde(untagged)]
1114pub enum CreateTenantUserError {
1115    DefaultResponse(models::ApiError),
1116    UnknownValue(serde_json::Value),
1117}
1118
1119/// struct for typed errors of method [`create_ticket`]
1120#[derive(Debug, Clone, Serialize, Deserialize)]
1121#[serde(untagged)]
1122pub enum CreateTicketError {
1123    DefaultResponse(models::ApiError),
1124    UnknownValue(serde_json::Value),
1125}
1126
1127/// struct for typed errors of method [`create_user_badge`]
1128#[derive(Debug, Clone, Serialize, Deserialize)]
1129#[serde(untagged)]
1130pub enum CreateUserBadgeError {
1131    DefaultResponse(models::ApiError),
1132    UnknownValue(serde_json::Value),
1133}
1134
1135/// struct for typed errors of method [`create_vote`]
1136#[derive(Debug, Clone, Serialize, Deserialize)]
1137#[serde(untagged)]
1138pub enum CreateVoteError {
1139    DefaultResponse(models::ApiError),
1140    UnknownValue(serde_json::Value),
1141}
1142
1143/// struct for typed errors of method [`delete_comment`]
1144#[derive(Debug, Clone, Serialize, Deserialize)]
1145#[serde(untagged)]
1146pub enum DeleteCommentError {
1147    DefaultResponse(models::ApiError),
1148    UnknownValue(serde_json::Value),
1149}
1150
1151/// struct for typed errors of method [`delete_domain_config`]
1152#[derive(Debug, Clone, Serialize, Deserialize)]
1153#[serde(untagged)]
1154pub enum DeleteDomainConfigError {
1155    UnknownValue(serde_json::Value),
1156}
1157
1158/// struct for typed errors of method [`delete_email_template`]
1159#[derive(Debug, Clone, Serialize, Deserialize)]
1160#[serde(untagged)]
1161pub enum DeleteEmailTemplateError {
1162    DefaultResponse(models::ApiError),
1163    UnknownValue(serde_json::Value),
1164}
1165
1166/// struct for typed errors of method [`delete_email_template_render_error`]
1167#[derive(Debug, Clone, Serialize, Deserialize)]
1168#[serde(untagged)]
1169pub enum DeleteEmailTemplateRenderErrorError {
1170    DefaultResponse(models::ApiError),
1171    UnknownValue(serde_json::Value),
1172}
1173
1174/// struct for typed errors of method [`delete_hash_tag`]
1175#[derive(Debug, Clone, Serialize, Deserialize)]
1176#[serde(untagged)]
1177pub enum DeleteHashTagError {
1178    DefaultResponse(models::ApiError),
1179    UnknownValue(serde_json::Value),
1180}
1181
1182/// struct for typed errors of method [`delete_moderator`]
1183#[derive(Debug, Clone, Serialize, Deserialize)]
1184#[serde(untagged)]
1185pub enum DeleteModeratorError {
1186    DefaultResponse(models::ApiError),
1187    UnknownValue(serde_json::Value),
1188}
1189
1190/// struct for typed errors of method [`delete_notification_count`]
1191#[derive(Debug, Clone, Serialize, Deserialize)]
1192#[serde(untagged)]
1193pub enum DeleteNotificationCountError {
1194    DefaultResponse(models::ApiError),
1195    UnknownValue(serde_json::Value),
1196}
1197
1198/// struct for typed errors of method [`delete_page`]
1199#[derive(Debug, Clone, Serialize, Deserialize)]
1200#[serde(untagged)]
1201pub enum DeletePageError {
1202    UnknownValue(serde_json::Value),
1203}
1204
1205/// struct for typed errors of method [`delete_pending_webhook_event`]
1206#[derive(Debug, Clone, Serialize, Deserialize)]
1207#[serde(untagged)]
1208pub enum DeletePendingWebhookEventError {
1209    DefaultResponse(models::ApiError),
1210    UnknownValue(serde_json::Value),
1211}
1212
1213/// struct for typed errors of method [`delete_question_config`]
1214#[derive(Debug, Clone, Serialize, Deserialize)]
1215#[serde(untagged)]
1216pub enum DeleteQuestionConfigError {
1217    DefaultResponse(models::ApiError),
1218    UnknownValue(serde_json::Value),
1219}
1220
1221/// struct for typed errors of method [`delete_question_result`]
1222#[derive(Debug, Clone, Serialize, Deserialize)]
1223#[serde(untagged)]
1224pub enum DeleteQuestionResultError {
1225    DefaultResponse(models::ApiError),
1226    UnknownValue(serde_json::Value),
1227}
1228
1229/// struct for typed errors of method [`delete_sso_user`]
1230#[derive(Debug, Clone, Serialize, Deserialize)]
1231#[serde(untagged)]
1232pub enum DeleteSsoUserError {
1233    UnknownValue(serde_json::Value),
1234}
1235
1236/// struct for typed errors of method [`delete_subscription`]
1237#[derive(Debug, Clone, Serialize, Deserialize)]
1238#[serde(untagged)]
1239pub enum DeleteSubscriptionError {
1240    UnknownValue(serde_json::Value),
1241}
1242
1243/// struct for typed errors of method [`delete_tenant`]
1244#[derive(Debug, Clone, Serialize, Deserialize)]
1245#[serde(untagged)]
1246pub enum DeleteTenantError {
1247    DefaultResponse(models::ApiError),
1248    UnknownValue(serde_json::Value),
1249}
1250
1251/// struct for typed errors of method [`delete_tenant_package`]
1252#[derive(Debug, Clone, Serialize, Deserialize)]
1253#[serde(untagged)]
1254pub enum DeleteTenantPackageError {
1255    DefaultResponse(models::ApiError),
1256    UnknownValue(serde_json::Value),
1257}
1258
1259/// struct for typed errors of method [`delete_tenant_user`]
1260#[derive(Debug, Clone, Serialize, Deserialize)]
1261#[serde(untagged)]
1262pub enum DeleteTenantUserError {
1263    DefaultResponse(models::ApiError),
1264    UnknownValue(serde_json::Value),
1265}
1266
1267/// struct for typed errors of method [`delete_user_badge`]
1268#[derive(Debug, Clone, Serialize, Deserialize)]
1269#[serde(untagged)]
1270pub enum DeleteUserBadgeError {
1271    DefaultResponse(models::ApiError),
1272    UnknownValue(serde_json::Value),
1273}
1274
1275/// struct for typed errors of method [`delete_vote`]
1276#[derive(Debug, Clone, Serialize, Deserialize)]
1277#[serde(untagged)]
1278pub enum DeleteVoteError {
1279    DefaultResponse(models::ApiError),
1280    UnknownValue(serde_json::Value),
1281}
1282
1283/// struct for typed errors of method [`flag_comment`]
1284#[derive(Debug, Clone, Serialize, Deserialize)]
1285#[serde(untagged)]
1286pub enum FlagCommentError {
1287    DefaultResponse(models::ApiError),
1288    UnknownValue(serde_json::Value),
1289}
1290
1291/// struct for typed errors of method [`get_audit_logs`]
1292#[derive(Debug, Clone, Serialize, Deserialize)]
1293#[serde(untagged)]
1294pub enum GetAuditLogsError {
1295    DefaultResponse(models::ApiError),
1296    UnknownValue(serde_json::Value),
1297}
1298
1299/// struct for typed errors of method [`get_cached_notification_count`]
1300#[derive(Debug, Clone, Serialize, Deserialize)]
1301#[serde(untagged)]
1302pub enum GetCachedNotificationCountError {
1303    DefaultResponse(models::ApiError),
1304    UnknownValue(serde_json::Value),
1305}
1306
1307/// struct for typed errors of method [`get_comment`]
1308#[derive(Debug, Clone, Serialize, Deserialize)]
1309#[serde(untagged)]
1310pub enum GetCommentError {
1311    DefaultResponse(models::ApiError),
1312    UnknownValue(serde_json::Value),
1313}
1314
1315/// struct for typed errors of method [`get_comments`]
1316#[derive(Debug, Clone, Serialize, Deserialize)]
1317#[serde(untagged)]
1318pub enum GetCommentsError {
1319    DefaultResponse(models::ApiError),
1320    UnknownValue(serde_json::Value),
1321}
1322
1323/// struct for typed errors of method [`get_domain_config`]
1324#[derive(Debug, Clone, Serialize, Deserialize)]
1325#[serde(untagged)]
1326pub enum GetDomainConfigError {
1327    UnknownValue(serde_json::Value),
1328}
1329
1330/// struct for typed errors of method [`get_domain_configs`]
1331#[derive(Debug, Clone, Serialize, Deserialize)]
1332#[serde(untagged)]
1333pub enum GetDomainConfigsError {
1334    UnknownValue(serde_json::Value),
1335}
1336
1337/// struct for typed errors of method [`get_email_template`]
1338#[derive(Debug, Clone, Serialize, Deserialize)]
1339#[serde(untagged)]
1340pub enum GetEmailTemplateError {
1341    DefaultResponse(models::ApiError),
1342    UnknownValue(serde_json::Value),
1343}
1344
1345/// struct for typed errors of method [`get_email_template_definitions`]
1346#[derive(Debug, Clone, Serialize, Deserialize)]
1347#[serde(untagged)]
1348pub enum GetEmailTemplateDefinitionsError {
1349    DefaultResponse(models::ApiError),
1350    UnknownValue(serde_json::Value),
1351}
1352
1353/// struct for typed errors of method [`get_email_template_render_errors`]
1354#[derive(Debug, Clone, Serialize, Deserialize)]
1355#[serde(untagged)]
1356pub enum GetEmailTemplateRenderErrorsError {
1357    DefaultResponse(models::ApiError),
1358    UnknownValue(serde_json::Value),
1359}
1360
1361/// struct for typed errors of method [`get_email_templates`]
1362#[derive(Debug, Clone, Serialize, Deserialize)]
1363#[serde(untagged)]
1364pub enum GetEmailTemplatesError {
1365    DefaultResponse(models::ApiError),
1366    UnknownValue(serde_json::Value),
1367}
1368
1369/// struct for typed errors of method [`get_feed_posts`]
1370#[derive(Debug, Clone, Serialize, Deserialize)]
1371#[serde(untagged)]
1372pub enum GetFeedPostsError {
1373    DefaultResponse(models::ApiError),
1374    UnknownValue(serde_json::Value),
1375}
1376
1377/// struct for typed errors of method [`get_hash_tags`]
1378#[derive(Debug, Clone, Serialize, Deserialize)]
1379#[serde(untagged)]
1380pub enum GetHashTagsError {
1381    DefaultResponse(models::ApiError),
1382    UnknownValue(serde_json::Value),
1383}
1384
1385/// struct for typed errors of method [`get_moderator`]
1386#[derive(Debug, Clone, Serialize, Deserialize)]
1387#[serde(untagged)]
1388pub enum GetModeratorError {
1389    DefaultResponse(models::ApiError),
1390    UnknownValue(serde_json::Value),
1391}
1392
1393/// struct for typed errors of method [`get_moderators`]
1394#[derive(Debug, Clone, Serialize, Deserialize)]
1395#[serde(untagged)]
1396pub enum GetModeratorsError {
1397    DefaultResponse(models::ApiError),
1398    UnknownValue(serde_json::Value),
1399}
1400
1401/// struct for typed errors of method [`get_notification_count`]
1402#[derive(Debug, Clone, Serialize, Deserialize)]
1403#[serde(untagged)]
1404pub enum GetNotificationCountError {
1405    DefaultResponse(models::ApiError),
1406    UnknownValue(serde_json::Value),
1407}
1408
1409/// struct for typed errors of method [`get_notifications`]
1410#[derive(Debug, Clone, Serialize, Deserialize)]
1411#[serde(untagged)]
1412pub enum GetNotificationsError {
1413    DefaultResponse(models::ApiError),
1414    UnknownValue(serde_json::Value),
1415}
1416
1417/// struct for typed errors of method [`get_page_by_urlid`]
1418#[derive(Debug, Clone, Serialize, Deserialize)]
1419#[serde(untagged)]
1420pub enum GetPageByUrlidError {
1421    UnknownValue(serde_json::Value),
1422}
1423
1424/// struct for typed errors of method [`get_pages`]
1425#[derive(Debug, Clone, Serialize, Deserialize)]
1426#[serde(untagged)]
1427pub enum GetPagesError {
1428    UnknownValue(serde_json::Value),
1429}
1430
1431/// struct for typed errors of method [`get_pending_webhook_event_count`]
1432#[derive(Debug, Clone, Serialize, Deserialize)]
1433#[serde(untagged)]
1434pub enum GetPendingWebhookEventCountError {
1435    DefaultResponse(models::ApiError),
1436    UnknownValue(serde_json::Value),
1437}
1438
1439/// struct for typed errors of method [`get_pending_webhook_events`]
1440#[derive(Debug, Clone, Serialize, Deserialize)]
1441#[serde(untagged)]
1442pub enum GetPendingWebhookEventsError {
1443    DefaultResponse(models::ApiError),
1444    UnknownValue(serde_json::Value),
1445}
1446
1447/// struct for typed errors of method [`get_question_config`]
1448#[derive(Debug, Clone, Serialize, Deserialize)]
1449#[serde(untagged)]
1450pub enum GetQuestionConfigError {
1451    DefaultResponse(models::ApiError),
1452    UnknownValue(serde_json::Value),
1453}
1454
1455/// struct for typed errors of method [`get_question_configs`]
1456#[derive(Debug, Clone, Serialize, Deserialize)]
1457#[serde(untagged)]
1458pub enum GetQuestionConfigsError {
1459    DefaultResponse(models::ApiError),
1460    UnknownValue(serde_json::Value),
1461}
1462
1463/// struct for typed errors of method [`get_question_result`]
1464#[derive(Debug, Clone, Serialize, Deserialize)]
1465#[serde(untagged)]
1466pub enum GetQuestionResultError {
1467    DefaultResponse(models::ApiError),
1468    UnknownValue(serde_json::Value),
1469}
1470
1471/// struct for typed errors of method [`get_question_results`]
1472#[derive(Debug, Clone, Serialize, Deserialize)]
1473#[serde(untagged)]
1474pub enum GetQuestionResultsError {
1475    DefaultResponse(models::ApiError),
1476    UnknownValue(serde_json::Value),
1477}
1478
1479/// struct for typed errors of method [`get_sso_user_by_email`]
1480#[derive(Debug, Clone, Serialize, Deserialize)]
1481#[serde(untagged)]
1482pub enum GetSsoUserByEmailError {
1483    UnknownValue(serde_json::Value),
1484}
1485
1486/// struct for typed errors of method [`get_sso_user_by_id`]
1487#[derive(Debug, Clone, Serialize, Deserialize)]
1488#[serde(untagged)]
1489pub enum GetSsoUserByIdError {
1490    UnknownValue(serde_json::Value),
1491}
1492
1493/// struct for typed errors of method [`get_sso_users`]
1494#[derive(Debug, Clone, Serialize, Deserialize)]
1495#[serde(untagged)]
1496pub enum GetSsoUsersError {
1497    UnknownValue(serde_json::Value),
1498}
1499
1500/// struct for typed errors of method [`get_subscriptions`]
1501#[derive(Debug, Clone, Serialize, Deserialize)]
1502#[serde(untagged)]
1503pub enum GetSubscriptionsError {
1504    UnknownValue(serde_json::Value),
1505}
1506
1507/// struct for typed errors of method [`get_tenant`]
1508#[derive(Debug, Clone, Serialize, Deserialize)]
1509#[serde(untagged)]
1510pub enum GetTenantError {
1511    DefaultResponse(models::ApiError),
1512    UnknownValue(serde_json::Value),
1513}
1514
1515/// struct for typed errors of method [`get_tenant_daily_usages`]
1516#[derive(Debug, Clone, Serialize, Deserialize)]
1517#[serde(untagged)]
1518pub enum GetTenantDailyUsagesError {
1519    DefaultResponse(models::ApiError),
1520    UnknownValue(serde_json::Value),
1521}
1522
1523/// struct for typed errors of method [`get_tenant_package`]
1524#[derive(Debug, Clone, Serialize, Deserialize)]
1525#[serde(untagged)]
1526pub enum GetTenantPackageError {
1527    DefaultResponse(models::ApiError),
1528    UnknownValue(serde_json::Value),
1529}
1530
1531/// struct for typed errors of method [`get_tenant_packages`]
1532#[derive(Debug, Clone, Serialize, Deserialize)]
1533#[serde(untagged)]
1534pub enum GetTenantPackagesError {
1535    DefaultResponse(models::ApiError),
1536    UnknownValue(serde_json::Value),
1537}
1538
1539/// struct for typed errors of method [`get_tenant_user`]
1540#[derive(Debug, Clone, Serialize, Deserialize)]
1541#[serde(untagged)]
1542pub enum GetTenantUserError {
1543    DefaultResponse(models::ApiError),
1544    UnknownValue(serde_json::Value),
1545}
1546
1547/// struct for typed errors of method [`get_tenant_users`]
1548#[derive(Debug, Clone, Serialize, Deserialize)]
1549#[serde(untagged)]
1550pub enum GetTenantUsersError {
1551    DefaultResponse(models::ApiError),
1552    UnknownValue(serde_json::Value),
1553}
1554
1555/// struct for typed errors of method [`get_tenants`]
1556#[derive(Debug, Clone, Serialize, Deserialize)]
1557#[serde(untagged)]
1558pub enum GetTenantsError {
1559    DefaultResponse(models::ApiError),
1560    UnknownValue(serde_json::Value),
1561}
1562
1563/// struct for typed errors of method [`get_ticket`]
1564#[derive(Debug, Clone, Serialize, Deserialize)]
1565#[serde(untagged)]
1566pub enum GetTicketError {
1567    DefaultResponse(models::ApiError),
1568    UnknownValue(serde_json::Value),
1569}
1570
1571/// struct for typed errors of method [`get_tickets`]
1572#[derive(Debug, Clone, Serialize, Deserialize)]
1573#[serde(untagged)]
1574pub enum GetTicketsError {
1575    DefaultResponse(models::ApiError),
1576    UnknownValue(serde_json::Value),
1577}
1578
1579/// struct for typed errors of method [`get_user`]
1580#[derive(Debug, Clone, Serialize, Deserialize)]
1581#[serde(untagged)]
1582pub enum GetUserError {
1583    DefaultResponse(models::ApiError),
1584    UnknownValue(serde_json::Value),
1585}
1586
1587/// struct for typed errors of method [`get_user_badge`]
1588#[derive(Debug, Clone, Serialize, Deserialize)]
1589#[serde(untagged)]
1590pub enum GetUserBadgeError {
1591    DefaultResponse(models::ApiError),
1592    UnknownValue(serde_json::Value),
1593}
1594
1595/// struct for typed errors of method [`get_user_badge_progress_by_id`]
1596#[derive(Debug, Clone, Serialize, Deserialize)]
1597#[serde(untagged)]
1598pub enum GetUserBadgeProgressByIdError {
1599    DefaultResponse(models::ApiError),
1600    UnknownValue(serde_json::Value),
1601}
1602
1603/// struct for typed errors of method [`get_user_badge_progress_by_user_id`]
1604#[derive(Debug, Clone, Serialize, Deserialize)]
1605#[serde(untagged)]
1606pub enum GetUserBadgeProgressByUserIdError {
1607    DefaultResponse(models::ApiError),
1608    UnknownValue(serde_json::Value),
1609}
1610
1611/// struct for typed errors of method [`get_user_badge_progress_list`]
1612#[derive(Debug, Clone, Serialize, Deserialize)]
1613#[serde(untagged)]
1614pub enum GetUserBadgeProgressListError {
1615    DefaultResponse(models::ApiError),
1616    UnknownValue(serde_json::Value),
1617}
1618
1619/// struct for typed errors of method [`get_user_badges`]
1620#[derive(Debug, Clone, Serialize, Deserialize)]
1621#[serde(untagged)]
1622pub enum GetUserBadgesError {
1623    DefaultResponse(models::ApiError),
1624    UnknownValue(serde_json::Value),
1625}
1626
1627/// struct for typed errors of method [`get_votes`]
1628#[derive(Debug, Clone, Serialize, Deserialize)]
1629#[serde(untagged)]
1630pub enum GetVotesError {
1631    DefaultResponse(models::ApiError),
1632    UnknownValue(serde_json::Value),
1633}
1634
1635/// struct for typed errors of method [`get_votes_for_user`]
1636#[derive(Debug, Clone, Serialize, Deserialize)]
1637#[serde(untagged)]
1638pub enum GetVotesForUserError {
1639    DefaultResponse(models::ApiError),
1640    UnknownValue(serde_json::Value),
1641}
1642
1643/// struct for typed errors of method [`patch_domain_config`]
1644#[derive(Debug, Clone, Serialize, Deserialize)]
1645#[serde(untagged)]
1646pub enum PatchDomainConfigError {
1647    UnknownValue(serde_json::Value),
1648}
1649
1650/// struct for typed errors of method [`patch_hash_tag`]
1651#[derive(Debug, Clone, Serialize, Deserialize)]
1652#[serde(untagged)]
1653pub enum PatchHashTagError {
1654    DefaultResponse(models::ApiError),
1655    UnknownValue(serde_json::Value),
1656}
1657
1658/// struct for typed errors of method [`patch_page`]
1659#[derive(Debug, Clone, Serialize, Deserialize)]
1660#[serde(untagged)]
1661pub enum PatchPageError {
1662    UnknownValue(serde_json::Value),
1663}
1664
1665/// struct for typed errors of method [`patch_sso_user`]
1666#[derive(Debug, Clone, Serialize, Deserialize)]
1667#[serde(untagged)]
1668pub enum PatchSsoUserError {
1669    UnknownValue(serde_json::Value),
1670}
1671
1672/// struct for typed errors of method [`put_domain_config`]
1673#[derive(Debug, Clone, Serialize, Deserialize)]
1674#[serde(untagged)]
1675pub enum PutDomainConfigError {
1676    UnknownValue(serde_json::Value),
1677}
1678
1679/// struct for typed errors of method [`put_sso_user`]
1680#[derive(Debug, Clone, Serialize, Deserialize)]
1681#[serde(untagged)]
1682pub enum PutSsoUserError {
1683    UnknownValue(serde_json::Value),
1684}
1685
1686/// struct for typed errors of method [`render_email_template`]
1687#[derive(Debug, Clone, Serialize, Deserialize)]
1688#[serde(untagged)]
1689pub enum RenderEmailTemplateError {
1690    DefaultResponse(models::ApiError),
1691    UnknownValue(serde_json::Value),
1692}
1693
1694/// struct for typed errors of method [`replace_tenant_package`]
1695#[derive(Debug, Clone, Serialize, Deserialize)]
1696#[serde(untagged)]
1697pub enum ReplaceTenantPackageError {
1698    DefaultResponse(models::ApiError),
1699    UnknownValue(serde_json::Value),
1700}
1701
1702/// struct for typed errors of method [`replace_tenant_user`]
1703#[derive(Debug, Clone, Serialize, Deserialize)]
1704#[serde(untagged)]
1705pub enum ReplaceTenantUserError {
1706    DefaultResponse(models::ApiError),
1707    UnknownValue(serde_json::Value),
1708}
1709
1710/// struct for typed errors of method [`save_comment`]
1711#[derive(Debug, Clone, Serialize, Deserialize)]
1712#[serde(untagged)]
1713pub enum SaveCommentError {
1714    DefaultResponse(models::ApiError),
1715    UnknownValue(serde_json::Value),
1716}
1717
1718/// struct for typed errors of method [`save_comments_bulk`]
1719#[derive(Debug, Clone, Serialize, Deserialize)]
1720#[serde(untagged)]
1721pub enum SaveCommentsBulkError {
1722    UnknownValue(serde_json::Value),
1723}
1724
1725/// struct for typed errors of method [`send_invite`]
1726#[derive(Debug, Clone, Serialize, Deserialize)]
1727#[serde(untagged)]
1728pub enum SendInviteError {
1729    DefaultResponse(models::ApiError),
1730    UnknownValue(serde_json::Value),
1731}
1732
1733/// struct for typed errors of method [`send_login_link`]
1734#[derive(Debug, Clone, Serialize, Deserialize)]
1735#[serde(untagged)]
1736pub enum SendLoginLinkError {
1737    DefaultResponse(models::ApiError),
1738    UnknownValue(serde_json::Value),
1739}
1740
1741/// struct for typed errors of method [`un_block_user_from_comment`]
1742#[derive(Debug, Clone, Serialize, Deserialize)]
1743#[serde(untagged)]
1744pub enum UnBlockUserFromCommentError {
1745    DefaultResponse(models::ApiError),
1746    UnknownValue(serde_json::Value),
1747}
1748
1749/// struct for typed errors of method [`un_flag_comment`]
1750#[derive(Debug, Clone, Serialize, Deserialize)]
1751#[serde(untagged)]
1752pub enum UnFlagCommentError {
1753    DefaultResponse(models::ApiError),
1754    UnknownValue(serde_json::Value),
1755}
1756
1757/// struct for typed errors of method [`update_comment`]
1758#[derive(Debug, Clone, Serialize, Deserialize)]
1759#[serde(untagged)]
1760pub enum UpdateCommentError {
1761    DefaultResponse(models::ApiError),
1762    UnknownValue(serde_json::Value),
1763}
1764
1765/// struct for typed errors of method [`update_email_template`]
1766#[derive(Debug, Clone, Serialize, Deserialize)]
1767#[serde(untagged)]
1768pub enum UpdateEmailTemplateError {
1769    DefaultResponse(models::ApiError),
1770    UnknownValue(serde_json::Value),
1771}
1772
1773/// struct for typed errors of method [`update_feed_post`]
1774#[derive(Debug, Clone, Serialize, Deserialize)]
1775#[serde(untagged)]
1776pub enum UpdateFeedPostError {
1777    DefaultResponse(models::ApiError),
1778    UnknownValue(serde_json::Value),
1779}
1780
1781/// struct for typed errors of method [`update_moderator`]
1782#[derive(Debug, Clone, Serialize, Deserialize)]
1783#[serde(untagged)]
1784pub enum UpdateModeratorError {
1785    DefaultResponse(models::ApiError),
1786    UnknownValue(serde_json::Value),
1787}
1788
1789/// struct for typed errors of method [`update_notification`]
1790#[derive(Debug, Clone, Serialize, Deserialize)]
1791#[serde(untagged)]
1792pub enum UpdateNotificationError {
1793    DefaultResponse(models::ApiError),
1794    UnknownValue(serde_json::Value),
1795}
1796
1797/// struct for typed errors of method [`update_question_config`]
1798#[derive(Debug, Clone, Serialize, Deserialize)]
1799#[serde(untagged)]
1800pub enum UpdateQuestionConfigError {
1801    DefaultResponse(models::ApiError),
1802    UnknownValue(serde_json::Value),
1803}
1804
1805/// struct for typed errors of method [`update_question_result`]
1806#[derive(Debug, Clone, Serialize, Deserialize)]
1807#[serde(untagged)]
1808pub enum UpdateQuestionResultError {
1809    DefaultResponse(models::ApiError),
1810    UnknownValue(serde_json::Value),
1811}
1812
1813/// struct for typed errors of method [`update_subscription`]
1814#[derive(Debug, Clone, Serialize, Deserialize)]
1815#[serde(untagged)]
1816pub enum UpdateSubscriptionError {
1817    UnknownValue(serde_json::Value),
1818}
1819
1820/// struct for typed errors of method [`update_tenant`]
1821#[derive(Debug, Clone, Serialize, Deserialize)]
1822#[serde(untagged)]
1823pub enum UpdateTenantError {
1824    DefaultResponse(models::ApiError),
1825    UnknownValue(serde_json::Value),
1826}
1827
1828/// struct for typed errors of method [`update_tenant_package`]
1829#[derive(Debug, Clone, Serialize, Deserialize)]
1830#[serde(untagged)]
1831pub enum UpdateTenantPackageError {
1832    DefaultResponse(models::ApiError),
1833    UnknownValue(serde_json::Value),
1834}
1835
1836/// struct for typed errors of method [`update_tenant_user`]
1837#[derive(Debug, Clone, Serialize, Deserialize)]
1838#[serde(untagged)]
1839pub enum UpdateTenantUserError {
1840    DefaultResponse(models::ApiError),
1841    UnknownValue(serde_json::Value),
1842}
1843
1844/// struct for typed errors of method [`update_user_badge`]
1845#[derive(Debug, Clone, Serialize, Deserialize)]
1846#[serde(untagged)]
1847pub enum UpdateUserBadgeError {
1848    DefaultResponse(models::ApiError),
1849    UnknownValue(serde_json::Value),
1850}
1851
1852
1853pub async fn add_domain_config(configuration: &configuration::Configuration, params: AddDomainConfigParams) -> Result<models::AddDomainConfigResponse, Error<AddDomainConfigError>> {
1854
1855    let uri_str = format!("{}/api/v1/domain-configs", configuration.base_path);
1856    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1857
1858    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
1859    if let Some(ref user_agent) = configuration.user_agent {
1860        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1861    }
1862    if let Some(ref apikey) = configuration.api_key {
1863        let key = apikey.key.clone();
1864        let value = match apikey.prefix {
1865            Some(ref prefix) => format!("{} {}", prefix, key),
1866            None => key,
1867        };
1868        req_builder = req_builder.header("x-api-key", value);
1869    };
1870    req_builder = req_builder.json(&params.add_domain_config_params);
1871
1872    let req = req_builder.build()?;
1873    let resp = configuration.client.execute(req).await?;
1874
1875    let status = resp.status();
1876    let content_type = resp
1877        .headers()
1878        .get("content-type")
1879        .and_then(|v| v.to_str().ok())
1880        .unwrap_or("application/octet-stream");
1881    let content_type = super::ContentType::from(content_type);
1882
1883    if !status.is_client_error() && !status.is_server_error() {
1884        let content = resp.text().await?;
1885        match content_type {
1886            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1887            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AddDomainConfigResponse`"))),
1888            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::AddDomainConfigResponse`")))),
1889        }
1890    } else {
1891        let content = resp.text().await?;
1892        let entity: Option<AddDomainConfigError> = serde_json::from_str(&content).ok();
1893        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1894    }
1895}
1896
1897pub async fn add_hash_tag(configuration: &configuration::Configuration, params: AddHashTagParams) -> Result<models::CreateHashTagResponse, Error<AddHashTagError>> {
1898
1899    let uri_str = format!("{}/api/v1/hash-tags", configuration.base_path);
1900    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1901
1902    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
1903    if let Some(ref user_agent) = configuration.user_agent {
1904        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1905    }
1906    if let Some(ref apikey) = configuration.api_key {
1907        let key = apikey.key.clone();
1908        let value = match apikey.prefix {
1909            Some(ref prefix) => format!("{} {}", prefix, key),
1910            None => key,
1911        };
1912        req_builder = req_builder.header("x-api-key", value);
1913    };
1914    req_builder = req_builder.json(&params.create_hash_tag_body);
1915
1916    let req = req_builder.build()?;
1917    let resp = configuration.client.execute(req).await?;
1918
1919    let status = resp.status();
1920    let content_type = resp
1921        .headers()
1922        .get("content-type")
1923        .and_then(|v| v.to_str().ok())
1924        .unwrap_or("application/octet-stream");
1925    let content_type = super::ContentType::from(content_type);
1926
1927    if !status.is_client_error() && !status.is_server_error() {
1928        let content = resp.text().await?;
1929        match content_type {
1930            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1931            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateHashTagResponse`"))),
1932            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::CreateHashTagResponse`")))),
1933        }
1934    } else {
1935        let content = resp.text().await?;
1936        let entity: Option<AddHashTagError> = serde_json::from_str(&content).ok();
1937        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1938    }
1939}
1940
1941pub async fn add_hash_tags_bulk(configuration: &configuration::Configuration, params: AddHashTagsBulkParams) -> Result<models::BulkCreateHashTagsResponse, Error<AddHashTagsBulkError>> {
1942
1943    let uri_str = format!("{}/api/v1/hash-tags/bulk", configuration.base_path);
1944    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1945
1946    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
1947    if let Some(ref user_agent) = configuration.user_agent {
1948        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1949    }
1950    if let Some(ref apikey) = configuration.api_key {
1951        let key = apikey.key.clone();
1952        let value = match apikey.prefix {
1953            Some(ref prefix) => format!("{} {}", prefix, key),
1954            None => key,
1955        };
1956        req_builder = req_builder.header("x-api-key", value);
1957    };
1958    req_builder = req_builder.json(&params.bulk_create_hash_tags_body);
1959
1960    let req = req_builder.build()?;
1961    let resp = configuration.client.execute(req).await?;
1962
1963    let status = resp.status();
1964    let content_type = resp
1965        .headers()
1966        .get("content-type")
1967        .and_then(|v| v.to_str().ok())
1968        .unwrap_or("application/octet-stream");
1969    let content_type = super::ContentType::from(content_type);
1970
1971    if !status.is_client_error() && !status.is_server_error() {
1972        let content = resp.text().await?;
1973        match content_type {
1974            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1975            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BulkCreateHashTagsResponse`"))),
1976            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::BulkCreateHashTagsResponse`")))),
1977        }
1978    } else {
1979        let content = resp.text().await?;
1980        let entity: Option<AddHashTagsBulkError> = serde_json::from_str(&content).ok();
1981        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1982    }
1983}
1984
1985pub async fn add_page(configuration: &configuration::Configuration, params: AddPageParams) -> Result<models::AddPageApiResponse, Error<AddPageError>> {
1986
1987    let uri_str = format!("{}/api/v1/pages", configuration.base_path);
1988    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1989
1990    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
1991    if let Some(ref user_agent) = configuration.user_agent {
1992        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1993    }
1994    if let Some(ref apikey) = configuration.api_key {
1995        let key = apikey.key.clone();
1996        let value = match apikey.prefix {
1997            Some(ref prefix) => format!("{} {}", prefix, key),
1998            None => key,
1999        };
2000        req_builder = req_builder.header("x-api-key", value);
2001    };
2002    req_builder = req_builder.json(&params.create_api_page_data);
2003
2004    let req = req_builder.build()?;
2005    let resp = configuration.client.execute(req).await?;
2006
2007    let status = resp.status();
2008    let content_type = resp
2009        .headers()
2010        .get("content-type")
2011        .and_then(|v| v.to_str().ok())
2012        .unwrap_or("application/octet-stream");
2013    let content_type = super::ContentType::from(content_type);
2014
2015    if !status.is_client_error() && !status.is_server_error() {
2016        let content = resp.text().await?;
2017        match content_type {
2018            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2019            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AddPageApiResponse`"))),
2020            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::AddPageApiResponse`")))),
2021        }
2022    } else {
2023        let content = resp.text().await?;
2024        let entity: Option<AddPageError> = serde_json::from_str(&content).ok();
2025        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2026    }
2027}
2028
2029pub async fn add_sso_user(configuration: &configuration::Configuration, params: AddSsoUserParams) -> Result<models::AddSsoUserApiResponse, Error<AddSsoUserError>> {
2030
2031    let uri_str = format!("{}/api/v1/sso-users", configuration.base_path);
2032    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2033
2034    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2035    if let Some(ref user_agent) = configuration.user_agent {
2036        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2037    }
2038    if let Some(ref apikey) = configuration.api_key {
2039        let key = apikey.key.clone();
2040        let value = match apikey.prefix {
2041            Some(ref prefix) => format!("{} {}", prefix, key),
2042            None => key,
2043        };
2044        req_builder = req_builder.header("x-api-key", value);
2045    };
2046    req_builder = req_builder.json(&params.create_apisso_user_data);
2047
2048    let req = req_builder.build()?;
2049    let resp = configuration.client.execute(req).await?;
2050
2051    let status = resp.status();
2052    let content_type = resp
2053        .headers()
2054        .get("content-type")
2055        .and_then(|v| v.to_str().ok())
2056        .unwrap_or("application/octet-stream");
2057    let content_type = super::ContentType::from(content_type);
2058
2059    if !status.is_client_error() && !status.is_server_error() {
2060        let content = resp.text().await?;
2061        match content_type {
2062            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2063            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AddSsoUserApiResponse`"))),
2064            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::AddSsoUserApiResponse`")))),
2065        }
2066    } else {
2067        let content = resp.text().await?;
2068        let entity: Option<AddSsoUserError> = serde_json::from_str(&content).ok();
2069        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2070    }
2071}
2072
2073/// Aggregates documents by grouping them (if groupBy is provided) and applying multiple operations. Different operations (e.g. sum, countDistinct, avg, etc.) are supported.
2074pub async fn aggregate(configuration: &configuration::Configuration, params: AggregateParams) -> Result<models::AggregateResponse, Error<AggregateError>> {
2075
2076    let uri_str = format!("{}/api/v1/aggregate", configuration.base_path);
2077    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2078
2079    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2080    if let Some(ref param_value) = params.parent_tenant_id {
2081        req_builder = req_builder.query(&[("parentTenantId", &param_value.to_string())]);
2082    }
2083    if let Some(ref param_value) = params.include_stats {
2084        req_builder = req_builder.query(&[("includeStats", &param_value.to_string())]);
2085    }
2086    if let Some(ref user_agent) = configuration.user_agent {
2087        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2088    }
2089    if let Some(ref apikey) = configuration.api_key {
2090        let key = apikey.key.clone();
2091        let value = match apikey.prefix {
2092            Some(ref prefix) => format!("{} {}", prefix, key),
2093            None => key,
2094        };
2095        req_builder = req_builder.header("x-api-key", value);
2096    };
2097    req_builder = req_builder.json(&params.aggregation_request);
2098
2099    let req = req_builder.build()?;
2100    let resp = configuration.client.execute(req).await?;
2101
2102    let status = resp.status();
2103    let content_type = resp
2104        .headers()
2105        .get("content-type")
2106        .and_then(|v| v.to_str().ok())
2107        .unwrap_or("application/octet-stream");
2108    let content_type = super::ContentType::from(content_type);
2109
2110    if !status.is_client_error() && !status.is_server_error() {
2111        let content = resp.text().await?;
2112        match content_type {
2113            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2114            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AggregateResponse`"))),
2115            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::AggregateResponse`")))),
2116        }
2117    } else {
2118        let content = resp.text().await?;
2119        let entity: Option<AggregateError> = serde_json::from_str(&content).ok();
2120        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2121    }
2122}
2123
2124pub async fn aggregate_question_results(configuration: &configuration::Configuration, params: AggregateQuestionResultsParams) -> Result<models::AggregateQuestionResultsResponse, Error<AggregateQuestionResultsError>> {
2125
2126    let uri_str = format!("{}/api/v1/question-results-aggregation", configuration.base_path);
2127    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2128
2129    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2130    if let Some(ref param_value) = params.question_id {
2131        req_builder = req_builder.query(&[("questionId", &param_value.to_string())]);
2132    }
2133    if let Some(ref param_value) = params.question_ids {
2134        req_builder = match "multi" {
2135            "multi" => req_builder.query(&param_value.into_iter().map(|p| ("questionIds".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
2136            _ => req_builder.query(&[("questionIds", &param_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
2137        };
2138    }
2139    if let Some(ref param_value) = params.url_id {
2140        req_builder = req_builder.query(&[("urlId", &param_value.to_string())]);
2141    }
2142    if let Some(ref param_value) = params.time_bucket {
2143        req_builder = req_builder.query(&[("timeBucket", &param_value.to_string())]);
2144    }
2145    if let Some(ref param_value) = params.start_date {
2146        req_builder = req_builder.query(&[("startDate", &param_value.to_string())]);
2147    }
2148    if let Some(ref param_value) = params.force_recalculate {
2149        req_builder = req_builder.query(&[("forceRecalculate", &param_value.to_string())]);
2150    }
2151    if let Some(ref user_agent) = configuration.user_agent {
2152        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2153    }
2154    if let Some(ref apikey) = configuration.api_key {
2155        let key = apikey.key.clone();
2156        let value = match apikey.prefix {
2157            Some(ref prefix) => format!("{} {}", prefix, key),
2158            None => key,
2159        };
2160        req_builder = req_builder.header("x-api-key", value);
2161    };
2162
2163    let req = req_builder.build()?;
2164    let resp = configuration.client.execute(req).await?;
2165
2166    let status = resp.status();
2167    let content_type = resp
2168        .headers()
2169        .get("content-type")
2170        .and_then(|v| v.to_str().ok())
2171        .unwrap_or("application/octet-stream");
2172    let content_type = super::ContentType::from(content_type);
2173
2174    if !status.is_client_error() && !status.is_server_error() {
2175        let content = resp.text().await?;
2176        match content_type {
2177            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2178            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AggregateQuestionResultsResponse`"))),
2179            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::AggregateQuestionResultsResponse`")))),
2180        }
2181    } else {
2182        let content = resp.text().await?;
2183        let entity: Option<AggregateQuestionResultsError> = serde_json::from_str(&content).ok();
2184        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2185    }
2186}
2187
2188pub async fn block_user_from_comment(configuration: &configuration::Configuration, params: BlockUserFromCommentParams) -> Result<models::BlockSuccess, Error<BlockUserFromCommentError>> {
2189
2190    let uri_str = format!("{}/api/v1/comments/{id}/block", configuration.base_path, id=crate::client::apis::urlencode(params.id));
2191    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2192
2193    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2194    if let Some(ref param_value) = params.user_id {
2195        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
2196    }
2197    if let Some(ref param_value) = params.anon_user_id {
2198        req_builder = req_builder.query(&[("anonUserId", &param_value.to_string())]);
2199    }
2200    if let Some(ref user_agent) = configuration.user_agent {
2201        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2202    }
2203    if let Some(ref apikey) = configuration.api_key {
2204        let key = apikey.key.clone();
2205        let value = match apikey.prefix {
2206            Some(ref prefix) => format!("{} {}", prefix, key),
2207            None => key,
2208        };
2209        req_builder = req_builder.header("x-api-key", value);
2210    };
2211    req_builder = req_builder.json(&params.block_from_comment_params);
2212
2213    let req = req_builder.build()?;
2214    let resp = configuration.client.execute(req).await?;
2215
2216    let status = resp.status();
2217    let content_type = resp
2218        .headers()
2219        .get("content-type")
2220        .and_then(|v| v.to_str().ok())
2221        .unwrap_or("application/octet-stream");
2222    let content_type = super::ContentType::from(content_type);
2223
2224    if !status.is_client_error() && !status.is_server_error() {
2225        let content = resp.text().await?;
2226        match content_type {
2227            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2228            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BlockSuccess`"))),
2229            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::BlockSuccess`")))),
2230        }
2231    } else {
2232        let content = resp.text().await?;
2233        let entity: Option<BlockUserFromCommentError> = serde_json::from_str(&content).ok();
2234        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2235    }
2236}
2237
2238pub async fn bulk_aggregate_question_results(configuration: &configuration::Configuration, params: BulkAggregateQuestionResultsParams) -> Result<models::BulkAggregateQuestionResultsResponse, Error<BulkAggregateQuestionResultsError>> {
2239
2240    let uri_str = format!("{}/api/v1/question-results-aggregation/bulk", configuration.base_path);
2241    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2242
2243    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2244    if let Some(ref param_value) = params.force_recalculate {
2245        req_builder = req_builder.query(&[("forceRecalculate", &param_value.to_string())]);
2246    }
2247    if let Some(ref user_agent) = configuration.user_agent {
2248        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2249    }
2250    if let Some(ref apikey) = configuration.api_key {
2251        let key = apikey.key.clone();
2252        let value = match apikey.prefix {
2253            Some(ref prefix) => format!("{} {}", prefix, key),
2254            None => key,
2255        };
2256        req_builder = req_builder.header("x-api-key", value);
2257    };
2258    req_builder = req_builder.json(&params.bulk_aggregate_question_results_request);
2259
2260    let req = req_builder.build()?;
2261    let resp = configuration.client.execute(req).await?;
2262
2263    let status = resp.status();
2264    let content_type = resp
2265        .headers()
2266        .get("content-type")
2267        .and_then(|v| v.to_str().ok())
2268        .unwrap_or("application/octet-stream");
2269    let content_type = super::ContentType::from(content_type);
2270
2271    if !status.is_client_error() && !status.is_server_error() {
2272        let content = resp.text().await?;
2273        match content_type {
2274            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2275            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BulkAggregateQuestionResultsResponse`"))),
2276            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::BulkAggregateQuestionResultsResponse`")))),
2277        }
2278    } else {
2279        let content = resp.text().await?;
2280        let entity: Option<BulkAggregateQuestionResultsError> = serde_json::from_str(&content).ok();
2281        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2282    }
2283}
2284
2285pub async fn change_ticket_state(configuration: &configuration::Configuration, params: ChangeTicketStateParams) -> Result<models::ChangeTicketStateResponse, Error<ChangeTicketStateError>> {
2286
2287    let uri_str = format!("{}/api/v1/tickets/{id}/state", configuration.base_path, id=crate::client::apis::urlencode(params.id));
2288    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2289
2290    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2291    req_builder = req_builder.query(&[("userId", &params.user_id.to_string())]);
2292    if let Some(ref user_agent) = configuration.user_agent {
2293        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2294    }
2295    if let Some(ref apikey) = configuration.api_key {
2296        let key = apikey.key.clone();
2297        let value = match apikey.prefix {
2298            Some(ref prefix) => format!("{} {}", prefix, key),
2299            None => key,
2300        };
2301        req_builder = req_builder.header("x-api-key", value);
2302    };
2303    req_builder = req_builder.json(&params.change_ticket_state_body);
2304
2305    let req = req_builder.build()?;
2306    let resp = configuration.client.execute(req).await?;
2307
2308    let status = resp.status();
2309    let content_type = resp
2310        .headers()
2311        .get("content-type")
2312        .and_then(|v| v.to_str().ok())
2313        .unwrap_or("application/octet-stream");
2314    let content_type = super::ContentType::from(content_type);
2315
2316    if !status.is_client_error() && !status.is_server_error() {
2317        let content = resp.text().await?;
2318        match content_type {
2319            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2320            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ChangeTicketStateResponse`"))),
2321            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::ChangeTicketStateResponse`")))),
2322        }
2323    } else {
2324        let content = resp.text().await?;
2325        let entity: Option<ChangeTicketStateError> = serde_json::from_str(&content).ok();
2326        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2327    }
2328}
2329
2330pub async fn combine_comments_with_question_results(configuration: &configuration::Configuration, params: CombineCommentsWithQuestionResultsParams) -> Result<models::CombineQuestionResultsWithCommentsResponse, Error<CombineCommentsWithQuestionResultsError>> {
2331
2332    let uri_str = format!("{}/api/v1/question-results-aggregation/combine/comments", configuration.base_path);
2333    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2334
2335    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2336    if let Some(ref param_value) = params.question_id {
2337        req_builder = req_builder.query(&[("questionId", &param_value.to_string())]);
2338    }
2339    if let Some(ref param_value) = params.question_ids {
2340        req_builder = match "multi" {
2341            "multi" => req_builder.query(&param_value.into_iter().map(|p| ("questionIds".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
2342            _ => req_builder.query(&[("questionIds", &param_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
2343        };
2344    }
2345    if let Some(ref param_value) = params.url_id {
2346        req_builder = req_builder.query(&[("urlId", &param_value.to_string())]);
2347    }
2348    if let Some(ref param_value) = params.start_date {
2349        req_builder = req_builder.query(&[("startDate", &param_value.to_string())]);
2350    }
2351    if let Some(ref param_value) = params.force_recalculate {
2352        req_builder = req_builder.query(&[("forceRecalculate", &param_value.to_string())]);
2353    }
2354    if let Some(ref param_value) = params.min_value {
2355        req_builder = req_builder.query(&[("minValue", &param_value.to_string())]);
2356    }
2357    if let Some(ref param_value) = params.max_value {
2358        req_builder = req_builder.query(&[("maxValue", &param_value.to_string())]);
2359    }
2360    if let Some(ref param_value) = params.limit {
2361        req_builder = req_builder.query(&[("limit", &param_value.to_string())]);
2362    }
2363    if let Some(ref user_agent) = configuration.user_agent {
2364        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2365    }
2366    if let Some(ref apikey) = configuration.api_key {
2367        let key = apikey.key.clone();
2368        let value = match apikey.prefix {
2369            Some(ref prefix) => format!("{} {}", prefix, key),
2370            None => key,
2371        };
2372        req_builder = req_builder.header("x-api-key", value);
2373    };
2374
2375    let req = req_builder.build()?;
2376    let resp = configuration.client.execute(req).await?;
2377
2378    let status = resp.status();
2379    let content_type = resp
2380        .headers()
2381        .get("content-type")
2382        .and_then(|v| v.to_str().ok())
2383        .unwrap_or("application/octet-stream");
2384    let content_type = super::ContentType::from(content_type);
2385
2386    if !status.is_client_error() && !status.is_server_error() {
2387        let content = resp.text().await?;
2388        match content_type {
2389            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2390            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CombineQuestionResultsWithCommentsResponse`"))),
2391            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::CombineQuestionResultsWithCommentsResponse`")))),
2392        }
2393    } else {
2394        let content = resp.text().await?;
2395        let entity: Option<CombineCommentsWithQuestionResultsError> = serde_json::from_str(&content).ok();
2396        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2397    }
2398}
2399
2400pub async fn create_email_template(configuration: &configuration::Configuration, params: CreateEmailTemplateParams) -> Result<models::CreateEmailTemplateResponse, Error<CreateEmailTemplateError>> {
2401
2402    let uri_str = format!("{}/api/v1/email-templates", configuration.base_path);
2403    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2404
2405    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2406    if let Some(ref user_agent) = configuration.user_agent {
2407        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2408    }
2409    if let Some(ref apikey) = configuration.api_key {
2410        let key = apikey.key.clone();
2411        let value = match apikey.prefix {
2412            Some(ref prefix) => format!("{} {}", prefix, key),
2413            None => key,
2414        };
2415        req_builder = req_builder.header("x-api-key", value);
2416    };
2417    req_builder = req_builder.json(&params.create_email_template_body);
2418
2419    let req = req_builder.build()?;
2420    let resp = configuration.client.execute(req).await?;
2421
2422    let status = resp.status();
2423    let content_type = resp
2424        .headers()
2425        .get("content-type")
2426        .and_then(|v| v.to_str().ok())
2427        .unwrap_or("application/octet-stream");
2428    let content_type = super::ContentType::from(content_type);
2429
2430    if !status.is_client_error() && !status.is_server_error() {
2431        let content = resp.text().await?;
2432        match content_type {
2433            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2434            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateEmailTemplateResponse`"))),
2435            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::CreateEmailTemplateResponse`")))),
2436        }
2437    } else {
2438        let content = resp.text().await?;
2439        let entity: Option<CreateEmailTemplateError> = serde_json::from_str(&content).ok();
2440        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2441    }
2442}
2443
2444pub async fn create_feed_post(configuration: &configuration::Configuration, params: CreateFeedPostParams) -> Result<models::CreateFeedPostsResponse, Error<CreateFeedPostError>> {
2445
2446    let uri_str = format!("{}/api/v1/feed-posts", configuration.base_path);
2447    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2448
2449    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2450    if let Some(ref param_value) = params.broadcast_id {
2451        req_builder = req_builder.query(&[("broadcastId", &param_value.to_string())]);
2452    }
2453    if let Some(ref param_value) = params.is_live {
2454        req_builder = req_builder.query(&[("isLive", &param_value.to_string())]);
2455    }
2456    if let Some(ref param_value) = params.do_spam_check {
2457        req_builder = req_builder.query(&[("doSpamCheck", &param_value.to_string())]);
2458    }
2459    if let Some(ref param_value) = params.skip_dup_check {
2460        req_builder = req_builder.query(&[("skipDupCheck", &param_value.to_string())]);
2461    }
2462    if let Some(ref user_agent) = configuration.user_agent {
2463        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2464    }
2465    if let Some(ref apikey) = configuration.api_key {
2466        let key = apikey.key.clone();
2467        let value = match apikey.prefix {
2468            Some(ref prefix) => format!("{} {}", prefix, key),
2469            None => key,
2470        };
2471        req_builder = req_builder.header("x-api-key", value);
2472    };
2473    req_builder = req_builder.json(&params.create_feed_post_params);
2474
2475    let req = req_builder.build()?;
2476    let resp = configuration.client.execute(req).await?;
2477
2478    let status = resp.status();
2479    let content_type = resp
2480        .headers()
2481        .get("content-type")
2482        .and_then(|v| v.to_str().ok())
2483        .unwrap_or("application/octet-stream");
2484    let content_type = super::ContentType::from(content_type);
2485
2486    if !status.is_client_error() && !status.is_server_error() {
2487        let content = resp.text().await?;
2488        match content_type {
2489            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2490            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateFeedPostsResponse`"))),
2491            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::CreateFeedPostsResponse`")))),
2492        }
2493    } else {
2494        let content = resp.text().await?;
2495        let entity: Option<CreateFeedPostError> = serde_json::from_str(&content).ok();
2496        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2497    }
2498}
2499
2500pub async fn create_moderator(configuration: &configuration::Configuration, params: CreateModeratorParams) -> Result<models::CreateModeratorResponse, Error<CreateModeratorError>> {
2501
2502    let uri_str = format!("{}/api/v1/moderators", configuration.base_path);
2503    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2504
2505    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2506    if let Some(ref user_agent) = configuration.user_agent {
2507        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2508    }
2509    if let Some(ref apikey) = configuration.api_key {
2510        let key = apikey.key.clone();
2511        let value = match apikey.prefix {
2512            Some(ref prefix) => format!("{} {}", prefix, key),
2513            None => key,
2514        };
2515        req_builder = req_builder.header("x-api-key", value);
2516    };
2517    req_builder = req_builder.json(&params.create_moderator_body);
2518
2519    let req = req_builder.build()?;
2520    let resp = configuration.client.execute(req).await?;
2521
2522    let status = resp.status();
2523    let content_type = resp
2524        .headers()
2525        .get("content-type")
2526        .and_then(|v| v.to_str().ok())
2527        .unwrap_or("application/octet-stream");
2528    let content_type = super::ContentType::from(content_type);
2529
2530    if !status.is_client_error() && !status.is_server_error() {
2531        let content = resp.text().await?;
2532        match content_type {
2533            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2534            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateModeratorResponse`"))),
2535            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::CreateModeratorResponse`")))),
2536        }
2537    } else {
2538        let content = resp.text().await?;
2539        let entity: Option<CreateModeratorError> = serde_json::from_str(&content).ok();
2540        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2541    }
2542}
2543
2544pub async fn create_question_config(configuration: &configuration::Configuration, params: CreateQuestionConfigParams) -> Result<models::CreateQuestionConfigResponse, Error<CreateQuestionConfigError>> {
2545
2546    let uri_str = format!("{}/api/v1/question-configs", configuration.base_path);
2547    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2548
2549    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2550    if let Some(ref user_agent) = configuration.user_agent {
2551        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2552    }
2553    if let Some(ref apikey) = configuration.api_key {
2554        let key = apikey.key.clone();
2555        let value = match apikey.prefix {
2556            Some(ref prefix) => format!("{} {}", prefix, key),
2557            None => key,
2558        };
2559        req_builder = req_builder.header("x-api-key", value);
2560    };
2561    req_builder = req_builder.json(&params.create_question_config_body);
2562
2563    let req = req_builder.build()?;
2564    let resp = configuration.client.execute(req).await?;
2565
2566    let status = resp.status();
2567    let content_type = resp
2568        .headers()
2569        .get("content-type")
2570        .and_then(|v| v.to_str().ok())
2571        .unwrap_or("application/octet-stream");
2572    let content_type = super::ContentType::from(content_type);
2573
2574    if !status.is_client_error() && !status.is_server_error() {
2575        let content = resp.text().await?;
2576        match content_type {
2577            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2578            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateQuestionConfigResponse`"))),
2579            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::CreateQuestionConfigResponse`")))),
2580        }
2581    } else {
2582        let content = resp.text().await?;
2583        let entity: Option<CreateQuestionConfigError> = serde_json::from_str(&content).ok();
2584        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2585    }
2586}
2587
2588pub async fn create_question_result(configuration: &configuration::Configuration, params: CreateQuestionResultParams) -> Result<models::CreateQuestionResultResponse, Error<CreateQuestionResultError>> {
2589
2590    let uri_str = format!("{}/api/v1/question-results", configuration.base_path);
2591    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2592
2593    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2594    if let Some(ref user_agent) = configuration.user_agent {
2595        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2596    }
2597    if let Some(ref apikey) = configuration.api_key {
2598        let key = apikey.key.clone();
2599        let value = match apikey.prefix {
2600            Some(ref prefix) => format!("{} {}", prefix, key),
2601            None => key,
2602        };
2603        req_builder = req_builder.header("x-api-key", value);
2604    };
2605    req_builder = req_builder.json(&params.create_question_result_body);
2606
2607    let req = req_builder.build()?;
2608    let resp = configuration.client.execute(req).await?;
2609
2610    let status = resp.status();
2611    let content_type = resp
2612        .headers()
2613        .get("content-type")
2614        .and_then(|v| v.to_str().ok())
2615        .unwrap_or("application/octet-stream");
2616    let content_type = super::ContentType::from(content_type);
2617
2618    if !status.is_client_error() && !status.is_server_error() {
2619        let content = resp.text().await?;
2620        match content_type {
2621            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2622            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateQuestionResultResponse`"))),
2623            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::CreateQuestionResultResponse`")))),
2624        }
2625    } else {
2626        let content = resp.text().await?;
2627        let entity: Option<CreateQuestionResultError> = serde_json::from_str(&content).ok();
2628        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2629    }
2630}
2631
2632pub async fn create_subscription(configuration: &configuration::Configuration, params: CreateSubscriptionParams) -> Result<models::CreateSubscriptionApiResponse, Error<CreateSubscriptionError>> {
2633
2634    let uri_str = format!("{}/api/v1/subscriptions", configuration.base_path);
2635    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2636
2637    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2638    if let Some(ref user_agent) = configuration.user_agent {
2639        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2640    }
2641    if let Some(ref apikey) = configuration.api_key {
2642        let key = apikey.key.clone();
2643        let value = match apikey.prefix {
2644            Some(ref prefix) => format!("{} {}", prefix, key),
2645            None => key,
2646        };
2647        req_builder = req_builder.header("x-api-key", value);
2648    };
2649    req_builder = req_builder.json(&params.create_api_user_subscription_data);
2650
2651    let req = req_builder.build()?;
2652    let resp = configuration.client.execute(req).await?;
2653
2654    let status = resp.status();
2655    let content_type = resp
2656        .headers()
2657        .get("content-type")
2658        .and_then(|v| v.to_str().ok())
2659        .unwrap_or("application/octet-stream");
2660    let content_type = super::ContentType::from(content_type);
2661
2662    if !status.is_client_error() && !status.is_server_error() {
2663        let content = resp.text().await?;
2664        match content_type {
2665            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2666            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateSubscriptionApiResponse`"))),
2667            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::CreateSubscriptionApiResponse`")))),
2668        }
2669    } else {
2670        let content = resp.text().await?;
2671        let entity: Option<CreateSubscriptionError> = serde_json::from_str(&content).ok();
2672        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2673    }
2674}
2675
2676pub async fn create_tenant(configuration: &configuration::Configuration, params: CreateTenantParams) -> Result<models::CreateTenantResponse, Error<CreateTenantError>> {
2677
2678    let uri_str = format!("{}/api/v1/tenants", configuration.base_path);
2679    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2680
2681    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2682    if let Some(ref user_agent) = configuration.user_agent {
2683        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2684    }
2685    if let Some(ref apikey) = configuration.api_key {
2686        let key = apikey.key.clone();
2687        let value = match apikey.prefix {
2688            Some(ref prefix) => format!("{} {}", prefix, key),
2689            None => key,
2690        };
2691        req_builder = req_builder.header("x-api-key", value);
2692    };
2693    req_builder = req_builder.json(&params.create_tenant_body);
2694
2695    let req = req_builder.build()?;
2696    let resp = configuration.client.execute(req).await?;
2697
2698    let status = resp.status();
2699    let content_type = resp
2700        .headers()
2701        .get("content-type")
2702        .and_then(|v| v.to_str().ok())
2703        .unwrap_or("application/octet-stream");
2704    let content_type = super::ContentType::from(content_type);
2705
2706    if !status.is_client_error() && !status.is_server_error() {
2707        let content = resp.text().await?;
2708        match content_type {
2709            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2710            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateTenantResponse`"))),
2711            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::CreateTenantResponse`")))),
2712        }
2713    } else {
2714        let content = resp.text().await?;
2715        let entity: Option<CreateTenantError> = serde_json::from_str(&content).ok();
2716        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2717    }
2718}
2719
2720pub async fn create_tenant_package(configuration: &configuration::Configuration, params: CreateTenantPackageParams) -> Result<models::CreateTenantPackageResponse, Error<CreateTenantPackageError>> {
2721
2722    let uri_str = format!("{}/api/v1/tenant-packages", configuration.base_path);
2723    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2724
2725    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2726    if let Some(ref user_agent) = configuration.user_agent {
2727        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2728    }
2729    if let Some(ref apikey) = configuration.api_key {
2730        let key = apikey.key.clone();
2731        let value = match apikey.prefix {
2732            Some(ref prefix) => format!("{} {}", prefix, key),
2733            None => key,
2734        };
2735        req_builder = req_builder.header("x-api-key", value);
2736    };
2737    req_builder = req_builder.json(&params.create_tenant_package_body);
2738
2739    let req = req_builder.build()?;
2740    let resp = configuration.client.execute(req).await?;
2741
2742    let status = resp.status();
2743    let content_type = resp
2744        .headers()
2745        .get("content-type")
2746        .and_then(|v| v.to_str().ok())
2747        .unwrap_or("application/octet-stream");
2748    let content_type = super::ContentType::from(content_type);
2749
2750    if !status.is_client_error() && !status.is_server_error() {
2751        let content = resp.text().await?;
2752        match content_type {
2753            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2754            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateTenantPackageResponse`"))),
2755            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::CreateTenantPackageResponse`")))),
2756        }
2757    } else {
2758        let content = resp.text().await?;
2759        let entity: Option<CreateTenantPackageError> = serde_json::from_str(&content).ok();
2760        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2761    }
2762}
2763
2764pub async fn create_tenant_user(configuration: &configuration::Configuration, params: CreateTenantUserParams) -> Result<models::CreateTenantUserResponse, Error<CreateTenantUserError>> {
2765
2766    let uri_str = format!("{}/api/v1/tenant-users", configuration.base_path);
2767    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2768
2769    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2770    if let Some(ref user_agent) = configuration.user_agent {
2771        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2772    }
2773    if let Some(ref apikey) = configuration.api_key {
2774        let key = apikey.key.clone();
2775        let value = match apikey.prefix {
2776            Some(ref prefix) => format!("{} {}", prefix, key),
2777            None => key,
2778        };
2779        req_builder = req_builder.header("x-api-key", value);
2780    };
2781    req_builder = req_builder.json(&params.create_tenant_user_body);
2782
2783    let req = req_builder.build()?;
2784    let resp = configuration.client.execute(req).await?;
2785
2786    let status = resp.status();
2787    let content_type = resp
2788        .headers()
2789        .get("content-type")
2790        .and_then(|v| v.to_str().ok())
2791        .unwrap_or("application/octet-stream");
2792    let content_type = super::ContentType::from(content_type);
2793
2794    if !status.is_client_error() && !status.is_server_error() {
2795        let content = resp.text().await?;
2796        match content_type {
2797            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2798            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateTenantUserResponse`"))),
2799            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::CreateTenantUserResponse`")))),
2800        }
2801    } else {
2802        let content = resp.text().await?;
2803        let entity: Option<CreateTenantUserError> = serde_json::from_str(&content).ok();
2804        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2805    }
2806}
2807
2808pub async fn create_ticket(configuration: &configuration::Configuration, params: CreateTicketParams) -> Result<models::CreateTicketResponse, Error<CreateTicketError>> {
2809
2810    let uri_str = format!("{}/api/v1/tickets", configuration.base_path);
2811    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2812
2813    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2814    req_builder = req_builder.query(&[("userId", &params.user_id.to_string())]);
2815    if let Some(ref user_agent) = configuration.user_agent {
2816        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2817    }
2818    if let Some(ref apikey) = configuration.api_key {
2819        let key = apikey.key.clone();
2820        let value = match apikey.prefix {
2821            Some(ref prefix) => format!("{} {}", prefix, key),
2822            None => key,
2823        };
2824        req_builder = req_builder.header("x-api-key", value);
2825    };
2826    req_builder = req_builder.json(&params.create_ticket_body);
2827
2828    let req = req_builder.build()?;
2829    let resp = configuration.client.execute(req).await?;
2830
2831    let status = resp.status();
2832    let content_type = resp
2833        .headers()
2834        .get("content-type")
2835        .and_then(|v| v.to_str().ok())
2836        .unwrap_or("application/octet-stream");
2837    let content_type = super::ContentType::from(content_type);
2838
2839    if !status.is_client_error() && !status.is_server_error() {
2840        let content = resp.text().await?;
2841        match content_type {
2842            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2843            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateTicketResponse`"))),
2844            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::CreateTicketResponse`")))),
2845        }
2846    } else {
2847        let content = resp.text().await?;
2848        let entity: Option<CreateTicketError> = serde_json::from_str(&content).ok();
2849        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2850    }
2851}
2852
2853pub async fn create_user_badge(configuration: &configuration::Configuration, params: CreateUserBadgeParams) -> Result<models::ApiCreateUserBadgeResponse, Error<CreateUserBadgeError>> {
2854
2855    let uri_str = format!("{}/api/v1/user-badges", configuration.base_path);
2856    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2857
2858    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2859    if let Some(ref user_agent) = configuration.user_agent {
2860        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2861    }
2862    if let Some(ref apikey) = configuration.api_key {
2863        let key = apikey.key.clone();
2864        let value = match apikey.prefix {
2865            Some(ref prefix) => format!("{} {}", prefix, key),
2866            None => key,
2867        };
2868        req_builder = req_builder.header("x-api-key", value);
2869    };
2870    req_builder = req_builder.json(&params.create_user_badge_params);
2871
2872    let req = req_builder.build()?;
2873    let resp = configuration.client.execute(req).await?;
2874
2875    let status = resp.status();
2876    let content_type = resp
2877        .headers()
2878        .get("content-type")
2879        .and_then(|v| v.to_str().ok())
2880        .unwrap_or("application/octet-stream");
2881    let content_type = super::ContentType::from(content_type);
2882
2883    if !status.is_client_error() && !status.is_server_error() {
2884        let content = resp.text().await?;
2885        match content_type {
2886            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2887            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiCreateUserBadgeResponse`"))),
2888            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::ApiCreateUserBadgeResponse`")))),
2889        }
2890    } else {
2891        let content = resp.text().await?;
2892        let entity: Option<CreateUserBadgeError> = serde_json::from_str(&content).ok();
2893        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2894    }
2895}
2896
2897pub async fn create_vote(configuration: &configuration::Configuration, params: CreateVoteParams) -> Result<models::VoteResponse, Error<CreateVoteError>> {
2898
2899    let uri_str = format!("{}/api/v1/votes", configuration.base_path);
2900    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2901
2902    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2903    req_builder = req_builder.query(&[("commentId", &params.comment_id.to_string())]);
2904    req_builder = req_builder.query(&[("direction", &params.direction.to_string())]);
2905    if let Some(ref param_value) = params.user_id {
2906        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
2907    }
2908    if let Some(ref param_value) = params.anon_user_id {
2909        req_builder = req_builder.query(&[("anonUserId", &param_value.to_string())]);
2910    }
2911    if let Some(ref user_agent) = configuration.user_agent {
2912        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2913    }
2914    if let Some(ref apikey) = configuration.api_key {
2915        let key = apikey.key.clone();
2916        let value = match apikey.prefix {
2917            Some(ref prefix) => format!("{} {}", prefix, key),
2918            None => key,
2919        };
2920        req_builder = req_builder.header("x-api-key", value);
2921    };
2922
2923    let req = req_builder.build()?;
2924    let resp = configuration.client.execute(req).await?;
2925
2926    let status = resp.status();
2927    let content_type = resp
2928        .headers()
2929        .get("content-type")
2930        .and_then(|v| v.to_str().ok())
2931        .unwrap_or("application/octet-stream");
2932    let content_type = super::ContentType::from(content_type);
2933
2934    if !status.is_client_error() && !status.is_server_error() {
2935        let content = resp.text().await?;
2936        match content_type {
2937            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2938            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VoteResponse`"))),
2939            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::VoteResponse`")))),
2940        }
2941    } else {
2942        let content = resp.text().await?;
2943        let entity: Option<CreateVoteError> = serde_json::from_str(&content).ok();
2944        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2945    }
2946}
2947
2948pub async fn delete_comment(configuration: &configuration::Configuration, params: DeleteCommentParams) -> Result<models::DeleteCommentResult, Error<DeleteCommentError>> {
2949
2950    let uri_str = format!("{}/api/v1/comments/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
2951    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2952
2953    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
2954    if let Some(ref param_value) = params.context_user_id {
2955        req_builder = req_builder.query(&[("contextUserId", &param_value.to_string())]);
2956    }
2957    if let Some(ref param_value) = params.is_live {
2958        req_builder = req_builder.query(&[("isLive", &param_value.to_string())]);
2959    }
2960    if let Some(ref user_agent) = configuration.user_agent {
2961        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2962    }
2963    if let Some(ref apikey) = configuration.api_key {
2964        let key = apikey.key.clone();
2965        let value = match apikey.prefix {
2966            Some(ref prefix) => format!("{} {}", prefix, key),
2967            None => key,
2968        };
2969        req_builder = req_builder.header("x-api-key", value);
2970    };
2971
2972    let req = req_builder.build()?;
2973    let resp = configuration.client.execute(req).await?;
2974
2975    let status = resp.status();
2976    let content_type = resp
2977        .headers()
2978        .get("content-type")
2979        .and_then(|v| v.to_str().ok())
2980        .unwrap_or("application/octet-stream");
2981    let content_type = super::ContentType::from(content_type);
2982
2983    if !status.is_client_error() && !status.is_server_error() {
2984        let content = resp.text().await?;
2985        match content_type {
2986            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2987            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeleteCommentResult`"))),
2988            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::DeleteCommentResult`")))),
2989        }
2990    } else {
2991        let content = resp.text().await?;
2992        let entity: Option<DeleteCommentError> = serde_json::from_str(&content).ok();
2993        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2994    }
2995}
2996
2997pub async fn delete_domain_config(configuration: &configuration::Configuration, params: DeleteDomainConfigParams) -> Result<models::DeleteDomainConfigResponse, Error<DeleteDomainConfigError>> {
2998
2999    let uri_str = format!("{}/api/v1/domain-configs/{domain}", configuration.base_path, domain=crate::client::apis::urlencode(params.domain));
3000    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3001
3002    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3003    if let Some(ref user_agent) = configuration.user_agent {
3004        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3005    }
3006    if let Some(ref apikey) = configuration.api_key {
3007        let key = apikey.key.clone();
3008        let value = match apikey.prefix {
3009            Some(ref prefix) => format!("{} {}", prefix, key),
3010            None => key,
3011        };
3012        req_builder = req_builder.header("x-api-key", value);
3013    };
3014
3015    let req = req_builder.build()?;
3016    let resp = configuration.client.execute(req).await?;
3017
3018    let status = resp.status();
3019    let content_type = resp
3020        .headers()
3021        .get("content-type")
3022        .and_then(|v| v.to_str().ok())
3023        .unwrap_or("application/octet-stream");
3024    let content_type = super::ContentType::from(content_type);
3025
3026    if !status.is_client_error() && !status.is_server_error() {
3027        let content = resp.text().await?;
3028        match content_type {
3029            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3030            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeleteDomainConfigResponse`"))),
3031            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::DeleteDomainConfigResponse`")))),
3032        }
3033    } else {
3034        let content = resp.text().await?;
3035        let entity: Option<DeleteDomainConfigError> = serde_json::from_str(&content).ok();
3036        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3037    }
3038}
3039
3040pub async fn delete_email_template(configuration: &configuration::Configuration, params: DeleteEmailTemplateParams) -> Result<models::ApiEmptyResponse, Error<DeleteEmailTemplateError>> {
3041
3042    let uri_str = format!("{}/api/v1/email-templates/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
3043    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3044
3045    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3046    if let Some(ref user_agent) = configuration.user_agent {
3047        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3048    }
3049    if let Some(ref apikey) = configuration.api_key {
3050        let key = apikey.key.clone();
3051        let value = match apikey.prefix {
3052            Some(ref prefix) => format!("{} {}", prefix, key),
3053            None => key,
3054        };
3055        req_builder = req_builder.header("x-api-key", value);
3056    };
3057
3058    let req = req_builder.build()?;
3059    let resp = configuration.client.execute(req).await?;
3060
3061    let status = resp.status();
3062    let content_type = resp
3063        .headers()
3064        .get("content-type")
3065        .and_then(|v| v.to_str().ok())
3066        .unwrap_or("application/octet-stream");
3067    let content_type = super::ContentType::from(content_type);
3068
3069    if !status.is_client_error() && !status.is_server_error() {
3070        let content = resp.text().await?;
3071        match content_type {
3072            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3073            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
3074            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::ApiEmptyResponse`")))),
3075        }
3076    } else {
3077        let content = resp.text().await?;
3078        let entity: Option<DeleteEmailTemplateError> = serde_json::from_str(&content).ok();
3079        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3080    }
3081}
3082
3083pub async fn delete_email_template_render_error(configuration: &configuration::Configuration, params: DeleteEmailTemplateRenderErrorParams) -> Result<models::ApiEmptyResponse, Error<DeleteEmailTemplateRenderErrorError>> {
3084
3085    let uri_str = format!("{}/api/v1/email-templates/{id}/render-errors/{errorId}", configuration.base_path, id=crate::client::apis::urlencode(params.id), errorId=crate::client::apis::urlencode(params.error_id));
3086    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3087
3088    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3089    if let Some(ref user_agent) = configuration.user_agent {
3090        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3091    }
3092    if let Some(ref apikey) = configuration.api_key {
3093        let key = apikey.key.clone();
3094        let value = match apikey.prefix {
3095            Some(ref prefix) => format!("{} {}", prefix, key),
3096            None => key,
3097        };
3098        req_builder = req_builder.header("x-api-key", value);
3099    };
3100
3101    let req = req_builder.build()?;
3102    let resp = configuration.client.execute(req).await?;
3103
3104    let status = resp.status();
3105    let content_type = resp
3106        .headers()
3107        .get("content-type")
3108        .and_then(|v| v.to_str().ok())
3109        .unwrap_or("application/octet-stream");
3110    let content_type = super::ContentType::from(content_type);
3111
3112    if !status.is_client_error() && !status.is_server_error() {
3113        let content = resp.text().await?;
3114        match content_type {
3115            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3116            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
3117            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::ApiEmptyResponse`")))),
3118        }
3119    } else {
3120        let content = resp.text().await?;
3121        let entity: Option<DeleteEmailTemplateRenderErrorError> = serde_json::from_str(&content).ok();
3122        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3123    }
3124}
3125
3126pub async fn delete_hash_tag(configuration: &configuration::Configuration, params: DeleteHashTagParams) -> Result<models::ApiEmptyResponse, Error<DeleteHashTagError>> {
3127
3128    let uri_str = format!("{}/api/v1/hash-tags/{tag}", configuration.base_path, tag=crate::client::apis::urlencode(params.tag));
3129    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3130
3131    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3132    if let Some(ref user_agent) = configuration.user_agent {
3133        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3134    }
3135    if let Some(ref apikey) = configuration.api_key {
3136        let key = apikey.key.clone();
3137        let value = match apikey.prefix {
3138            Some(ref prefix) => format!("{} {}", prefix, key),
3139            None => key,
3140        };
3141        req_builder = req_builder.header("x-api-key", value);
3142    };
3143    req_builder = req_builder.json(&params.delete_hash_tag_request_body);
3144
3145    let req = req_builder.build()?;
3146    let resp = configuration.client.execute(req).await?;
3147
3148    let status = resp.status();
3149    let content_type = resp
3150        .headers()
3151        .get("content-type")
3152        .and_then(|v| v.to_str().ok())
3153        .unwrap_or("application/octet-stream");
3154    let content_type = super::ContentType::from(content_type);
3155
3156    if !status.is_client_error() && !status.is_server_error() {
3157        let content = resp.text().await?;
3158        match content_type {
3159            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3160            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
3161            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::ApiEmptyResponse`")))),
3162        }
3163    } else {
3164        let content = resp.text().await?;
3165        let entity: Option<DeleteHashTagError> = serde_json::from_str(&content).ok();
3166        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3167    }
3168}
3169
3170pub async fn delete_moderator(configuration: &configuration::Configuration, params: DeleteModeratorParams) -> Result<models::ApiEmptyResponse, Error<DeleteModeratorError>> {
3171
3172    let uri_str = format!("{}/api/v1/moderators/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
3173    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3174
3175    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3176    if let Some(ref param_value) = params.send_email {
3177        req_builder = req_builder.query(&[("sendEmail", &param_value.to_string())]);
3178    }
3179    if let Some(ref user_agent) = configuration.user_agent {
3180        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3181    }
3182    if let Some(ref apikey) = configuration.api_key {
3183        let key = apikey.key.clone();
3184        let value = match apikey.prefix {
3185            Some(ref prefix) => format!("{} {}", prefix, key),
3186            None => key,
3187        };
3188        req_builder = req_builder.header("x-api-key", value);
3189    };
3190
3191    let req = req_builder.build()?;
3192    let resp = configuration.client.execute(req).await?;
3193
3194    let status = resp.status();
3195    let content_type = resp
3196        .headers()
3197        .get("content-type")
3198        .and_then(|v| v.to_str().ok())
3199        .unwrap_or("application/octet-stream");
3200    let content_type = super::ContentType::from(content_type);
3201
3202    if !status.is_client_error() && !status.is_server_error() {
3203        let content = resp.text().await?;
3204        match content_type {
3205            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3206            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
3207            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::ApiEmptyResponse`")))),
3208        }
3209    } else {
3210        let content = resp.text().await?;
3211        let entity: Option<DeleteModeratorError> = serde_json::from_str(&content).ok();
3212        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3213    }
3214}
3215
3216pub async fn delete_notification_count(configuration: &configuration::Configuration, params: DeleteNotificationCountParams) -> Result<models::ApiEmptyResponse, Error<DeleteNotificationCountError>> {
3217
3218    let uri_str = format!("{}/api/v1/notification-count/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
3219    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3220
3221    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3222    if let Some(ref user_agent) = configuration.user_agent {
3223        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3224    }
3225    if let Some(ref apikey) = configuration.api_key {
3226        let key = apikey.key.clone();
3227        let value = match apikey.prefix {
3228            Some(ref prefix) => format!("{} {}", prefix, key),
3229            None => key,
3230        };
3231        req_builder = req_builder.header("x-api-key", value);
3232    };
3233
3234    let req = req_builder.build()?;
3235    let resp = configuration.client.execute(req).await?;
3236
3237    let status = resp.status();
3238    let content_type = resp
3239        .headers()
3240        .get("content-type")
3241        .and_then(|v| v.to_str().ok())
3242        .unwrap_or("application/octet-stream");
3243    let content_type = super::ContentType::from(content_type);
3244
3245    if !status.is_client_error() && !status.is_server_error() {
3246        let content = resp.text().await?;
3247        match content_type {
3248            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3249            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
3250            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::ApiEmptyResponse`")))),
3251        }
3252    } else {
3253        let content = resp.text().await?;
3254        let entity: Option<DeleteNotificationCountError> = serde_json::from_str(&content).ok();
3255        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3256    }
3257}
3258
3259pub async fn delete_page(configuration: &configuration::Configuration, params: DeletePageParams) -> Result<models::DeletePageApiResponse, Error<DeletePageError>> {
3260
3261    let uri_str = format!("{}/api/v1/pages/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
3262    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3263
3264    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3265    if let Some(ref user_agent) = configuration.user_agent {
3266        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3267    }
3268    if let Some(ref apikey) = configuration.api_key {
3269        let key = apikey.key.clone();
3270        let value = match apikey.prefix {
3271            Some(ref prefix) => format!("{} {}", prefix, key),
3272            None => key,
3273        };
3274        req_builder = req_builder.header("x-api-key", value);
3275    };
3276
3277    let req = req_builder.build()?;
3278    let resp = configuration.client.execute(req).await?;
3279
3280    let status = resp.status();
3281    let content_type = resp
3282        .headers()
3283        .get("content-type")
3284        .and_then(|v| v.to_str().ok())
3285        .unwrap_or("application/octet-stream");
3286    let content_type = super::ContentType::from(content_type);
3287
3288    if !status.is_client_error() && !status.is_server_error() {
3289        let content = resp.text().await?;
3290        match content_type {
3291            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3292            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeletePageApiResponse`"))),
3293            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::DeletePageApiResponse`")))),
3294        }
3295    } else {
3296        let content = resp.text().await?;
3297        let entity: Option<DeletePageError> = serde_json::from_str(&content).ok();
3298        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3299    }
3300}
3301
3302pub async fn delete_pending_webhook_event(configuration: &configuration::Configuration, params: DeletePendingWebhookEventParams) -> Result<models::ApiEmptyResponse, Error<DeletePendingWebhookEventError>> {
3303
3304    let uri_str = format!("{}/api/v1/pending-webhook-events/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
3305    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3306
3307    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3308    if let Some(ref user_agent) = configuration.user_agent {
3309        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3310    }
3311    if let Some(ref apikey) = configuration.api_key {
3312        let key = apikey.key.clone();
3313        let value = match apikey.prefix {
3314            Some(ref prefix) => format!("{} {}", prefix, key),
3315            None => key,
3316        };
3317        req_builder = req_builder.header("x-api-key", value);
3318    };
3319
3320    let req = req_builder.build()?;
3321    let resp = configuration.client.execute(req).await?;
3322
3323    let status = resp.status();
3324    let content_type = resp
3325        .headers()
3326        .get("content-type")
3327        .and_then(|v| v.to_str().ok())
3328        .unwrap_or("application/octet-stream");
3329    let content_type = super::ContentType::from(content_type);
3330
3331    if !status.is_client_error() && !status.is_server_error() {
3332        let content = resp.text().await?;
3333        match content_type {
3334            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3335            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
3336            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::ApiEmptyResponse`")))),
3337        }
3338    } else {
3339        let content = resp.text().await?;
3340        let entity: Option<DeletePendingWebhookEventError> = serde_json::from_str(&content).ok();
3341        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3342    }
3343}
3344
3345pub async fn delete_question_config(configuration: &configuration::Configuration, params: DeleteQuestionConfigParams) -> Result<models::ApiEmptyResponse, Error<DeleteQuestionConfigError>> {
3346
3347    let uri_str = format!("{}/api/v1/question-configs/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
3348    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3349
3350    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3351    if let Some(ref user_agent) = configuration.user_agent {
3352        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3353    }
3354    if let Some(ref apikey) = configuration.api_key {
3355        let key = apikey.key.clone();
3356        let value = match apikey.prefix {
3357            Some(ref prefix) => format!("{} {}", prefix, key),
3358            None => key,
3359        };
3360        req_builder = req_builder.header("x-api-key", value);
3361    };
3362
3363    let req = req_builder.build()?;
3364    let resp = configuration.client.execute(req).await?;
3365
3366    let status = resp.status();
3367    let content_type = resp
3368        .headers()
3369        .get("content-type")
3370        .and_then(|v| v.to_str().ok())
3371        .unwrap_or("application/octet-stream");
3372    let content_type = super::ContentType::from(content_type);
3373
3374    if !status.is_client_error() && !status.is_server_error() {
3375        let content = resp.text().await?;
3376        match content_type {
3377            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3378            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
3379            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::ApiEmptyResponse`")))),
3380        }
3381    } else {
3382        let content = resp.text().await?;
3383        let entity: Option<DeleteQuestionConfigError> = serde_json::from_str(&content).ok();
3384        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3385    }
3386}
3387
3388pub async fn delete_question_result(configuration: &configuration::Configuration, params: DeleteQuestionResultParams) -> Result<models::ApiEmptyResponse, Error<DeleteQuestionResultError>> {
3389
3390    let uri_str = format!("{}/api/v1/question-results/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
3391    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3392
3393    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3394    if let Some(ref user_agent) = configuration.user_agent {
3395        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3396    }
3397    if let Some(ref apikey) = configuration.api_key {
3398        let key = apikey.key.clone();
3399        let value = match apikey.prefix {
3400            Some(ref prefix) => format!("{} {}", prefix, key),
3401            None => key,
3402        };
3403        req_builder = req_builder.header("x-api-key", value);
3404    };
3405
3406    let req = req_builder.build()?;
3407    let resp = configuration.client.execute(req).await?;
3408
3409    let status = resp.status();
3410    let content_type = resp
3411        .headers()
3412        .get("content-type")
3413        .and_then(|v| v.to_str().ok())
3414        .unwrap_or("application/octet-stream");
3415    let content_type = super::ContentType::from(content_type);
3416
3417    if !status.is_client_error() && !status.is_server_error() {
3418        let content = resp.text().await?;
3419        match content_type {
3420            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3421            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
3422            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::ApiEmptyResponse`")))),
3423        }
3424    } else {
3425        let content = resp.text().await?;
3426        let entity: Option<DeleteQuestionResultError> = serde_json::from_str(&content).ok();
3427        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3428    }
3429}
3430
3431pub async fn delete_sso_user(configuration: &configuration::Configuration, params: DeleteSsoUserParams) -> Result<models::DeleteSsoUserApiResponse, Error<DeleteSsoUserError>> {
3432
3433    let uri_str = format!("{}/api/v1/sso-users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
3434    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3435
3436    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3437    if let Some(ref param_value) = params.delete_comments {
3438        req_builder = req_builder.query(&[("deleteComments", &param_value.to_string())]);
3439    }
3440    if let Some(ref param_value) = params.comment_delete_mode {
3441        req_builder = req_builder.query(&[("commentDeleteMode", &param_value.to_string())]);
3442    }
3443    if let Some(ref user_agent) = configuration.user_agent {
3444        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3445    }
3446    if let Some(ref apikey) = configuration.api_key {
3447        let key = apikey.key.clone();
3448        let value = match apikey.prefix {
3449            Some(ref prefix) => format!("{} {}", prefix, key),
3450            None => key,
3451        };
3452        req_builder = req_builder.header("x-api-key", value);
3453    };
3454
3455    let req = req_builder.build()?;
3456    let resp = configuration.client.execute(req).await?;
3457
3458    let status = resp.status();
3459    let content_type = resp
3460        .headers()
3461        .get("content-type")
3462        .and_then(|v| v.to_str().ok())
3463        .unwrap_or("application/octet-stream");
3464    let content_type = super::ContentType::from(content_type);
3465
3466    if !status.is_client_error() && !status.is_server_error() {
3467        let content = resp.text().await?;
3468        match content_type {
3469            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3470            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeleteSsoUserApiResponse`"))),
3471            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::DeleteSsoUserApiResponse`")))),
3472        }
3473    } else {
3474        let content = resp.text().await?;
3475        let entity: Option<DeleteSsoUserError> = serde_json::from_str(&content).ok();
3476        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3477    }
3478}
3479
3480pub async fn delete_subscription(configuration: &configuration::Configuration, params: DeleteSubscriptionParams) -> Result<models::DeleteSubscriptionApiResponse, Error<DeleteSubscriptionError>> {
3481
3482    let uri_str = format!("{}/api/v1/subscriptions/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
3483    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3484
3485    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3486    if let Some(ref param_value) = params.user_id {
3487        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
3488    }
3489    if let Some(ref user_agent) = configuration.user_agent {
3490        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3491    }
3492    if let Some(ref apikey) = configuration.api_key {
3493        let key = apikey.key.clone();
3494        let value = match apikey.prefix {
3495            Some(ref prefix) => format!("{} {}", prefix, key),
3496            None => key,
3497        };
3498        req_builder = req_builder.header("x-api-key", value);
3499    };
3500
3501    let req = req_builder.build()?;
3502    let resp = configuration.client.execute(req).await?;
3503
3504    let status = resp.status();
3505    let content_type = resp
3506        .headers()
3507        .get("content-type")
3508        .and_then(|v| v.to_str().ok())
3509        .unwrap_or("application/octet-stream");
3510    let content_type = super::ContentType::from(content_type);
3511
3512    if !status.is_client_error() && !status.is_server_error() {
3513        let content = resp.text().await?;
3514        match content_type {
3515            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3516            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeleteSubscriptionApiResponse`"))),
3517            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::DeleteSubscriptionApiResponse`")))),
3518        }
3519    } else {
3520        let content = resp.text().await?;
3521        let entity: Option<DeleteSubscriptionError> = serde_json::from_str(&content).ok();
3522        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3523    }
3524}
3525
3526pub async fn delete_tenant(configuration: &configuration::Configuration, params: DeleteTenantParams) -> Result<models::ApiEmptyResponse, Error<DeleteTenantError>> {
3527
3528    let uri_str = format!("{}/api/v1/tenants/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
3529    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3530
3531    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3532    if let Some(ref param_value) = params.sure {
3533        req_builder = req_builder.query(&[("sure", &param_value.to_string())]);
3534    }
3535    if let Some(ref user_agent) = configuration.user_agent {
3536        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3537    }
3538    if let Some(ref apikey) = configuration.api_key {
3539        let key = apikey.key.clone();
3540        let value = match apikey.prefix {
3541            Some(ref prefix) => format!("{} {}", prefix, key),
3542            None => key,
3543        };
3544        req_builder = req_builder.header("x-api-key", value);
3545    };
3546
3547    let req = req_builder.build()?;
3548    let resp = configuration.client.execute(req).await?;
3549
3550    let status = resp.status();
3551    let content_type = resp
3552        .headers()
3553        .get("content-type")
3554        .and_then(|v| v.to_str().ok())
3555        .unwrap_or("application/octet-stream");
3556    let content_type = super::ContentType::from(content_type);
3557
3558    if !status.is_client_error() && !status.is_server_error() {
3559        let content = resp.text().await?;
3560        match content_type {
3561            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3562            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
3563            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::ApiEmptyResponse`")))),
3564        }
3565    } else {
3566        let content = resp.text().await?;
3567        let entity: Option<DeleteTenantError> = serde_json::from_str(&content).ok();
3568        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3569    }
3570}
3571
3572pub async fn delete_tenant_package(configuration: &configuration::Configuration, params: DeleteTenantPackageParams) -> Result<models::ApiEmptyResponse, Error<DeleteTenantPackageError>> {
3573
3574    let uri_str = format!("{}/api/v1/tenant-packages/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
3575    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3576
3577    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3578    if let Some(ref user_agent) = configuration.user_agent {
3579        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3580    }
3581    if let Some(ref apikey) = configuration.api_key {
3582        let key = apikey.key.clone();
3583        let value = match apikey.prefix {
3584            Some(ref prefix) => format!("{} {}", prefix, key),
3585            None => key,
3586        };
3587        req_builder = req_builder.header("x-api-key", value);
3588    };
3589
3590    let req = req_builder.build()?;
3591    let resp = configuration.client.execute(req).await?;
3592
3593    let status = resp.status();
3594    let content_type = resp
3595        .headers()
3596        .get("content-type")
3597        .and_then(|v| v.to_str().ok())
3598        .unwrap_or("application/octet-stream");
3599    let content_type = super::ContentType::from(content_type);
3600
3601    if !status.is_client_error() && !status.is_server_error() {
3602        let content = resp.text().await?;
3603        match content_type {
3604            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3605            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
3606            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::ApiEmptyResponse`")))),
3607        }
3608    } else {
3609        let content = resp.text().await?;
3610        let entity: Option<DeleteTenantPackageError> = serde_json::from_str(&content).ok();
3611        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3612    }
3613}
3614
3615pub async fn delete_tenant_user(configuration: &configuration::Configuration, params: DeleteTenantUserParams) -> Result<models::ApiEmptyResponse, Error<DeleteTenantUserError>> {
3616
3617    let uri_str = format!("{}/api/v1/tenant-users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
3618    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3619
3620    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3621    if let Some(ref param_value) = params.delete_comments {
3622        req_builder = req_builder.query(&[("deleteComments", &param_value.to_string())]);
3623    }
3624    if let Some(ref param_value) = params.comment_delete_mode {
3625        req_builder = req_builder.query(&[("commentDeleteMode", &param_value.to_string())]);
3626    }
3627    if let Some(ref user_agent) = configuration.user_agent {
3628        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3629    }
3630    if let Some(ref apikey) = configuration.api_key {
3631        let key = apikey.key.clone();
3632        let value = match apikey.prefix {
3633            Some(ref prefix) => format!("{} {}", prefix, key),
3634            None => key,
3635        };
3636        req_builder = req_builder.header("x-api-key", value);
3637    };
3638
3639    let req = req_builder.build()?;
3640    let resp = configuration.client.execute(req).await?;
3641
3642    let status = resp.status();
3643    let content_type = resp
3644        .headers()
3645        .get("content-type")
3646        .and_then(|v| v.to_str().ok())
3647        .unwrap_or("application/octet-stream");
3648    let content_type = super::ContentType::from(content_type);
3649
3650    if !status.is_client_error() && !status.is_server_error() {
3651        let content = resp.text().await?;
3652        match content_type {
3653            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3654            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
3655            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::ApiEmptyResponse`")))),
3656        }
3657    } else {
3658        let content = resp.text().await?;
3659        let entity: Option<DeleteTenantUserError> = serde_json::from_str(&content).ok();
3660        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3661    }
3662}
3663
3664pub async fn delete_user_badge(configuration: &configuration::Configuration, params: DeleteUserBadgeParams) -> Result<models::ApiEmptySuccessResponse, Error<DeleteUserBadgeError>> {
3665
3666    let uri_str = format!("{}/api/v1/user-badges/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
3667    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3668
3669    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3670    if let Some(ref user_agent) = configuration.user_agent {
3671        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3672    }
3673    if let Some(ref apikey) = configuration.api_key {
3674        let key = apikey.key.clone();
3675        let value = match apikey.prefix {
3676            Some(ref prefix) => format!("{} {}", prefix, key),
3677            None => key,
3678        };
3679        req_builder = req_builder.header("x-api-key", value);
3680    };
3681
3682    let req = req_builder.build()?;
3683    let resp = configuration.client.execute(req).await?;
3684
3685    let status = resp.status();
3686    let content_type = resp
3687        .headers()
3688        .get("content-type")
3689        .and_then(|v| v.to_str().ok())
3690        .unwrap_or("application/octet-stream");
3691    let content_type = super::ContentType::from(content_type);
3692
3693    if !status.is_client_error() && !status.is_server_error() {
3694        let content = resp.text().await?;
3695        match content_type {
3696            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3697            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptySuccessResponse`"))),
3698            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::ApiEmptySuccessResponse`")))),
3699        }
3700    } else {
3701        let content = resp.text().await?;
3702        let entity: Option<DeleteUserBadgeError> = serde_json::from_str(&content).ok();
3703        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3704    }
3705}
3706
3707pub async fn delete_vote(configuration: &configuration::Configuration, params: DeleteVoteParams) -> Result<models::VoteDeleteResponse, Error<DeleteVoteError>> {
3708
3709    let uri_str = format!("{}/api/v1/votes/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
3710    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3711
3712    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3713    if let Some(ref param_value) = params.edit_key {
3714        req_builder = req_builder.query(&[("editKey", &param_value.to_string())]);
3715    }
3716    if let Some(ref user_agent) = configuration.user_agent {
3717        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3718    }
3719    if let Some(ref apikey) = configuration.api_key {
3720        let key = apikey.key.clone();
3721        let value = match apikey.prefix {
3722            Some(ref prefix) => format!("{} {}", prefix, key),
3723            None => key,
3724        };
3725        req_builder = req_builder.header("x-api-key", value);
3726    };
3727
3728    let req = req_builder.build()?;
3729    let resp = configuration.client.execute(req).await?;
3730
3731    let status = resp.status();
3732    let content_type = resp
3733        .headers()
3734        .get("content-type")
3735        .and_then(|v| v.to_str().ok())
3736        .unwrap_or("application/octet-stream");
3737    let content_type = super::ContentType::from(content_type);
3738
3739    if !status.is_client_error() && !status.is_server_error() {
3740        let content = resp.text().await?;
3741        match content_type {
3742            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3743            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VoteDeleteResponse`"))),
3744            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::VoteDeleteResponse`")))),
3745        }
3746    } else {
3747        let content = resp.text().await?;
3748        let entity: Option<DeleteVoteError> = serde_json::from_str(&content).ok();
3749        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3750    }
3751}
3752
3753pub async fn flag_comment(configuration: &configuration::Configuration, params: FlagCommentParams) -> Result<models::FlagCommentResponse, Error<FlagCommentError>> {
3754
3755    let uri_str = format!("{}/api/v1/comments/{id}/flag", configuration.base_path, id=crate::client::apis::urlencode(params.id));
3756    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3757
3758    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3759    if let Some(ref param_value) = params.user_id {
3760        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
3761    }
3762    if let Some(ref param_value) = params.anon_user_id {
3763        req_builder = req_builder.query(&[("anonUserId", &param_value.to_string())]);
3764    }
3765    if let Some(ref user_agent) = configuration.user_agent {
3766        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3767    }
3768    if let Some(ref apikey) = configuration.api_key {
3769        let key = apikey.key.clone();
3770        let value = match apikey.prefix {
3771            Some(ref prefix) => format!("{} {}", prefix, key),
3772            None => key,
3773        };
3774        req_builder = req_builder.header("x-api-key", value);
3775    };
3776
3777    let req = req_builder.build()?;
3778    let resp = configuration.client.execute(req).await?;
3779
3780    let status = resp.status();
3781    let content_type = resp
3782        .headers()
3783        .get("content-type")
3784        .and_then(|v| v.to_str().ok())
3785        .unwrap_or("application/octet-stream");
3786    let content_type = super::ContentType::from(content_type);
3787
3788    if !status.is_client_error() && !status.is_server_error() {
3789        let content = resp.text().await?;
3790        match content_type {
3791            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3792            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FlagCommentResponse`"))),
3793            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::FlagCommentResponse`")))),
3794        }
3795    } else {
3796        let content = resp.text().await?;
3797        let entity: Option<FlagCommentError> = serde_json::from_str(&content).ok();
3798        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3799    }
3800}
3801
3802pub async fn get_audit_logs(configuration: &configuration::Configuration, params: GetAuditLogsParams) -> Result<models::GetAuditLogsResponse, Error<GetAuditLogsError>> {
3803
3804    let uri_str = format!("{}/api/v1/audit-logs", configuration.base_path);
3805    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3806
3807    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3808    if let Some(ref param_value) = params.limit {
3809        req_builder = req_builder.query(&[("limit", &param_value.to_string())]);
3810    }
3811    if let Some(ref param_value) = params.skip {
3812        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
3813    }
3814    if let Some(ref param_value) = params.order {
3815        req_builder = req_builder.query(&[("order", &param_value.to_string())]);
3816    }
3817    if let Some(ref param_value) = params.after {
3818        req_builder = req_builder.query(&[("after", &param_value.to_string())]);
3819    }
3820    if let Some(ref param_value) = params.before {
3821        req_builder = req_builder.query(&[("before", &param_value.to_string())]);
3822    }
3823    if let Some(ref user_agent) = configuration.user_agent {
3824        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3825    }
3826    if let Some(ref apikey) = configuration.api_key {
3827        let key = apikey.key.clone();
3828        let value = match apikey.prefix {
3829            Some(ref prefix) => format!("{} {}", prefix, key),
3830            None => key,
3831        };
3832        req_builder = req_builder.header("x-api-key", value);
3833    };
3834
3835    let req = req_builder.build()?;
3836    let resp = configuration.client.execute(req).await?;
3837
3838    let status = resp.status();
3839    let content_type = resp
3840        .headers()
3841        .get("content-type")
3842        .and_then(|v| v.to_str().ok())
3843        .unwrap_or("application/octet-stream");
3844    let content_type = super::ContentType::from(content_type);
3845
3846    if !status.is_client_error() && !status.is_server_error() {
3847        let content = resp.text().await?;
3848        match content_type {
3849            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3850            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAuditLogsResponse`"))),
3851            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::GetAuditLogsResponse`")))),
3852        }
3853    } else {
3854        let content = resp.text().await?;
3855        let entity: Option<GetAuditLogsError> = serde_json::from_str(&content).ok();
3856        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3857    }
3858}
3859
3860pub async fn get_cached_notification_count(configuration: &configuration::Configuration, params: GetCachedNotificationCountParams) -> Result<models::GetCachedNotificationCountResponse, Error<GetCachedNotificationCountError>> {
3861
3862    let uri_str = format!("{}/api/v1/notification-count/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
3863    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3864
3865    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3866    if let Some(ref user_agent) = configuration.user_agent {
3867        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3868    }
3869    if let Some(ref apikey) = configuration.api_key {
3870        let key = apikey.key.clone();
3871        let value = match apikey.prefix {
3872            Some(ref prefix) => format!("{} {}", prefix, key),
3873            None => key,
3874        };
3875        req_builder = req_builder.header("x-api-key", value);
3876    };
3877
3878    let req = req_builder.build()?;
3879    let resp = configuration.client.execute(req).await?;
3880
3881    let status = resp.status();
3882    let content_type = resp
3883        .headers()
3884        .get("content-type")
3885        .and_then(|v| v.to_str().ok())
3886        .unwrap_or("application/octet-stream");
3887    let content_type = super::ContentType::from(content_type);
3888
3889    if !status.is_client_error() && !status.is_server_error() {
3890        let content = resp.text().await?;
3891        match content_type {
3892            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3893            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetCachedNotificationCountResponse`"))),
3894            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::GetCachedNotificationCountResponse`")))),
3895        }
3896    } else {
3897        let content = resp.text().await?;
3898        let entity: Option<GetCachedNotificationCountError> = serde_json::from_str(&content).ok();
3899        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3900    }
3901}
3902
3903pub async fn get_comment(configuration: &configuration::Configuration, params: GetCommentParams) -> Result<models::ApiGetCommentResponse, Error<GetCommentError>> {
3904
3905    let uri_str = format!("{}/api/v1/comments/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
3906    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3907
3908    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3909    if let Some(ref user_agent) = configuration.user_agent {
3910        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3911    }
3912    if let Some(ref apikey) = configuration.api_key {
3913        let key = apikey.key.clone();
3914        let value = match apikey.prefix {
3915            Some(ref prefix) => format!("{} {}", prefix, key),
3916            None => key,
3917        };
3918        req_builder = req_builder.header("x-api-key", value);
3919    };
3920
3921    let req = req_builder.build()?;
3922    let resp = configuration.client.execute(req).await?;
3923
3924    let status = resp.status();
3925    let content_type = resp
3926        .headers()
3927        .get("content-type")
3928        .and_then(|v| v.to_str().ok())
3929        .unwrap_or("application/octet-stream");
3930    let content_type = super::ContentType::from(content_type);
3931
3932    if !status.is_client_error() && !status.is_server_error() {
3933        let content = resp.text().await?;
3934        match content_type {
3935            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3936            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiGetCommentResponse`"))),
3937            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::ApiGetCommentResponse`")))),
3938        }
3939    } else {
3940        let content = resp.text().await?;
3941        let entity: Option<GetCommentError> = serde_json::from_str(&content).ok();
3942        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3943    }
3944}
3945
3946pub async fn get_comments(configuration: &configuration::Configuration, params: GetCommentsParams) -> Result<models::ApiGetCommentsResponse, Error<GetCommentsError>> {
3947
3948    let uri_str = format!("{}/api/v1/comments", configuration.base_path);
3949    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3950
3951    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
3952    if let Some(ref param_value) = params.page {
3953        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3954    }
3955    if let Some(ref param_value) = params.limit {
3956        req_builder = req_builder.query(&[("limit", &param_value.to_string())]);
3957    }
3958    if let Some(ref param_value) = params.skip {
3959        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
3960    }
3961    if let Some(ref param_value) = params.as_tree {
3962        req_builder = req_builder.query(&[("asTree", &param_value.to_string())]);
3963    }
3964    if let Some(ref param_value) = params.skip_children {
3965        req_builder = req_builder.query(&[("skipChildren", &param_value.to_string())]);
3966    }
3967    if let Some(ref param_value) = params.limit_children {
3968        req_builder = req_builder.query(&[("limitChildren", &param_value.to_string())]);
3969    }
3970    if let Some(ref param_value) = params.max_tree_depth {
3971        req_builder = req_builder.query(&[("maxTreeDepth", &param_value.to_string())]);
3972    }
3973    if let Some(ref param_value) = params.url_id {
3974        req_builder = req_builder.query(&[("urlId", &param_value.to_string())]);
3975    }
3976    if let Some(ref param_value) = params.user_id {
3977        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
3978    }
3979    if let Some(ref param_value) = params.anon_user_id {
3980        req_builder = req_builder.query(&[("anonUserId", &param_value.to_string())]);
3981    }
3982    if let Some(ref param_value) = params.context_user_id {
3983        req_builder = req_builder.query(&[("contextUserId", &param_value.to_string())]);
3984    }
3985    if let Some(ref param_value) = params.hash_tag {
3986        req_builder = req_builder.query(&[("hashTag", &param_value.to_string())]);
3987    }
3988    if let Some(ref param_value) = params.parent_id {
3989        req_builder = req_builder.query(&[("parentId", &param_value.to_string())]);
3990    }
3991    if let Some(ref param_value) = params.direction {
3992        req_builder = req_builder.query(&[("direction", &param_value.to_string())]);
3993    }
3994    if let Some(ref param_value) = params.from_date {
3995        req_builder = req_builder.query(&[("fromDate", &param_value.to_string())]);
3996    }
3997    if let Some(ref param_value) = params.to_date {
3998        req_builder = req_builder.query(&[("toDate", &param_value.to_string())]);
3999    }
4000    if let Some(ref user_agent) = configuration.user_agent {
4001        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4002    }
4003    if let Some(ref apikey) = configuration.api_key {
4004        let key = apikey.key.clone();
4005        let value = match apikey.prefix {
4006            Some(ref prefix) => format!("{} {}", prefix, key),
4007            None => key,
4008        };
4009        req_builder = req_builder.header("x-api-key", value);
4010    };
4011
4012    let req = req_builder.build()?;
4013    let resp = configuration.client.execute(req).await?;
4014
4015    let status = resp.status();
4016    let content_type = resp
4017        .headers()
4018        .get("content-type")
4019        .and_then(|v| v.to_str().ok())
4020        .unwrap_or("application/octet-stream");
4021    let content_type = super::ContentType::from(content_type);
4022
4023    if !status.is_client_error() && !status.is_server_error() {
4024        let content = resp.text().await?;
4025        match content_type {
4026            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4027            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiGetCommentsResponse`"))),
4028            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::ApiGetCommentsResponse`")))),
4029        }
4030    } else {
4031        let content = resp.text().await?;
4032        let entity: Option<GetCommentsError> = serde_json::from_str(&content).ok();
4033        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4034    }
4035}
4036
4037pub async fn get_domain_config(configuration: &configuration::Configuration, params: GetDomainConfigParams) -> Result<models::GetDomainConfigResponse, Error<GetDomainConfigError>> {
4038
4039    let uri_str = format!("{}/api/v1/domain-configs/{domain}", configuration.base_path, domain=crate::client::apis::urlencode(params.domain));
4040    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4041
4042    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4043    if let Some(ref user_agent) = configuration.user_agent {
4044        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4045    }
4046    if let Some(ref apikey) = configuration.api_key {
4047        let key = apikey.key.clone();
4048        let value = match apikey.prefix {
4049            Some(ref prefix) => format!("{} {}", prefix, key),
4050            None => key,
4051        };
4052        req_builder = req_builder.header("x-api-key", value);
4053    };
4054
4055    let req = req_builder.build()?;
4056    let resp = configuration.client.execute(req).await?;
4057
4058    let status = resp.status();
4059    let content_type = resp
4060        .headers()
4061        .get("content-type")
4062        .and_then(|v| v.to_str().ok())
4063        .unwrap_or("application/octet-stream");
4064    let content_type = super::ContentType::from(content_type);
4065
4066    if !status.is_client_error() && !status.is_server_error() {
4067        let content = resp.text().await?;
4068        match content_type {
4069            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4070            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetDomainConfigResponse`"))),
4071            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::GetDomainConfigResponse`")))),
4072        }
4073    } else {
4074        let content = resp.text().await?;
4075        let entity: Option<GetDomainConfigError> = serde_json::from_str(&content).ok();
4076        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4077    }
4078}
4079
4080pub async fn get_domain_configs(configuration: &configuration::Configuration, params: GetDomainConfigsParams) -> Result<models::GetDomainConfigsResponse, Error<GetDomainConfigsError>> {
4081
4082    let uri_str = format!("{}/api/v1/domain-configs", configuration.base_path);
4083    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4084
4085    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4086    if let Some(ref user_agent) = configuration.user_agent {
4087        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4088    }
4089    if let Some(ref apikey) = configuration.api_key {
4090        let key = apikey.key.clone();
4091        let value = match apikey.prefix {
4092            Some(ref prefix) => format!("{} {}", prefix, key),
4093            None => key,
4094        };
4095        req_builder = req_builder.header("x-api-key", value);
4096    };
4097
4098    let req = req_builder.build()?;
4099    let resp = configuration.client.execute(req).await?;
4100
4101    let status = resp.status();
4102    let content_type = resp
4103        .headers()
4104        .get("content-type")
4105        .and_then(|v| v.to_str().ok())
4106        .unwrap_or("application/octet-stream");
4107    let content_type = super::ContentType::from(content_type);
4108
4109    if !status.is_client_error() && !status.is_server_error() {
4110        let content = resp.text().await?;
4111        match content_type {
4112            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4113            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetDomainConfigsResponse`"))),
4114            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::GetDomainConfigsResponse`")))),
4115        }
4116    } else {
4117        let content = resp.text().await?;
4118        let entity: Option<GetDomainConfigsError> = serde_json::from_str(&content).ok();
4119        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4120    }
4121}
4122
4123pub async fn get_email_template(configuration: &configuration::Configuration, params: GetEmailTemplateParams) -> Result<models::GetEmailTemplateResponse, Error<GetEmailTemplateError>> {
4124
4125    let uri_str = format!("{}/api/v1/email-templates/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
4126    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4127
4128    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4129    if let Some(ref user_agent) = configuration.user_agent {
4130        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4131    }
4132    if let Some(ref apikey) = configuration.api_key {
4133        let key = apikey.key.clone();
4134        let value = match apikey.prefix {
4135            Some(ref prefix) => format!("{} {}", prefix, key),
4136            None => key,
4137        };
4138        req_builder = req_builder.header("x-api-key", value);
4139    };
4140
4141    let req = req_builder.build()?;
4142    let resp = configuration.client.execute(req).await?;
4143
4144    let status = resp.status();
4145    let content_type = resp
4146        .headers()
4147        .get("content-type")
4148        .and_then(|v| v.to_str().ok())
4149        .unwrap_or("application/octet-stream");
4150    let content_type = super::ContentType::from(content_type);
4151
4152    if !status.is_client_error() && !status.is_server_error() {
4153        let content = resp.text().await?;
4154        match content_type {
4155            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4156            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEmailTemplateResponse`"))),
4157            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::GetEmailTemplateResponse`")))),
4158        }
4159    } else {
4160        let content = resp.text().await?;
4161        let entity: Option<GetEmailTemplateError> = serde_json::from_str(&content).ok();
4162        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4163    }
4164}
4165
4166pub async fn get_email_template_definitions(configuration: &configuration::Configuration, params: GetEmailTemplateDefinitionsParams) -> Result<models::GetEmailTemplateDefinitionsResponse, Error<GetEmailTemplateDefinitionsError>> {
4167
4168    let uri_str = format!("{}/api/v1/email-templates/definitions", configuration.base_path);
4169    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4170
4171    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4172    if let Some(ref user_agent) = configuration.user_agent {
4173        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4174    }
4175    if let Some(ref apikey) = configuration.api_key {
4176        let key = apikey.key.clone();
4177        let value = match apikey.prefix {
4178            Some(ref prefix) => format!("{} {}", prefix, key),
4179            None => key,
4180        };
4181        req_builder = req_builder.header("x-api-key", value);
4182    };
4183
4184    let req = req_builder.build()?;
4185    let resp = configuration.client.execute(req).await?;
4186
4187    let status = resp.status();
4188    let content_type = resp
4189        .headers()
4190        .get("content-type")
4191        .and_then(|v| v.to_str().ok())
4192        .unwrap_or("application/octet-stream");
4193    let content_type = super::ContentType::from(content_type);
4194
4195    if !status.is_client_error() && !status.is_server_error() {
4196        let content = resp.text().await?;
4197        match content_type {
4198            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4199            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEmailTemplateDefinitionsResponse`"))),
4200            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::GetEmailTemplateDefinitionsResponse`")))),
4201        }
4202    } else {
4203        let content = resp.text().await?;
4204        let entity: Option<GetEmailTemplateDefinitionsError> = serde_json::from_str(&content).ok();
4205        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4206    }
4207}
4208
4209pub async fn get_email_template_render_errors(configuration: &configuration::Configuration, params: GetEmailTemplateRenderErrorsParams) -> Result<models::GetEmailTemplateRenderErrorsResponse, Error<GetEmailTemplateRenderErrorsError>> {
4210
4211    let uri_str = format!("{}/api/v1/email-templates/{id}/render-errors", configuration.base_path, id=crate::client::apis::urlencode(params.id));
4212    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4213
4214    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4215    if let Some(ref param_value) = params.skip {
4216        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
4217    }
4218    if let Some(ref user_agent) = configuration.user_agent {
4219        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4220    }
4221    if let Some(ref apikey) = configuration.api_key {
4222        let key = apikey.key.clone();
4223        let value = match apikey.prefix {
4224            Some(ref prefix) => format!("{} {}", prefix, key),
4225            None => key,
4226        };
4227        req_builder = req_builder.header("x-api-key", value);
4228    };
4229
4230    let req = req_builder.build()?;
4231    let resp = configuration.client.execute(req).await?;
4232
4233    let status = resp.status();
4234    let content_type = resp
4235        .headers()
4236        .get("content-type")
4237        .and_then(|v| v.to_str().ok())
4238        .unwrap_or("application/octet-stream");
4239    let content_type = super::ContentType::from(content_type);
4240
4241    if !status.is_client_error() && !status.is_server_error() {
4242        let content = resp.text().await?;
4243        match content_type {
4244            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4245            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEmailTemplateRenderErrorsResponse`"))),
4246            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::GetEmailTemplateRenderErrorsResponse`")))),
4247        }
4248    } else {
4249        let content = resp.text().await?;
4250        let entity: Option<GetEmailTemplateRenderErrorsError> = serde_json::from_str(&content).ok();
4251        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4252    }
4253}
4254
4255pub async fn get_email_templates(configuration: &configuration::Configuration, params: GetEmailTemplatesParams) -> Result<models::GetEmailTemplatesResponse, Error<GetEmailTemplatesError>> {
4256
4257    let uri_str = format!("{}/api/v1/email-templates", configuration.base_path);
4258    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4259
4260    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4261    if let Some(ref param_value) = params.skip {
4262        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
4263    }
4264    if let Some(ref user_agent) = configuration.user_agent {
4265        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4266    }
4267    if let Some(ref apikey) = configuration.api_key {
4268        let key = apikey.key.clone();
4269        let value = match apikey.prefix {
4270            Some(ref prefix) => format!("{} {}", prefix, key),
4271            None => key,
4272        };
4273        req_builder = req_builder.header("x-api-key", value);
4274    };
4275
4276    let req = req_builder.build()?;
4277    let resp = configuration.client.execute(req).await?;
4278
4279    let status = resp.status();
4280    let content_type = resp
4281        .headers()
4282        .get("content-type")
4283        .and_then(|v| v.to_str().ok())
4284        .unwrap_or("application/octet-stream");
4285    let content_type = super::ContentType::from(content_type);
4286
4287    if !status.is_client_error() && !status.is_server_error() {
4288        let content = resp.text().await?;
4289        match content_type {
4290            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4291            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEmailTemplatesResponse`"))),
4292            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::GetEmailTemplatesResponse`")))),
4293        }
4294    } else {
4295        let content = resp.text().await?;
4296        let entity: Option<GetEmailTemplatesError> = serde_json::from_str(&content).ok();
4297        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4298    }
4299}
4300
4301///  req tenantId afterId
4302pub async fn get_feed_posts(configuration: &configuration::Configuration, params: GetFeedPostsParams) -> Result<models::GetFeedPostsResponse, Error<GetFeedPostsError>> {
4303
4304    let uri_str = format!("{}/api/v1/feed-posts", configuration.base_path);
4305    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4306
4307    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4308    if let Some(ref param_value) = params.after_id {
4309        req_builder = req_builder.query(&[("afterId", &param_value.to_string())]);
4310    }
4311    if let Some(ref param_value) = params.limit {
4312        req_builder = req_builder.query(&[("limit", &param_value.to_string())]);
4313    }
4314    if let Some(ref param_value) = params.tags {
4315        req_builder = match "multi" {
4316            "multi" => req_builder.query(&param_value.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
4317            _ => req_builder.query(&[("tags", &param_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
4318        };
4319    }
4320    if let Some(ref user_agent) = configuration.user_agent {
4321        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4322    }
4323    if let Some(ref apikey) = configuration.api_key {
4324        let key = apikey.key.clone();
4325        let value = match apikey.prefix {
4326            Some(ref prefix) => format!("{} {}", prefix, key),
4327            None => key,
4328        };
4329        req_builder = req_builder.header("x-api-key", value);
4330    };
4331
4332    let req = req_builder.build()?;
4333    let resp = configuration.client.execute(req).await?;
4334
4335    let status = resp.status();
4336    let content_type = resp
4337        .headers()
4338        .get("content-type")
4339        .and_then(|v| v.to_str().ok())
4340        .unwrap_or("application/octet-stream");
4341    let content_type = super::ContentType::from(content_type);
4342
4343    if !status.is_client_error() && !status.is_server_error() {
4344        let content = resp.text().await?;
4345        match content_type {
4346            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4347            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetFeedPostsResponse`"))),
4348            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::GetFeedPostsResponse`")))),
4349        }
4350    } else {
4351        let content = resp.text().await?;
4352        let entity: Option<GetFeedPostsError> = serde_json::from_str(&content).ok();
4353        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4354    }
4355}
4356
4357pub async fn get_hash_tags(configuration: &configuration::Configuration, params: GetHashTagsParams) -> Result<models::GetHashTagsResponse, Error<GetHashTagsError>> {
4358
4359    let uri_str = format!("{}/api/v1/hash-tags", configuration.base_path);
4360    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4361
4362    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4363    if let Some(ref param_value) = params.page {
4364        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
4365    }
4366    if let Some(ref user_agent) = configuration.user_agent {
4367        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4368    }
4369    if let Some(ref apikey) = configuration.api_key {
4370        let key = apikey.key.clone();
4371        let value = match apikey.prefix {
4372            Some(ref prefix) => format!("{} {}", prefix, key),
4373            None => key,
4374        };
4375        req_builder = req_builder.header("x-api-key", value);
4376    };
4377
4378    let req = req_builder.build()?;
4379    let resp = configuration.client.execute(req).await?;
4380
4381    let status = resp.status();
4382    let content_type = resp
4383        .headers()
4384        .get("content-type")
4385        .and_then(|v| v.to_str().ok())
4386        .unwrap_or("application/octet-stream");
4387    let content_type = super::ContentType::from(content_type);
4388
4389    if !status.is_client_error() && !status.is_server_error() {
4390        let content = resp.text().await?;
4391        match content_type {
4392            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4393            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetHashTagsResponse`"))),
4394            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::GetHashTagsResponse`")))),
4395        }
4396    } else {
4397        let content = resp.text().await?;
4398        let entity: Option<GetHashTagsError> = serde_json::from_str(&content).ok();
4399        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4400    }
4401}
4402
4403pub async fn get_moderator(configuration: &configuration::Configuration, params: GetModeratorParams) -> Result<models::GetModeratorResponse, Error<GetModeratorError>> {
4404
4405    let uri_str = format!("{}/api/v1/moderators/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
4406    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4407
4408    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4409    if let Some(ref user_agent) = configuration.user_agent {
4410        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4411    }
4412    if let Some(ref apikey) = configuration.api_key {
4413        let key = apikey.key.clone();
4414        let value = match apikey.prefix {
4415            Some(ref prefix) => format!("{} {}", prefix, key),
4416            None => key,
4417        };
4418        req_builder = req_builder.header("x-api-key", value);
4419    };
4420
4421    let req = req_builder.build()?;
4422    let resp = configuration.client.execute(req).await?;
4423
4424    let status = resp.status();
4425    let content_type = resp
4426        .headers()
4427        .get("content-type")
4428        .and_then(|v| v.to_str().ok())
4429        .unwrap_or("application/octet-stream");
4430    let content_type = super::ContentType::from(content_type);
4431
4432    if !status.is_client_error() && !status.is_server_error() {
4433        let content = resp.text().await?;
4434        match content_type {
4435            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4436            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetModeratorResponse`"))),
4437            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::GetModeratorResponse`")))),
4438        }
4439    } else {
4440        let content = resp.text().await?;
4441        let entity: Option<GetModeratorError> = serde_json::from_str(&content).ok();
4442        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4443    }
4444}
4445
4446pub async fn get_moderators(configuration: &configuration::Configuration, params: GetModeratorsParams) -> Result<models::GetModeratorsResponse, Error<GetModeratorsError>> {
4447
4448    let uri_str = format!("{}/api/v1/moderators", configuration.base_path);
4449    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4450
4451    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4452    if let Some(ref param_value) = params.skip {
4453        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
4454    }
4455    if let Some(ref user_agent) = configuration.user_agent {
4456        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4457    }
4458    if let Some(ref apikey) = configuration.api_key {
4459        let key = apikey.key.clone();
4460        let value = match apikey.prefix {
4461            Some(ref prefix) => format!("{} {}", prefix, key),
4462            None => key,
4463        };
4464        req_builder = req_builder.header("x-api-key", value);
4465    };
4466
4467    let req = req_builder.build()?;
4468    let resp = configuration.client.execute(req).await?;
4469
4470    let status = resp.status();
4471    let content_type = resp
4472        .headers()
4473        .get("content-type")
4474        .and_then(|v| v.to_str().ok())
4475        .unwrap_or("application/octet-stream");
4476    let content_type = super::ContentType::from(content_type);
4477
4478    if !status.is_client_error() && !status.is_server_error() {
4479        let content = resp.text().await?;
4480        match content_type {
4481            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4482            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetModeratorsResponse`"))),
4483            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::GetModeratorsResponse`")))),
4484        }
4485    } else {
4486        let content = resp.text().await?;
4487        let entity: Option<GetModeratorsError> = serde_json::from_str(&content).ok();
4488        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4489    }
4490}
4491
4492pub async fn get_notification_count(configuration: &configuration::Configuration, params: GetNotificationCountParams) -> Result<models::GetNotificationCountResponse, Error<GetNotificationCountError>> {
4493
4494    let uri_str = format!("{}/api/v1/notifications/count", configuration.base_path);
4495    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4496
4497    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4498    if let Some(ref param_value) = params.user_id {
4499        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
4500    }
4501    if let Some(ref param_value) = params.url_id {
4502        req_builder = req_builder.query(&[("urlId", &param_value.to_string())]);
4503    }
4504    if let Some(ref param_value) = params.from_comment_id {
4505        req_builder = req_builder.query(&[("fromCommentId", &param_value.to_string())]);
4506    }
4507    if let Some(ref param_value) = params.viewed {
4508        req_builder = req_builder.query(&[("viewed", &param_value.to_string())]);
4509    }
4510    if let Some(ref param_value) = params.r#type {
4511        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
4512    }
4513    if let Some(ref user_agent) = configuration.user_agent {
4514        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4515    }
4516    if let Some(ref apikey) = configuration.api_key {
4517        let key = apikey.key.clone();
4518        let value = match apikey.prefix {
4519            Some(ref prefix) => format!("{} {}", prefix, key),
4520            None => key,
4521        };
4522        req_builder = req_builder.header("x-api-key", value);
4523    };
4524
4525    let req = req_builder.build()?;
4526    let resp = configuration.client.execute(req).await?;
4527
4528    let status = resp.status();
4529    let content_type = resp
4530        .headers()
4531        .get("content-type")
4532        .and_then(|v| v.to_str().ok())
4533        .unwrap_or("application/octet-stream");
4534    let content_type = super::ContentType::from(content_type);
4535
4536    if !status.is_client_error() && !status.is_server_error() {
4537        let content = resp.text().await?;
4538        match content_type {
4539            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4540            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetNotificationCountResponse`"))),
4541            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::GetNotificationCountResponse`")))),
4542        }
4543    } else {
4544        let content = resp.text().await?;
4545        let entity: Option<GetNotificationCountError> = serde_json::from_str(&content).ok();
4546        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4547    }
4548}
4549
4550pub async fn get_notifications(configuration: &configuration::Configuration, params: GetNotificationsParams) -> Result<models::GetNotificationsResponse, Error<GetNotificationsError>> {
4551
4552    let uri_str = format!("{}/api/v1/notifications", configuration.base_path);
4553    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4554
4555    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4556    if let Some(ref param_value) = params.user_id {
4557        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
4558    }
4559    if let Some(ref param_value) = params.url_id {
4560        req_builder = req_builder.query(&[("urlId", &param_value.to_string())]);
4561    }
4562    if let Some(ref param_value) = params.from_comment_id {
4563        req_builder = req_builder.query(&[("fromCommentId", &param_value.to_string())]);
4564    }
4565    if let Some(ref param_value) = params.viewed {
4566        req_builder = req_builder.query(&[("viewed", &param_value.to_string())]);
4567    }
4568    if let Some(ref param_value) = params.r#type {
4569        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
4570    }
4571    if let Some(ref param_value) = params.skip {
4572        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
4573    }
4574    if let Some(ref user_agent) = configuration.user_agent {
4575        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4576    }
4577    if let Some(ref apikey) = configuration.api_key {
4578        let key = apikey.key.clone();
4579        let value = match apikey.prefix {
4580            Some(ref prefix) => format!("{} {}", prefix, key),
4581            None => key,
4582        };
4583        req_builder = req_builder.header("x-api-key", value);
4584    };
4585
4586    let req = req_builder.build()?;
4587    let resp = configuration.client.execute(req).await?;
4588
4589    let status = resp.status();
4590    let content_type = resp
4591        .headers()
4592        .get("content-type")
4593        .and_then(|v| v.to_str().ok())
4594        .unwrap_or("application/octet-stream");
4595    let content_type = super::ContentType::from(content_type);
4596
4597    if !status.is_client_error() && !status.is_server_error() {
4598        let content = resp.text().await?;
4599        match content_type {
4600            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4601            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetNotificationsResponse`"))),
4602            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::GetNotificationsResponse`")))),
4603        }
4604    } else {
4605        let content = resp.text().await?;
4606        let entity: Option<GetNotificationsError> = serde_json::from_str(&content).ok();
4607        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4608    }
4609}
4610
4611pub async fn get_page_by_urlid(configuration: &configuration::Configuration, params: GetPageByUrlidParams) -> Result<models::GetPageByUrlidApiResponse, Error<GetPageByUrlidError>> {
4612
4613    let uri_str = format!("{}/api/v1/pages/by-url-id", configuration.base_path);
4614    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4615
4616    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4617    req_builder = req_builder.query(&[("urlId", &params.url_id.to_string())]);
4618    if let Some(ref user_agent) = configuration.user_agent {
4619        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4620    }
4621    if let Some(ref apikey) = configuration.api_key {
4622        let key = apikey.key.clone();
4623        let value = match apikey.prefix {
4624            Some(ref prefix) => format!("{} {}", prefix, key),
4625            None => key,
4626        };
4627        req_builder = req_builder.header("x-api-key", value);
4628    };
4629
4630    let req = req_builder.build()?;
4631    let resp = configuration.client.execute(req).await?;
4632
4633    let status = resp.status();
4634    let content_type = resp
4635        .headers()
4636        .get("content-type")
4637        .and_then(|v| v.to_str().ok())
4638        .unwrap_or("application/octet-stream");
4639    let content_type = super::ContentType::from(content_type);
4640
4641    if !status.is_client_error() && !status.is_server_error() {
4642        let content = resp.text().await?;
4643        match content_type {
4644            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4645            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetPageByUrlidApiResponse`"))),
4646            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::GetPageByUrlidApiResponse`")))),
4647        }
4648    } else {
4649        let content = resp.text().await?;
4650        let entity: Option<GetPageByUrlidError> = serde_json::from_str(&content).ok();
4651        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4652    }
4653}
4654
4655pub async fn get_pages(configuration: &configuration::Configuration, params: GetPagesParams) -> Result<models::GetPagesApiResponse, Error<GetPagesError>> {
4656
4657    let uri_str = format!("{}/api/v1/pages", configuration.base_path);
4658    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4659
4660    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4661    if let Some(ref user_agent) = configuration.user_agent {
4662        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4663    }
4664    if let Some(ref apikey) = configuration.api_key {
4665        let key = apikey.key.clone();
4666        let value = match apikey.prefix {
4667            Some(ref prefix) => format!("{} {}", prefix, key),
4668            None => key,
4669        };
4670        req_builder = req_builder.header("x-api-key", value);
4671    };
4672
4673    let req = req_builder.build()?;
4674    let resp = configuration.client.execute(req).await?;
4675
4676    let status = resp.status();
4677    let content_type = resp
4678        .headers()
4679        .get("content-type")
4680        .and_then(|v| v.to_str().ok())
4681        .unwrap_or("application/octet-stream");
4682    let content_type = super::ContentType::from(content_type);
4683
4684    if !status.is_client_error() && !status.is_server_error() {
4685        let content = resp.text().await?;
4686        match content_type {
4687            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4688            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetPagesApiResponse`"))),
4689            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::GetPagesApiResponse`")))),
4690        }
4691    } else {
4692        let content = resp.text().await?;
4693        let entity: Option<GetPagesError> = serde_json::from_str(&content).ok();
4694        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4695    }
4696}
4697
4698pub async fn get_pending_webhook_event_count(configuration: &configuration::Configuration, params: GetPendingWebhookEventCountParams) -> Result<models::GetPendingWebhookEventCountResponse, Error<GetPendingWebhookEventCountError>> {
4699
4700    let uri_str = format!("{}/api/v1/pending-webhook-events/count", configuration.base_path);
4701    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4702
4703    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4704    if let Some(ref param_value) = params.comment_id {
4705        req_builder = req_builder.query(&[("commentId", &param_value.to_string())]);
4706    }
4707    if let Some(ref param_value) = params.external_id {
4708        req_builder = req_builder.query(&[("externalId", &param_value.to_string())]);
4709    }
4710    if let Some(ref param_value) = params.event_type {
4711        req_builder = req_builder.query(&[("eventType", &param_value.to_string())]);
4712    }
4713    if let Some(ref param_value) = params.r#type {
4714        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
4715    }
4716    if let Some(ref param_value) = params.domain {
4717        req_builder = req_builder.query(&[("domain", &param_value.to_string())]);
4718    }
4719    if let Some(ref param_value) = params.attempt_count_gt {
4720        req_builder = req_builder.query(&[("attemptCountGT", &param_value.to_string())]);
4721    }
4722    if let Some(ref user_agent) = configuration.user_agent {
4723        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4724    }
4725    if let Some(ref apikey) = configuration.api_key {
4726        let key = apikey.key.clone();
4727        let value = match apikey.prefix {
4728            Some(ref prefix) => format!("{} {}", prefix, key),
4729            None => key,
4730        };
4731        req_builder = req_builder.header("x-api-key", value);
4732    };
4733
4734    let req = req_builder.build()?;
4735    let resp = configuration.client.execute(req).await?;
4736
4737    let status = resp.status();
4738    let content_type = resp
4739        .headers()
4740        .get("content-type")
4741        .and_then(|v| v.to_str().ok())
4742        .unwrap_or("application/octet-stream");
4743    let content_type = super::ContentType::from(content_type);
4744
4745    if !status.is_client_error() && !status.is_server_error() {
4746        let content = resp.text().await?;
4747        match content_type {
4748            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4749            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetPendingWebhookEventCountResponse`"))),
4750            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::GetPendingWebhookEventCountResponse`")))),
4751        }
4752    } else {
4753        let content = resp.text().await?;
4754        let entity: Option<GetPendingWebhookEventCountError> = serde_json::from_str(&content).ok();
4755        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4756    }
4757}
4758
4759pub async fn get_pending_webhook_events(configuration: &configuration::Configuration, params: GetPendingWebhookEventsParams) -> Result<models::GetPendingWebhookEventsResponse, Error<GetPendingWebhookEventsError>> {
4760
4761    let uri_str = format!("{}/api/v1/pending-webhook-events", configuration.base_path);
4762    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4763
4764    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4765    if let Some(ref param_value) = params.comment_id {
4766        req_builder = req_builder.query(&[("commentId", &param_value.to_string())]);
4767    }
4768    if let Some(ref param_value) = params.external_id {
4769        req_builder = req_builder.query(&[("externalId", &param_value.to_string())]);
4770    }
4771    if let Some(ref param_value) = params.event_type {
4772        req_builder = req_builder.query(&[("eventType", &param_value.to_string())]);
4773    }
4774    if let Some(ref param_value) = params.r#type {
4775        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
4776    }
4777    if let Some(ref param_value) = params.domain {
4778        req_builder = req_builder.query(&[("domain", &param_value.to_string())]);
4779    }
4780    if let Some(ref param_value) = params.attempt_count_gt {
4781        req_builder = req_builder.query(&[("attemptCountGT", &param_value.to_string())]);
4782    }
4783    if let Some(ref param_value) = params.skip {
4784        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
4785    }
4786    if let Some(ref user_agent) = configuration.user_agent {
4787        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4788    }
4789    if let Some(ref apikey) = configuration.api_key {
4790        let key = apikey.key.clone();
4791        let value = match apikey.prefix {
4792            Some(ref prefix) => format!("{} {}", prefix, key),
4793            None => key,
4794        };
4795        req_builder = req_builder.header("x-api-key", value);
4796    };
4797
4798    let req = req_builder.build()?;
4799    let resp = configuration.client.execute(req).await?;
4800
4801    let status = resp.status();
4802    let content_type = resp
4803        .headers()
4804        .get("content-type")
4805        .and_then(|v| v.to_str().ok())
4806        .unwrap_or("application/octet-stream");
4807    let content_type = super::ContentType::from(content_type);
4808
4809    if !status.is_client_error() && !status.is_server_error() {
4810        let content = resp.text().await?;
4811        match content_type {
4812            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4813            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetPendingWebhookEventsResponse`"))),
4814            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::GetPendingWebhookEventsResponse`")))),
4815        }
4816    } else {
4817        let content = resp.text().await?;
4818        let entity: Option<GetPendingWebhookEventsError> = serde_json::from_str(&content).ok();
4819        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4820    }
4821}
4822
4823pub async fn get_question_config(configuration: &configuration::Configuration, params: GetQuestionConfigParams) -> Result<models::GetQuestionConfigResponse, Error<GetQuestionConfigError>> {
4824
4825    let uri_str = format!("{}/api/v1/question-configs/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
4826    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4827
4828    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4829    if let Some(ref user_agent) = configuration.user_agent {
4830        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4831    }
4832    if let Some(ref apikey) = configuration.api_key {
4833        let key = apikey.key.clone();
4834        let value = match apikey.prefix {
4835            Some(ref prefix) => format!("{} {}", prefix, key),
4836            None => key,
4837        };
4838        req_builder = req_builder.header("x-api-key", value);
4839    };
4840
4841    let req = req_builder.build()?;
4842    let resp = configuration.client.execute(req).await?;
4843
4844    let status = resp.status();
4845    let content_type = resp
4846        .headers()
4847        .get("content-type")
4848        .and_then(|v| v.to_str().ok())
4849        .unwrap_or("application/octet-stream");
4850    let content_type = super::ContentType::from(content_type);
4851
4852    if !status.is_client_error() && !status.is_server_error() {
4853        let content = resp.text().await?;
4854        match content_type {
4855            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4856            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetQuestionConfigResponse`"))),
4857            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::GetQuestionConfigResponse`")))),
4858        }
4859    } else {
4860        let content = resp.text().await?;
4861        let entity: Option<GetQuestionConfigError> = serde_json::from_str(&content).ok();
4862        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4863    }
4864}
4865
4866pub async fn get_question_configs(configuration: &configuration::Configuration, params: GetQuestionConfigsParams) -> Result<models::GetQuestionConfigsResponse, Error<GetQuestionConfigsError>> {
4867
4868    let uri_str = format!("{}/api/v1/question-configs", configuration.base_path);
4869    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4870
4871    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4872    if let Some(ref param_value) = params.skip {
4873        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
4874    }
4875    if let Some(ref user_agent) = configuration.user_agent {
4876        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4877    }
4878    if let Some(ref apikey) = configuration.api_key {
4879        let key = apikey.key.clone();
4880        let value = match apikey.prefix {
4881            Some(ref prefix) => format!("{} {}", prefix, key),
4882            None => key,
4883        };
4884        req_builder = req_builder.header("x-api-key", value);
4885    };
4886
4887    let req = req_builder.build()?;
4888    let resp = configuration.client.execute(req).await?;
4889
4890    let status = resp.status();
4891    let content_type = resp
4892        .headers()
4893        .get("content-type")
4894        .and_then(|v| v.to_str().ok())
4895        .unwrap_or("application/octet-stream");
4896    let content_type = super::ContentType::from(content_type);
4897
4898    if !status.is_client_error() && !status.is_server_error() {
4899        let content = resp.text().await?;
4900        match content_type {
4901            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4902            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetQuestionConfigsResponse`"))),
4903            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::GetQuestionConfigsResponse`")))),
4904        }
4905    } else {
4906        let content = resp.text().await?;
4907        let entity: Option<GetQuestionConfigsError> = serde_json::from_str(&content).ok();
4908        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4909    }
4910}
4911
4912pub async fn get_question_result(configuration: &configuration::Configuration, params: GetQuestionResultParams) -> Result<models::GetQuestionResultResponse, Error<GetQuestionResultError>> {
4913
4914    let uri_str = format!("{}/api/v1/question-results/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
4915    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4916
4917    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4918    if let Some(ref user_agent) = configuration.user_agent {
4919        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4920    }
4921    if let Some(ref apikey) = configuration.api_key {
4922        let key = apikey.key.clone();
4923        let value = match apikey.prefix {
4924            Some(ref prefix) => format!("{} {}", prefix, key),
4925            None => key,
4926        };
4927        req_builder = req_builder.header("x-api-key", value);
4928    };
4929
4930    let req = req_builder.build()?;
4931    let resp = configuration.client.execute(req).await?;
4932
4933    let status = resp.status();
4934    let content_type = resp
4935        .headers()
4936        .get("content-type")
4937        .and_then(|v| v.to_str().ok())
4938        .unwrap_or("application/octet-stream");
4939    let content_type = super::ContentType::from(content_type);
4940
4941    if !status.is_client_error() && !status.is_server_error() {
4942        let content = resp.text().await?;
4943        match content_type {
4944            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4945            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetQuestionResultResponse`"))),
4946            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::GetQuestionResultResponse`")))),
4947        }
4948    } else {
4949        let content = resp.text().await?;
4950        let entity: Option<GetQuestionResultError> = serde_json::from_str(&content).ok();
4951        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4952    }
4953}
4954
4955pub async fn get_question_results(configuration: &configuration::Configuration, params: GetQuestionResultsParams) -> Result<models::GetQuestionResultsResponse, Error<GetQuestionResultsError>> {
4956
4957    let uri_str = format!("{}/api/v1/question-results", configuration.base_path);
4958    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4959
4960    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
4961    if let Some(ref param_value) = params.url_id {
4962        req_builder = req_builder.query(&[("urlId", &param_value.to_string())]);
4963    }
4964    if let Some(ref param_value) = params.user_id {
4965        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
4966    }
4967    if let Some(ref param_value) = params.start_date {
4968        req_builder = req_builder.query(&[("startDate", &param_value.to_string())]);
4969    }
4970    if let Some(ref param_value) = params.question_id {
4971        req_builder = req_builder.query(&[("questionId", &param_value.to_string())]);
4972    }
4973    if let Some(ref param_value) = params.question_ids {
4974        req_builder = req_builder.query(&[("questionIds", &param_value.to_string())]);
4975    }
4976    if let Some(ref param_value) = params.skip {
4977        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
4978    }
4979    if let Some(ref user_agent) = configuration.user_agent {
4980        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4981    }
4982    if let Some(ref apikey) = configuration.api_key {
4983        let key = apikey.key.clone();
4984        let value = match apikey.prefix {
4985            Some(ref prefix) => format!("{} {}", prefix, key),
4986            None => key,
4987        };
4988        req_builder = req_builder.header("x-api-key", value);
4989    };
4990
4991    let req = req_builder.build()?;
4992    let resp = configuration.client.execute(req).await?;
4993
4994    let status = resp.status();
4995    let content_type = resp
4996        .headers()
4997        .get("content-type")
4998        .and_then(|v| v.to_str().ok())
4999        .unwrap_or("application/octet-stream");
5000    let content_type = super::ContentType::from(content_type);
5001
5002    if !status.is_client_error() && !status.is_server_error() {
5003        let content = resp.text().await?;
5004        match content_type {
5005            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5006            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetQuestionResultsResponse`"))),
5007            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::GetQuestionResultsResponse`")))),
5008        }
5009    } else {
5010        let content = resp.text().await?;
5011        let entity: Option<GetQuestionResultsError> = serde_json::from_str(&content).ok();
5012        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5013    }
5014}
5015
5016pub async fn get_sso_user_by_email(configuration: &configuration::Configuration, params: GetSsoUserByEmailParams) -> Result<models::GetSsoUserByEmailApiResponse, Error<GetSsoUserByEmailError>> {
5017
5018    let uri_str = format!("{}/api/v1/sso-users/by-email/{email}", configuration.base_path, email=crate::client::apis::urlencode(params.email));
5019    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5020
5021    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5022    if let Some(ref user_agent) = configuration.user_agent {
5023        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5024    }
5025    if let Some(ref apikey) = configuration.api_key {
5026        let key = apikey.key.clone();
5027        let value = match apikey.prefix {
5028            Some(ref prefix) => format!("{} {}", prefix, key),
5029            None => key,
5030        };
5031        req_builder = req_builder.header("x-api-key", value);
5032    };
5033
5034    let req = req_builder.build()?;
5035    let resp = configuration.client.execute(req).await?;
5036
5037    let status = resp.status();
5038    let content_type = resp
5039        .headers()
5040        .get("content-type")
5041        .and_then(|v| v.to_str().ok())
5042        .unwrap_or("application/octet-stream");
5043    let content_type = super::ContentType::from(content_type);
5044
5045    if !status.is_client_error() && !status.is_server_error() {
5046        let content = resp.text().await?;
5047        match content_type {
5048            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5049            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetSsoUserByEmailApiResponse`"))),
5050            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::GetSsoUserByEmailApiResponse`")))),
5051        }
5052    } else {
5053        let content = resp.text().await?;
5054        let entity: Option<GetSsoUserByEmailError> = serde_json::from_str(&content).ok();
5055        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5056    }
5057}
5058
5059pub async fn get_sso_user_by_id(configuration: &configuration::Configuration, params: GetSsoUserByIdParams) -> Result<models::GetSsoUserByIdApiResponse, Error<GetSsoUserByIdError>> {
5060
5061    let uri_str = format!("{}/api/v1/sso-users/by-id/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
5062    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5063
5064    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5065    if let Some(ref user_agent) = configuration.user_agent {
5066        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5067    }
5068    if let Some(ref apikey) = configuration.api_key {
5069        let key = apikey.key.clone();
5070        let value = match apikey.prefix {
5071            Some(ref prefix) => format!("{} {}", prefix, key),
5072            None => key,
5073        };
5074        req_builder = req_builder.header("x-api-key", value);
5075    };
5076
5077    let req = req_builder.build()?;
5078    let resp = configuration.client.execute(req).await?;
5079
5080    let status = resp.status();
5081    let content_type = resp
5082        .headers()
5083        .get("content-type")
5084        .and_then(|v| v.to_str().ok())
5085        .unwrap_or("application/octet-stream");
5086    let content_type = super::ContentType::from(content_type);
5087
5088    if !status.is_client_error() && !status.is_server_error() {
5089        let content = resp.text().await?;
5090        match content_type {
5091            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5092            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetSsoUserByIdApiResponse`"))),
5093            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::GetSsoUserByIdApiResponse`")))),
5094        }
5095    } else {
5096        let content = resp.text().await?;
5097        let entity: Option<GetSsoUserByIdError> = serde_json::from_str(&content).ok();
5098        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5099    }
5100}
5101
5102pub async fn get_sso_users(configuration: &configuration::Configuration, params: GetSsoUsersParams) -> Result<models::GetSsoUsersResponse, Error<GetSsoUsersError>> {
5103
5104    let uri_str = format!("{}/api/v1/sso-users", configuration.base_path);
5105    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5106
5107    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5108    if let Some(ref param_value) = params.skip {
5109        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
5110    }
5111    if let Some(ref user_agent) = configuration.user_agent {
5112        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5113    }
5114    if let Some(ref apikey) = configuration.api_key {
5115        let key = apikey.key.clone();
5116        let value = match apikey.prefix {
5117            Some(ref prefix) => format!("{} {}", prefix, key),
5118            None => key,
5119        };
5120        req_builder = req_builder.header("x-api-key", value);
5121    };
5122
5123    let req = req_builder.build()?;
5124    let resp = configuration.client.execute(req).await?;
5125
5126    let status = resp.status();
5127    let content_type = resp
5128        .headers()
5129        .get("content-type")
5130        .and_then(|v| v.to_str().ok())
5131        .unwrap_or("application/octet-stream");
5132    let content_type = super::ContentType::from(content_type);
5133
5134    if !status.is_client_error() && !status.is_server_error() {
5135        let content = resp.text().await?;
5136        match content_type {
5137            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5138            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetSsoUsersResponse`"))),
5139            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::GetSsoUsersResponse`")))),
5140        }
5141    } else {
5142        let content = resp.text().await?;
5143        let entity: Option<GetSsoUsersError> = serde_json::from_str(&content).ok();
5144        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5145    }
5146}
5147
5148pub async fn get_subscriptions(configuration: &configuration::Configuration, params: GetSubscriptionsParams) -> Result<models::GetSubscriptionsApiResponse, Error<GetSubscriptionsError>> {
5149
5150    let uri_str = format!("{}/api/v1/subscriptions", configuration.base_path);
5151    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5152
5153    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5154    if let Some(ref param_value) = params.user_id {
5155        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
5156    }
5157    if let Some(ref user_agent) = configuration.user_agent {
5158        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5159    }
5160    if let Some(ref apikey) = configuration.api_key {
5161        let key = apikey.key.clone();
5162        let value = match apikey.prefix {
5163            Some(ref prefix) => format!("{} {}", prefix, key),
5164            None => key,
5165        };
5166        req_builder = req_builder.header("x-api-key", value);
5167    };
5168
5169    let req = req_builder.build()?;
5170    let resp = configuration.client.execute(req).await?;
5171
5172    let status = resp.status();
5173    let content_type = resp
5174        .headers()
5175        .get("content-type")
5176        .and_then(|v| v.to_str().ok())
5177        .unwrap_or("application/octet-stream");
5178    let content_type = super::ContentType::from(content_type);
5179
5180    if !status.is_client_error() && !status.is_server_error() {
5181        let content = resp.text().await?;
5182        match content_type {
5183            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5184            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetSubscriptionsApiResponse`"))),
5185            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::GetSubscriptionsApiResponse`")))),
5186        }
5187    } else {
5188        let content = resp.text().await?;
5189        let entity: Option<GetSubscriptionsError> = serde_json::from_str(&content).ok();
5190        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5191    }
5192}
5193
5194pub async fn get_tenant(configuration: &configuration::Configuration, params: GetTenantParams) -> Result<models::GetTenantResponse, Error<GetTenantError>> {
5195
5196    let uri_str = format!("{}/api/v1/tenants/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
5197    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5198
5199    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5200    if let Some(ref user_agent) = configuration.user_agent {
5201        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5202    }
5203    if let Some(ref apikey) = configuration.api_key {
5204        let key = apikey.key.clone();
5205        let value = match apikey.prefix {
5206            Some(ref prefix) => format!("{} {}", prefix, key),
5207            None => key,
5208        };
5209        req_builder = req_builder.header("x-api-key", value);
5210    };
5211
5212    let req = req_builder.build()?;
5213    let resp = configuration.client.execute(req).await?;
5214
5215    let status = resp.status();
5216    let content_type = resp
5217        .headers()
5218        .get("content-type")
5219        .and_then(|v| v.to_str().ok())
5220        .unwrap_or("application/octet-stream");
5221    let content_type = super::ContentType::from(content_type);
5222
5223    if !status.is_client_error() && !status.is_server_error() {
5224        let content = resp.text().await?;
5225        match content_type {
5226            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5227            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTenantResponse`"))),
5228            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::GetTenantResponse`")))),
5229        }
5230    } else {
5231        let content = resp.text().await?;
5232        let entity: Option<GetTenantError> = serde_json::from_str(&content).ok();
5233        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5234    }
5235}
5236
5237pub async fn get_tenant_daily_usages(configuration: &configuration::Configuration, params: GetTenantDailyUsagesParams) -> Result<models::GetTenantDailyUsagesResponse, Error<GetTenantDailyUsagesError>> {
5238
5239    let uri_str = format!("{}/api/v1/tenant-daily-usage", configuration.base_path);
5240    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5241
5242    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5243    if let Some(ref param_value) = params.year_number {
5244        req_builder = req_builder.query(&[("yearNumber", &param_value.to_string())]);
5245    }
5246    if let Some(ref param_value) = params.month_number {
5247        req_builder = req_builder.query(&[("monthNumber", &param_value.to_string())]);
5248    }
5249    if let Some(ref param_value) = params.day_number {
5250        req_builder = req_builder.query(&[("dayNumber", &param_value.to_string())]);
5251    }
5252    if let Some(ref param_value) = params.skip {
5253        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
5254    }
5255    if let Some(ref user_agent) = configuration.user_agent {
5256        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5257    }
5258    if let Some(ref apikey) = configuration.api_key {
5259        let key = apikey.key.clone();
5260        let value = match apikey.prefix {
5261            Some(ref prefix) => format!("{} {}", prefix, key),
5262            None => key,
5263        };
5264        req_builder = req_builder.header("x-api-key", value);
5265    };
5266
5267    let req = req_builder.build()?;
5268    let resp = configuration.client.execute(req).await?;
5269
5270    let status = resp.status();
5271    let content_type = resp
5272        .headers()
5273        .get("content-type")
5274        .and_then(|v| v.to_str().ok())
5275        .unwrap_or("application/octet-stream");
5276    let content_type = super::ContentType::from(content_type);
5277
5278    if !status.is_client_error() && !status.is_server_error() {
5279        let content = resp.text().await?;
5280        match content_type {
5281            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5282            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTenantDailyUsagesResponse`"))),
5283            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::GetTenantDailyUsagesResponse`")))),
5284        }
5285    } else {
5286        let content = resp.text().await?;
5287        let entity: Option<GetTenantDailyUsagesError> = serde_json::from_str(&content).ok();
5288        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5289    }
5290}
5291
5292pub async fn get_tenant_package(configuration: &configuration::Configuration, params: GetTenantPackageParams) -> Result<models::GetTenantPackageResponse, Error<GetTenantPackageError>> {
5293
5294    let uri_str = format!("{}/api/v1/tenant-packages/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
5295    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5296
5297    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5298    if let Some(ref user_agent) = configuration.user_agent {
5299        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5300    }
5301    if let Some(ref apikey) = configuration.api_key {
5302        let key = apikey.key.clone();
5303        let value = match apikey.prefix {
5304            Some(ref prefix) => format!("{} {}", prefix, key),
5305            None => key,
5306        };
5307        req_builder = req_builder.header("x-api-key", value);
5308    };
5309
5310    let req = req_builder.build()?;
5311    let resp = configuration.client.execute(req).await?;
5312
5313    let status = resp.status();
5314    let content_type = resp
5315        .headers()
5316        .get("content-type")
5317        .and_then(|v| v.to_str().ok())
5318        .unwrap_or("application/octet-stream");
5319    let content_type = super::ContentType::from(content_type);
5320
5321    if !status.is_client_error() && !status.is_server_error() {
5322        let content = resp.text().await?;
5323        match content_type {
5324            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5325            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTenantPackageResponse`"))),
5326            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::GetTenantPackageResponse`")))),
5327        }
5328    } else {
5329        let content = resp.text().await?;
5330        let entity: Option<GetTenantPackageError> = serde_json::from_str(&content).ok();
5331        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5332    }
5333}
5334
5335pub async fn get_tenant_packages(configuration: &configuration::Configuration, params: GetTenantPackagesParams) -> Result<models::GetTenantPackagesResponse, Error<GetTenantPackagesError>> {
5336
5337    let uri_str = format!("{}/api/v1/tenant-packages", configuration.base_path);
5338    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5339
5340    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5341    if let Some(ref param_value) = params.skip {
5342        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
5343    }
5344    if let Some(ref user_agent) = configuration.user_agent {
5345        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5346    }
5347    if let Some(ref apikey) = configuration.api_key {
5348        let key = apikey.key.clone();
5349        let value = match apikey.prefix {
5350            Some(ref prefix) => format!("{} {}", prefix, key),
5351            None => key,
5352        };
5353        req_builder = req_builder.header("x-api-key", value);
5354    };
5355
5356    let req = req_builder.build()?;
5357    let resp = configuration.client.execute(req).await?;
5358
5359    let status = resp.status();
5360    let content_type = resp
5361        .headers()
5362        .get("content-type")
5363        .and_then(|v| v.to_str().ok())
5364        .unwrap_or("application/octet-stream");
5365    let content_type = super::ContentType::from(content_type);
5366
5367    if !status.is_client_error() && !status.is_server_error() {
5368        let content = resp.text().await?;
5369        match content_type {
5370            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5371            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTenantPackagesResponse`"))),
5372            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::GetTenantPackagesResponse`")))),
5373        }
5374    } else {
5375        let content = resp.text().await?;
5376        let entity: Option<GetTenantPackagesError> = serde_json::from_str(&content).ok();
5377        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5378    }
5379}
5380
5381pub async fn get_tenant_user(configuration: &configuration::Configuration, params: GetTenantUserParams) -> Result<models::GetTenantUserResponse, Error<GetTenantUserError>> {
5382
5383    let uri_str = format!("{}/api/v1/tenant-users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
5384    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5385
5386    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5387    if let Some(ref user_agent) = configuration.user_agent {
5388        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5389    }
5390    if let Some(ref apikey) = configuration.api_key {
5391        let key = apikey.key.clone();
5392        let value = match apikey.prefix {
5393            Some(ref prefix) => format!("{} {}", prefix, key),
5394            None => key,
5395        };
5396        req_builder = req_builder.header("x-api-key", value);
5397    };
5398
5399    let req = req_builder.build()?;
5400    let resp = configuration.client.execute(req).await?;
5401
5402    let status = resp.status();
5403    let content_type = resp
5404        .headers()
5405        .get("content-type")
5406        .and_then(|v| v.to_str().ok())
5407        .unwrap_or("application/octet-stream");
5408    let content_type = super::ContentType::from(content_type);
5409
5410    if !status.is_client_error() && !status.is_server_error() {
5411        let content = resp.text().await?;
5412        match content_type {
5413            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5414            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTenantUserResponse`"))),
5415            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::GetTenantUserResponse`")))),
5416        }
5417    } else {
5418        let content = resp.text().await?;
5419        let entity: Option<GetTenantUserError> = serde_json::from_str(&content).ok();
5420        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5421    }
5422}
5423
5424pub async fn get_tenant_users(configuration: &configuration::Configuration, params: GetTenantUsersParams) -> Result<models::GetTenantUsersResponse, Error<GetTenantUsersError>> {
5425
5426    let uri_str = format!("{}/api/v1/tenant-users", configuration.base_path);
5427    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5428
5429    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5430    if let Some(ref param_value) = params.skip {
5431        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
5432    }
5433    if let Some(ref user_agent) = configuration.user_agent {
5434        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5435    }
5436    if let Some(ref apikey) = configuration.api_key {
5437        let key = apikey.key.clone();
5438        let value = match apikey.prefix {
5439            Some(ref prefix) => format!("{} {}", prefix, key),
5440            None => key,
5441        };
5442        req_builder = req_builder.header("x-api-key", value);
5443    };
5444
5445    let req = req_builder.build()?;
5446    let resp = configuration.client.execute(req).await?;
5447
5448    let status = resp.status();
5449    let content_type = resp
5450        .headers()
5451        .get("content-type")
5452        .and_then(|v| v.to_str().ok())
5453        .unwrap_or("application/octet-stream");
5454    let content_type = super::ContentType::from(content_type);
5455
5456    if !status.is_client_error() && !status.is_server_error() {
5457        let content = resp.text().await?;
5458        match content_type {
5459            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5460            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTenantUsersResponse`"))),
5461            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::GetTenantUsersResponse`")))),
5462        }
5463    } else {
5464        let content = resp.text().await?;
5465        let entity: Option<GetTenantUsersError> = serde_json::from_str(&content).ok();
5466        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5467    }
5468}
5469
5470pub async fn get_tenants(configuration: &configuration::Configuration, params: GetTenantsParams) -> Result<models::GetTenantsResponse, Error<GetTenantsError>> {
5471
5472    let uri_str = format!("{}/api/v1/tenants", configuration.base_path);
5473    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5474
5475    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5476    if let Some(ref param_value) = params.meta {
5477        req_builder = req_builder.query(&[("meta", &param_value.to_string())]);
5478    }
5479    if let Some(ref param_value) = params.skip {
5480        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
5481    }
5482    if let Some(ref user_agent) = configuration.user_agent {
5483        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5484    }
5485    if let Some(ref apikey) = configuration.api_key {
5486        let key = apikey.key.clone();
5487        let value = match apikey.prefix {
5488            Some(ref prefix) => format!("{} {}", prefix, key),
5489            None => key,
5490        };
5491        req_builder = req_builder.header("x-api-key", value);
5492    };
5493
5494    let req = req_builder.build()?;
5495    let resp = configuration.client.execute(req).await?;
5496
5497    let status = resp.status();
5498    let content_type = resp
5499        .headers()
5500        .get("content-type")
5501        .and_then(|v| v.to_str().ok())
5502        .unwrap_or("application/octet-stream");
5503    let content_type = super::ContentType::from(content_type);
5504
5505    if !status.is_client_error() && !status.is_server_error() {
5506        let content = resp.text().await?;
5507        match content_type {
5508            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5509            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTenantsResponse`"))),
5510            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::GetTenantsResponse`")))),
5511        }
5512    } else {
5513        let content = resp.text().await?;
5514        let entity: Option<GetTenantsError> = serde_json::from_str(&content).ok();
5515        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5516    }
5517}
5518
5519pub async fn get_ticket(configuration: &configuration::Configuration, params: GetTicketParams) -> Result<models::GetTicketResponse, Error<GetTicketError>> {
5520
5521    let uri_str = format!("{}/api/v1/tickets/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
5522    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5523
5524    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5525    if let Some(ref param_value) = params.user_id {
5526        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
5527    }
5528    if let Some(ref user_agent) = configuration.user_agent {
5529        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5530    }
5531    if let Some(ref apikey) = configuration.api_key {
5532        let key = apikey.key.clone();
5533        let value = match apikey.prefix {
5534            Some(ref prefix) => format!("{} {}", prefix, key),
5535            None => key,
5536        };
5537        req_builder = req_builder.header("x-api-key", value);
5538    };
5539
5540    let req = req_builder.build()?;
5541    let resp = configuration.client.execute(req).await?;
5542
5543    let status = resp.status();
5544    let content_type = resp
5545        .headers()
5546        .get("content-type")
5547        .and_then(|v| v.to_str().ok())
5548        .unwrap_or("application/octet-stream");
5549    let content_type = super::ContentType::from(content_type);
5550
5551    if !status.is_client_error() && !status.is_server_error() {
5552        let content = resp.text().await?;
5553        match content_type {
5554            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5555            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTicketResponse`"))),
5556            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::GetTicketResponse`")))),
5557        }
5558    } else {
5559        let content = resp.text().await?;
5560        let entity: Option<GetTicketError> = serde_json::from_str(&content).ok();
5561        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5562    }
5563}
5564
5565pub async fn get_tickets(configuration: &configuration::Configuration, params: GetTicketsParams) -> Result<models::GetTicketsResponse, Error<GetTicketsError>> {
5566
5567    let uri_str = format!("{}/api/v1/tickets", configuration.base_path);
5568    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5569
5570    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5571    if let Some(ref param_value) = params.user_id {
5572        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
5573    }
5574    if let Some(ref param_value) = params.state {
5575        req_builder = req_builder.query(&[("state", &param_value.to_string())]);
5576    }
5577    if let Some(ref param_value) = params.skip {
5578        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
5579    }
5580    if let Some(ref param_value) = params.limit {
5581        req_builder = req_builder.query(&[("limit", &param_value.to_string())]);
5582    }
5583    if let Some(ref user_agent) = configuration.user_agent {
5584        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5585    }
5586    if let Some(ref apikey) = configuration.api_key {
5587        let key = apikey.key.clone();
5588        let value = match apikey.prefix {
5589            Some(ref prefix) => format!("{} {}", prefix, key),
5590            None => key,
5591        };
5592        req_builder = req_builder.header("x-api-key", value);
5593    };
5594
5595    let req = req_builder.build()?;
5596    let resp = configuration.client.execute(req).await?;
5597
5598    let status = resp.status();
5599    let content_type = resp
5600        .headers()
5601        .get("content-type")
5602        .and_then(|v| v.to_str().ok())
5603        .unwrap_or("application/octet-stream");
5604    let content_type = super::ContentType::from(content_type);
5605
5606    if !status.is_client_error() && !status.is_server_error() {
5607        let content = resp.text().await?;
5608        match content_type {
5609            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5610            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTicketsResponse`"))),
5611            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::GetTicketsResponse`")))),
5612        }
5613    } else {
5614        let content = resp.text().await?;
5615        let entity: Option<GetTicketsError> = serde_json::from_str(&content).ok();
5616        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5617    }
5618}
5619
5620pub async fn get_user(configuration: &configuration::Configuration, params: GetUserParams) -> Result<models::GetUserResponse, Error<GetUserError>> {
5621
5622    let uri_str = format!("{}/api/v1/users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
5623    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5624
5625    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5626    if let Some(ref user_agent) = configuration.user_agent {
5627        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5628    }
5629    if let Some(ref apikey) = configuration.api_key {
5630        let key = apikey.key.clone();
5631        let value = match apikey.prefix {
5632            Some(ref prefix) => format!("{} {}", prefix, key),
5633            None => key,
5634        };
5635        req_builder = req_builder.header("x-api-key", value);
5636    };
5637
5638    let req = req_builder.build()?;
5639    let resp = configuration.client.execute(req).await?;
5640
5641    let status = resp.status();
5642    let content_type = resp
5643        .headers()
5644        .get("content-type")
5645        .and_then(|v| v.to_str().ok())
5646        .unwrap_or("application/octet-stream");
5647    let content_type = super::ContentType::from(content_type);
5648
5649    if !status.is_client_error() && !status.is_server_error() {
5650        let content = resp.text().await?;
5651        match content_type {
5652            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5653            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetUserResponse`"))),
5654            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::GetUserResponse`")))),
5655        }
5656    } else {
5657        let content = resp.text().await?;
5658        let entity: Option<GetUserError> = serde_json::from_str(&content).ok();
5659        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5660    }
5661}
5662
5663pub async fn get_user_badge(configuration: &configuration::Configuration, params: GetUserBadgeParams) -> Result<models::ApiGetUserBadgeResponse, Error<GetUserBadgeError>> {
5664
5665    let uri_str = format!("{}/api/v1/user-badges/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
5666    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5667
5668    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5669    if let Some(ref user_agent) = configuration.user_agent {
5670        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5671    }
5672    if let Some(ref apikey) = configuration.api_key {
5673        let key = apikey.key.clone();
5674        let value = match apikey.prefix {
5675            Some(ref prefix) => format!("{} {}", prefix, key),
5676            None => key,
5677        };
5678        req_builder = req_builder.header("x-api-key", value);
5679    };
5680
5681    let req = req_builder.build()?;
5682    let resp = configuration.client.execute(req).await?;
5683
5684    let status = resp.status();
5685    let content_type = resp
5686        .headers()
5687        .get("content-type")
5688        .and_then(|v| v.to_str().ok())
5689        .unwrap_or("application/octet-stream");
5690    let content_type = super::ContentType::from(content_type);
5691
5692    if !status.is_client_error() && !status.is_server_error() {
5693        let content = resp.text().await?;
5694        match content_type {
5695            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5696            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiGetUserBadgeResponse`"))),
5697            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::ApiGetUserBadgeResponse`")))),
5698        }
5699    } else {
5700        let content = resp.text().await?;
5701        let entity: Option<GetUserBadgeError> = serde_json::from_str(&content).ok();
5702        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5703    }
5704}
5705
5706pub async fn get_user_badge_progress_by_id(configuration: &configuration::Configuration, params: GetUserBadgeProgressByIdParams) -> Result<models::ApiGetUserBadgeProgressResponse, Error<GetUserBadgeProgressByIdError>> {
5707
5708    let uri_str = format!("{}/api/v1/user-badge-progress/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
5709    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5710
5711    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5712    if let Some(ref user_agent) = configuration.user_agent {
5713        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5714    }
5715    if let Some(ref apikey) = configuration.api_key {
5716        let key = apikey.key.clone();
5717        let value = match apikey.prefix {
5718            Some(ref prefix) => format!("{} {}", prefix, key),
5719            None => key,
5720        };
5721        req_builder = req_builder.header("x-api-key", value);
5722    };
5723
5724    let req = req_builder.build()?;
5725    let resp = configuration.client.execute(req).await?;
5726
5727    let status = resp.status();
5728    let content_type = resp
5729        .headers()
5730        .get("content-type")
5731        .and_then(|v| v.to_str().ok())
5732        .unwrap_or("application/octet-stream");
5733    let content_type = super::ContentType::from(content_type);
5734
5735    if !status.is_client_error() && !status.is_server_error() {
5736        let content = resp.text().await?;
5737        match content_type {
5738            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5739            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiGetUserBadgeProgressResponse`"))),
5740            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::ApiGetUserBadgeProgressResponse`")))),
5741        }
5742    } else {
5743        let content = resp.text().await?;
5744        let entity: Option<GetUserBadgeProgressByIdError> = serde_json::from_str(&content).ok();
5745        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5746    }
5747}
5748
5749pub async fn get_user_badge_progress_by_user_id(configuration: &configuration::Configuration, params: GetUserBadgeProgressByUserIdParams) -> Result<models::ApiGetUserBadgeProgressResponse, Error<GetUserBadgeProgressByUserIdError>> {
5750
5751    let uri_str = format!("{}/api/v1/user-badge-progress/user/{userId}", configuration.base_path, userId=crate::client::apis::urlencode(params.user_id));
5752    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5753
5754    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5755    if let Some(ref user_agent) = configuration.user_agent {
5756        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5757    }
5758    if let Some(ref apikey) = configuration.api_key {
5759        let key = apikey.key.clone();
5760        let value = match apikey.prefix {
5761            Some(ref prefix) => format!("{} {}", prefix, key),
5762            None => key,
5763        };
5764        req_builder = req_builder.header("x-api-key", value);
5765    };
5766
5767    let req = req_builder.build()?;
5768    let resp = configuration.client.execute(req).await?;
5769
5770    let status = resp.status();
5771    let content_type = resp
5772        .headers()
5773        .get("content-type")
5774        .and_then(|v| v.to_str().ok())
5775        .unwrap_or("application/octet-stream");
5776    let content_type = super::ContentType::from(content_type);
5777
5778    if !status.is_client_error() && !status.is_server_error() {
5779        let content = resp.text().await?;
5780        match content_type {
5781            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5782            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiGetUserBadgeProgressResponse`"))),
5783            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::ApiGetUserBadgeProgressResponse`")))),
5784        }
5785    } else {
5786        let content = resp.text().await?;
5787        let entity: Option<GetUserBadgeProgressByUserIdError> = serde_json::from_str(&content).ok();
5788        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5789    }
5790}
5791
5792pub async fn get_user_badge_progress_list(configuration: &configuration::Configuration, params: GetUserBadgeProgressListParams) -> Result<models::ApiGetUserBadgeProgressListResponse, Error<GetUserBadgeProgressListError>> {
5793
5794    let uri_str = format!("{}/api/v1/user-badge-progress", configuration.base_path);
5795    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5796
5797    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5798    if let Some(ref param_value) = params.user_id {
5799        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
5800    }
5801    if let Some(ref param_value) = params.limit {
5802        req_builder = req_builder.query(&[("limit", &param_value.to_string())]);
5803    }
5804    if let Some(ref param_value) = params.skip {
5805        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
5806    }
5807    if let Some(ref user_agent) = configuration.user_agent {
5808        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5809    }
5810    if let Some(ref apikey) = configuration.api_key {
5811        let key = apikey.key.clone();
5812        let value = match apikey.prefix {
5813            Some(ref prefix) => format!("{} {}", prefix, key),
5814            None => key,
5815        };
5816        req_builder = req_builder.header("x-api-key", value);
5817    };
5818
5819    let req = req_builder.build()?;
5820    let resp = configuration.client.execute(req).await?;
5821
5822    let status = resp.status();
5823    let content_type = resp
5824        .headers()
5825        .get("content-type")
5826        .and_then(|v| v.to_str().ok())
5827        .unwrap_or("application/octet-stream");
5828    let content_type = super::ContentType::from(content_type);
5829
5830    if !status.is_client_error() && !status.is_server_error() {
5831        let content = resp.text().await?;
5832        match content_type {
5833            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5834            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiGetUserBadgeProgressListResponse`"))),
5835            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::ApiGetUserBadgeProgressListResponse`")))),
5836        }
5837    } else {
5838        let content = resp.text().await?;
5839        let entity: Option<GetUserBadgeProgressListError> = serde_json::from_str(&content).ok();
5840        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5841    }
5842}
5843
5844pub async fn get_user_badges(configuration: &configuration::Configuration, params: GetUserBadgesParams) -> Result<models::ApiGetUserBadgesResponse, Error<GetUserBadgesError>> {
5845
5846    let uri_str = format!("{}/api/v1/user-badges", configuration.base_path);
5847    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5848
5849    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5850    if let Some(ref param_value) = params.user_id {
5851        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
5852    }
5853    if let Some(ref param_value) = params.badge_id {
5854        req_builder = req_builder.query(&[("badgeId", &param_value.to_string())]);
5855    }
5856    if let Some(ref param_value) = params.r#type {
5857        req_builder = req_builder.query(&[("type", &param_value.to_string())]);
5858    }
5859    if let Some(ref param_value) = params.displayed_on_comments {
5860        req_builder = req_builder.query(&[("displayedOnComments", &param_value.to_string())]);
5861    }
5862    if let Some(ref param_value) = params.limit {
5863        req_builder = req_builder.query(&[("limit", &param_value.to_string())]);
5864    }
5865    if let Some(ref param_value) = params.skip {
5866        req_builder = req_builder.query(&[("skip", &param_value.to_string())]);
5867    }
5868    if let Some(ref user_agent) = configuration.user_agent {
5869        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5870    }
5871    if let Some(ref apikey) = configuration.api_key {
5872        let key = apikey.key.clone();
5873        let value = match apikey.prefix {
5874            Some(ref prefix) => format!("{} {}", prefix, key),
5875            None => key,
5876        };
5877        req_builder = req_builder.header("x-api-key", value);
5878    };
5879
5880    let req = req_builder.build()?;
5881    let resp = configuration.client.execute(req).await?;
5882
5883    let status = resp.status();
5884    let content_type = resp
5885        .headers()
5886        .get("content-type")
5887        .and_then(|v| v.to_str().ok())
5888        .unwrap_or("application/octet-stream");
5889    let content_type = super::ContentType::from(content_type);
5890
5891    if !status.is_client_error() && !status.is_server_error() {
5892        let content = resp.text().await?;
5893        match content_type {
5894            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5895            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiGetUserBadgesResponse`"))),
5896            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::ApiGetUserBadgesResponse`")))),
5897        }
5898    } else {
5899        let content = resp.text().await?;
5900        let entity: Option<GetUserBadgesError> = serde_json::from_str(&content).ok();
5901        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5902    }
5903}
5904
5905pub async fn get_votes(configuration: &configuration::Configuration, params: GetVotesParams) -> Result<models::GetVotesResponse, Error<GetVotesError>> {
5906
5907    let uri_str = format!("{}/api/v1/votes", configuration.base_path);
5908    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5909
5910    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5911    req_builder = req_builder.query(&[("urlId", &params.url_id.to_string())]);
5912    if let Some(ref user_agent) = configuration.user_agent {
5913        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5914    }
5915    if let Some(ref apikey) = configuration.api_key {
5916        let key = apikey.key.clone();
5917        let value = match apikey.prefix {
5918            Some(ref prefix) => format!("{} {}", prefix, key),
5919            None => key,
5920        };
5921        req_builder = req_builder.header("x-api-key", value);
5922    };
5923
5924    let req = req_builder.build()?;
5925    let resp = configuration.client.execute(req).await?;
5926
5927    let status = resp.status();
5928    let content_type = resp
5929        .headers()
5930        .get("content-type")
5931        .and_then(|v| v.to_str().ok())
5932        .unwrap_or("application/octet-stream");
5933    let content_type = super::ContentType::from(content_type);
5934
5935    if !status.is_client_error() && !status.is_server_error() {
5936        let content = resp.text().await?;
5937        match content_type {
5938            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5939            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetVotesResponse`"))),
5940            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::GetVotesResponse`")))),
5941        }
5942    } else {
5943        let content = resp.text().await?;
5944        let entity: Option<GetVotesError> = serde_json::from_str(&content).ok();
5945        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5946    }
5947}
5948
5949pub async fn get_votes_for_user(configuration: &configuration::Configuration, params: GetVotesForUserParams) -> Result<models::GetVotesForUserResponse, Error<GetVotesForUserError>> {
5950
5951    let uri_str = format!("{}/api/v1/votes/for-user", configuration.base_path);
5952    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5953
5954    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
5955    req_builder = req_builder.query(&[("urlId", &params.url_id.to_string())]);
5956    if let Some(ref param_value) = params.user_id {
5957        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
5958    }
5959    if let Some(ref param_value) = params.anon_user_id {
5960        req_builder = req_builder.query(&[("anonUserId", &param_value.to_string())]);
5961    }
5962    if let Some(ref user_agent) = configuration.user_agent {
5963        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5964    }
5965    if let Some(ref apikey) = configuration.api_key {
5966        let key = apikey.key.clone();
5967        let value = match apikey.prefix {
5968            Some(ref prefix) => format!("{} {}", prefix, key),
5969            None => key,
5970        };
5971        req_builder = req_builder.header("x-api-key", value);
5972    };
5973
5974    let req = req_builder.build()?;
5975    let resp = configuration.client.execute(req).await?;
5976
5977    let status = resp.status();
5978    let content_type = resp
5979        .headers()
5980        .get("content-type")
5981        .and_then(|v| v.to_str().ok())
5982        .unwrap_or("application/octet-stream");
5983    let content_type = super::ContentType::from(content_type);
5984
5985    if !status.is_client_error() && !status.is_server_error() {
5986        let content = resp.text().await?;
5987        match content_type {
5988            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5989            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetVotesForUserResponse`"))),
5990            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::GetVotesForUserResponse`")))),
5991        }
5992    } else {
5993        let content = resp.text().await?;
5994        let entity: Option<GetVotesForUserError> = serde_json::from_str(&content).ok();
5995        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5996    }
5997}
5998
5999pub async fn patch_domain_config(configuration: &configuration::Configuration, params: PatchDomainConfigParams) -> Result<models::PatchDomainConfigResponse, Error<PatchDomainConfigError>> {
6000
6001    let uri_str = format!("{}/api/v1/domain-configs/{domainToUpdate}", configuration.base_path, domainToUpdate=crate::client::apis::urlencode(params.domain_to_update));
6002    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6003
6004    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6005    if let Some(ref user_agent) = configuration.user_agent {
6006        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6007    }
6008    if let Some(ref apikey) = configuration.api_key {
6009        let key = apikey.key.clone();
6010        let value = match apikey.prefix {
6011            Some(ref prefix) => format!("{} {}", prefix, key),
6012            None => key,
6013        };
6014        req_builder = req_builder.header("x-api-key", value);
6015    };
6016    req_builder = req_builder.json(&params.patch_domain_config_params);
6017
6018    let req = req_builder.build()?;
6019    let resp = configuration.client.execute(req).await?;
6020
6021    let status = resp.status();
6022    let content_type = resp
6023        .headers()
6024        .get("content-type")
6025        .and_then(|v| v.to_str().ok())
6026        .unwrap_or("application/octet-stream");
6027    let content_type = super::ContentType::from(content_type);
6028
6029    if !status.is_client_error() && !status.is_server_error() {
6030        let content = resp.text().await?;
6031        match content_type {
6032            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6033            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PatchDomainConfigResponse`"))),
6034            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::PatchDomainConfigResponse`")))),
6035        }
6036    } else {
6037        let content = resp.text().await?;
6038        let entity: Option<PatchDomainConfigError> = serde_json::from_str(&content).ok();
6039        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6040    }
6041}
6042
6043pub async fn patch_hash_tag(configuration: &configuration::Configuration, params: PatchHashTagParams) -> Result<models::UpdateHashTagResponse, Error<PatchHashTagError>> {
6044
6045    let uri_str = format!("{}/api/v1/hash-tags/{tag}", configuration.base_path, tag=crate::client::apis::urlencode(params.tag));
6046    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6047
6048    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6049    if let Some(ref user_agent) = configuration.user_agent {
6050        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6051    }
6052    if let Some(ref apikey) = configuration.api_key {
6053        let key = apikey.key.clone();
6054        let value = match apikey.prefix {
6055            Some(ref prefix) => format!("{} {}", prefix, key),
6056            None => key,
6057        };
6058        req_builder = req_builder.header("x-api-key", value);
6059    };
6060    req_builder = req_builder.json(&params.update_hash_tag_body);
6061
6062    let req = req_builder.build()?;
6063    let resp = configuration.client.execute(req).await?;
6064
6065    let status = resp.status();
6066    let content_type = resp
6067        .headers()
6068        .get("content-type")
6069        .and_then(|v| v.to_str().ok())
6070        .unwrap_or("application/octet-stream");
6071    let content_type = super::ContentType::from(content_type);
6072
6073    if !status.is_client_error() && !status.is_server_error() {
6074        let content = resp.text().await?;
6075        match content_type {
6076            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6077            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UpdateHashTagResponse`"))),
6078            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::UpdateHashTagResponse`")))),
6079        }
6080    } else {
6081        let content = resp.text().await?;
6082        let entity: Option<PatchHashTagError> = serde_json::from_str(&content).ok();
6083        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6084    }
6085}
6086
6087pub async fn patch_page(configuration: &configuration::Configuration, params: PatchPageParams) -> Result<models::PatchPageApiResponse, Error<PatchPageError>> {
6088
6089    let uri_str = format!("{}/api/v1/pages/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
6090    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6091
6092    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6093    if let Some(ref user_agent) = configuration.user_agent {
6094        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6095    }
6096    if let Some(ref apikey) = configuration.api_key {
6097        let key = apikey.key.clone();
6098        let value = match apikey.prefix {
6099            Some(ref prefix) => format!("{} {}", prefix, key),
6100            None => key,
6101        };
6102        req_builder = req_builder.header("x-api-key", value);
6103    };
6104    req_builder = req_builder.json(&params.update_api_page_data);
6105
6106    let req = req_builder.build()?;
6107    let resp = configuration.client.execute(req).await?;
6108
6109    let status = resp.status();
6110    let content_type = resp
6111        .headers()
6112        .get("content-type")
6113        .and_then(|v| v.to_str().ok())
6114        .unwrap_or("application/octet-stream");
6115    let content_type = super::ContentType::from(content_type);
6116
6117    if !status.is_client_error() && !status.is_server_error() {
6118        let content = resp.text().await?;
6119        match content_type {
6120            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6121            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PatchPageApiResponse`"))),
6122            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::PatchPageApiResponse`")))),
6123        }
6124    } else {
6125        let content = resp.text().await?;
6126        let entity: Option<PatchPageError> = serde_json::from_str(&content).ok();
6127        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6128    }
6129}
6130
6131pub async fn patch_sso_user(configuration: &configuration::Configuration, params: PatchSsoUserParams) -> Result<models::PatchSsoUserApiResponse, Error<PatchSsoUserError>> {
6132
6133    let uri_str = format!("{}/api/v1/sso-users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
6134    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6135
6136    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6137    if let Some(ref param_value) = params.update_comments {
6138        req_builder = req_builder.query(&[("updateComments", &param_value.to_string())]);
6139    }
6140    if let Some(ref user_agent) = configuration.user_agent {
6141        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6142    }
6143    if let Some(ref apikey) = configuration.api_key {
6144        let key = apikey.key.clone();
6145        let value = match apikey.prefix {
6146            Some(ref prefix) => format!("{} {}", prefix, key),
6147            None => key,
6148        };
6149        req_builder = req_builder.header("x-api-key", value);
6150    };
6151    req_builder = req_builder.json(&params.update_apisso_user_data);
6152
6153    let req = req_builder.build()?;
6154    let resp = configuration.client.execute(req).await?;
6155
6156    let status = resp.status();
6157    let content_type = resp
6158        .headers()
6159        .get("content-type")
6160        .and_then(|v| v.to_str().ok())
6161        .unwrap_or("application/octet-stream");
6162    let content_type = super::ContentType::from(content_type);
6163
6164    if !status.is_client_error() && !status.is_server_error() {
6165        let content = resp.text().await?;
6166        match content_type {
6167            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6168            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PatchSsoUserApiResponse`"))),
6169            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::PatchSsoUserApiResponse`")))),
6170        }
6171    } else {
6172        let content = resp.text().await?;
6173        let entity: Option<PatchSsoUserError> = serde_json::from_str(&content).ok();
6174        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6175    }
6176}
6177
6178pub async fn put_domain_config(configuration: &configuration::Configuration, params: PutDomainConfigParams) -> Result<models::PutDomainConfigResponse, Error<PutDomainConfigError>> {
6179
6180    let uri_str = format!("{}/api/v1/domain-configs/{domainToUpdate}", configuration.base_path, domainToUpdate=crate::client::apis::urlencode(params.domain_to_update));
6181    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6182
6183    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6184    if let Some(ref user_agent) = configuration.user_agent {
6185        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6186    }
6187    if let Some(ref apikey) = configuration.api_key {
6188        let key = apikey.key.clone();
6189        let value = match apikey.prefix {
6190            Some(ref prefix) => format!("{} {}", prefix, key),
6191            None => key,
6192        };
6193        req_builder = req_builder.header("x-api-key", value);
6194    };
6195    req_builder = req_builder.json(&params.update_domain_config_params);
6196
6197    let req = req_builder.build()?;
6198    let resp = configuration.client.execute(req).await?;
6199
6200    let status = resp.status();
6201    let content_type = resp
6202        .headers()
6203        .get("content-type")
6204        .and_then(|v| v.to_str().ok())
6205        .unwrap_or("application/octet-stream");
6206    let content_type = super::ContentType::from(content_type);
6207
6208    if !status.is_client_error() && !status.is_server_error() {
6209        let content = resp.text().await?;
6210        match content_type {
6211            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6212            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PutDomainConfigResponse`"))),
6213            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::PutDomainConfigResponse`")))),
6214        }
6215    } else {
6216        let content = resp.text().await?;
6217        let entity: Option<PutDomainConfigError> = serde_json::from_str(&content).ok();
6218        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6219    }
6220}
6221
6222pub async fn put_sso_user(configuration: &configuration::Configuration, params: PutSsoUserParams) -> Result<models::PutSsoUserApiResponse, Error<PutSsoUserError>> {
6223
6224    let uri_str = format!("{}/api/v1/sso-users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
6225    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6226
6227    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6228    if let Some(ref param_value) = params.update_comments {
6229        req_builder = req_builder.query(&[("updateComments", &param_value.to_string())]);
6230    }
6231    if let Some(ref user_agent) = configuration.user_agent {
6232        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6233    }
6234    if let Some(ref apikey) = configuration.api_key {
6235        let key = apikey.key.clone();
6236        let value = match apikey.prefix {
6237            Some(ref prefix) => format!("{} {}", prefix, key),
6238            None => key,
6239        };
6240        req_builder = req_builder.header("x-api-key", value);
6241    };
6242    req_builder = req_builder.json(&params.update_apisso_user_data);
6243
6244    let req = req_builder.build()?;
6245    let resp = configuration.client.execute(req).await?;
6246
6247    let status = resp.status();
6248    let content_type = resp
6249        .headers()
6250        .get("content-type")
6251        .and_then(|v| v.to_str().ok())
6252        .unwrap_or("application/octet-stream");
6253    let content_type = super::ContentType::from(content_type);
6254
6255    if !status.is_client_error() && !status.is_server_error() {
6256        let content = resp.text().await?;
6257        match content_type {
6258            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6259            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PutSsoUserApiResponse`"))),
6260            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::PutSsoUserApiResponse`")))),
6261        }
6262    } else {
6263        let content = resp.text().await?;
6264        let entity: Option<PutSsoUserError> = serde_json::from_str(&content).ok();
6265        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6266    }
6267}
6268
6269pub async fn render_email_template(configuration: &configuration::Configuration, params: RenderEmailTemplateParams) -> Result<models::RenderEmailTemplateResponse, Error<RenderEmailTemplateError>> {
6270
6271    let uri_str = format!("{}/api/v1/email-templates/render", configuration.base_path);
6272    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6273
6274    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6275    if let Some(ref param_value) = params.locale {
6276        req_builder = req_builder.query(&[("locale", &param_value.to_string())]);
6277    }
6278    if let Some(ref user_agent) = configuration.user_agent {
6279        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6280    }
6281    if let Some(ref apikey) = configuration.api_key {
6282        let key = apikey.key.clone();
6283        let value = match apikey.prefix {
6284            Some(ref prefix) => format!("{} {}", prefix, key),
6285            None => key,
6286        };
6287        req_builder = req_builder.header("x-api-key", value);
6288    };
6289    req_builder = req_builder.json(&params.render_email_template_body);
6290
6291    let req = req_builder.build()?;
6292    let resp = configuration.client.execute(req).await?;
6293
6294    let status = resp.status();
6295    let content_type = resp
6296        .headers()
6297        .get("content-type")
6298        .and_then(|v| v.to_str().ok())
6299        .unwrap_or("application/octet-stream");
6300    let content_type = super::ContentType::from(content_type);
6301
6302    if !status.is_client_error() && !status.is_server_error() {
6303        let content = resp.text().await?;
6304        match content_type {
6305            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6306            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RenderEmailTemplateResponse`"))),
6307            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::RenderEmailTemplateResponse`")))),
6308        }
6309    } else {
6310        let content = resp.text().await?;
6311        let entity: Option<RenderEmailTemplateError> = serde_json::from_str(&content).ok();
6312        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6313    }
6314}
6315
6316pub async fn replace_tenant_package(configuration: &configuration::Configuration, params: ReplaceTenantPackageParams) -> Result<models::ApiEmptyResponse, Error<ReplaceTenantPackageError>> {
6317
6318    let uri_str = format!("{}/api/v1/tenant-packages/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
6319    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6320
6321    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6322    if let Some(ref user_agent) = configuration.user_agent {
6323        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6324    }
6325    if let Some(ref apikey) = configuration.api_key {
6326        let key = apikey.key.clone();
6327        let value = match apikey.prefix {
6328            Some(ref prefix) => format!("{} {}", prefix, key),
6329            None => key,
6330        };
6331        req_builder = req_builder.header("x-api-key", value);
6332    };
6333    req_builder = req_builder.json(&params.replace_tenant_package_body);
6334
6335    let req = req_builder.build()?;
6336    let resp = configuration.client.execute(req).await?;
6337
6338    let status = resp.status();
6339    let content_type = resp
6340        .headers()
6341        .get("content-type")
6342        .and_then(|v| v.to_str().ok())
6343        .unwrap_or("application/octet-stream");
6344    let content_type = super::ContentType::from(content_type);
6345
6346    if !status.is_client_error() && !status.is_server_error() {
6347        let content = resp.text().await?;
6348        match content_type {
6349            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6350            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
6351            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::ApiEmptyResponse`")))),
6352        }
6353    } else {
6354        let content = resp.text().await?;
6355        let entity: Option<ReplaceTenantPackageError> = serde_json::from_str(&content).ok();
6356        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6357    }
6358}
6359
6360pub async fn replace_tenant_user(configuration: &configuration::Configuration, params: ReplaceTenantUserParams) -> Result<models::ApiEmptyResponse, Error<ReplaceTenantUserError>> {
6361
6362    let uri_str = format!("{}/api/v1/tenant-users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
6363    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6364
6365    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6366    if let Some(ref param_value) = params.update_comments {
6367        req_builder = req_builder.query(&[("updateComments", &param_value.to_string())]);
6368    }
6369    if let Some(ref user_agent) = configuration.user_agent {
6370        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6371    }
6372    if let Some(ref apikey) = configuration.api_key {
6373        let key = apikey.key.clone();
6374        let value = match apikey.prefix {
6375            Some(ref prefix) => format!("{} {}", prefix, key),
6376            None => key,
6377        };
6378        req_builder = req_builder.header("x-api-key", value);
6379    };
6380    req_builder = req_builder.json(&params.replace_tenant_user_body);
6381
6382    let req = req_builder.build()?;
6383    let resp = configuration.client.execute(req).await?;
6384
6385    let status = resp.status();
6386    let content_type = resp
6387        .headers()
6388        .get("content-type")
6389        .and_then(|v| v.to_str().ok())
6390        .unwrap_or("application/octet-stream");
6391    let content_type = super::ContentType::from(content_type);
6392
6393    if !status.is_client_error() && !status.is_server_error() {
6394        let content = resp.text().await?;
6395        match content_type {
6396            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6397            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
6398            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::ApiEmptyResponse`")))),
6399        }
6400    } else {
6401        let content = resp.text().await?;
6402        let entity: Option<ReplaceTenantUserError> = serde_json::from_str(&content).ok();
6403        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6404    }
6405}
6406
6407pub async fn save_comment(configuration: &configuration::Configuration, params: SaveCommentParams) -> Result<models::ApiSaveCommentResponse, Error<SaveCommentError>> {
6408
6409    let uri_str = format!("{}/api/v1/comments", configuration.base_path);
6410    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6411
6412    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6413    if let Some(ref param_value) = params.is_live {
6414        req_builder = req_builder.query(&[("isLive", &param_value.to_string())]);
6415    }
6416    if let Some(ref param_value) = params.do_spam_check {
6417        req_builder = req_builder.query(&[("doSpamCheck", &param_value.to_string())]);
6418    }
6419    if let Some(ref param_value) = params.send_emails {
6420        req_builder = req_builder.query(&[("sendEmails", &param_value.to_string())]);
6421    }
6422    if let Some(ref param_value) = params.populate_notifications {
6423        req_builder = req_builder.query(&[("populateNotifications", &param_value.to_string())]);
6424    }
6425    if let Some(ref user_agent) = configuration.user_agent {
6426        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6427    }
6428    if let Some(ref apikey) = configuration.api_key {
6429        let key = apikey.key.clone();
6430        let value = match apikey.prefix {
6431            Some(ref prefix) => format!("{} {}", prefix, key),
6432            None => key,
6433        };
6434        req_builder = req_builder.header("x-api-key", value);
6435    };
6436    req_builder = req_builder.json(&params.create_comment_params);
6437
6438    let req = req_builder.build()?;
6439    let resp = configuration.client.execute(req).await?;
6440
6441    let status = resp.status();
6442    let content_type = resp
6443        .headers()
6444        .get("content-type")
6445        .and_then(|v| v.to_str().ok())
6446        .unwrap_or("application/octet-stream");
6447    let content_type = super::ContentType::from(content_type);
6448
6449    if !status.is_client_error() && !status.is_server_error() {
6450        let content = resp.text().await?;
6451        match content_type {
6452            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6453            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiSaveCommentResponse`"))),
6454            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::ApiSaveCommentResponse`")))),
6455        }
6456    } else {
6457        let content = resp.text().await?;
6458        let entity: Option<SaveCommentError> = serde_json::from_str(&content).ok();
6459        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6460    }
6461}
6462
6463pub async fn save_comments_bulk(configuration: &configuration::Configuration, params: SaveCommentsBulkParams) -> Result<Vec<models::SaveCommentsBulkResponse>, Error<SaveCommentsBulkError>> {
6464
6465    let uri_str = format!("{}/api/v1/comments/bulk", configuration.base_path);
6466    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6467
6468    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6469    if let Some(ref param_value) = params.is_live {
6470        req_builder = req_builder.query(&[("isLive", &param_value.to_string())]);
6471    }
6472    if let Some(ref param_value) = params.do_spam_check {
6473        req_builder = req_builder.query(&[("doSpamCheck", &param_value.to_string())]);
6474    }
6475    if let Some(ref param_value) = params.send_emails {
6476        req_builder = req_builder.query(&[("sendEmails", &param_value.to_string())]);
6477    }
6478    if let Some(ref param_value) = params.populate_notifications {
6479        req_builder = req_builder.query(&[("populateNotifications", &param_value.to_string())]);
6480    }
6481    if let Some(ref user_agent) = configuration.user_agent {
6482        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6483    }
6484    if let Some(ref apikey) = configuration.api_key {
6485        let key = apikey.key.clone();
6486        let value = match apikey.prefix {
6487            Some(ref prefix) => format!("{} {}", prefix, key),
6488            None => key,
6489        };
6490        req_builder = req_builder.header("x-api-key", value);
6491    };
6492    req_builder = req_builder.json(&params.create_comment_params);
6493
6494    let req = req_builder.build()?;
6495    let resp = configuration.client.execute(req).await?;
6496
6497    let status = resp.status();
6498    let content_type = resp
6499        .headers()
6500        .get("content-type")
6501        .and_then(|v| v.to_str().ok())
6502        .unwrap_or("application/octet-stream");
6503    let content_type = super::ContentType::from(content_type);
6504
6505    if !status.is_client_error() && !status.is_server_error() {
6506        let content = resp.text().await?;
6507        match content_type {
6508            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6509            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::SaveCommentsBulkResponse&gt;`"))),
6510            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::SaveCommentsBulkResponse&gt;`")))),
6511        }
6512    } else {
6513        let content = resp.text().await?;
6514        let entity: Option<SaveCommentsBulkError> = serde_json::from_str(&content).ok();
6515        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6516    }
6517}
6518
6519pub async fn send_invite(configuration: &configuration::Configuration, params: SendInviteParams) -> Result<models::ApiEmptyResponse, Error<SendInviteError>> {
6520
6521    let uri_str = format!("{}/api/v1/moderators/{id}/send-invite", configuration.base_path, id=crate::client::apis::urlencode(params.id));
6522    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6523
6524    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6525    req_builder = req_builder.query(&[("fromName", &params.from_name.to_string())]);
6526    if let Some(ref user_agent) = configuration.user_agent {
6527        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6528    }
6529    if let Some(ref apikey) = configuration.api_key {
6530        let key = apikey.key.clone();
6531        let value = match apikey.prefix {
6532            Some(ref prefix) => format!("{} {}", prefix, key),
6533            None => key,
6534        };
6535        req_builder = req_builder.header("x-api-key", value);
6536    };
6537
6538    let req = req_builder.build()?;
6539    let resp = configuration.client.execute(req).await?;
6540
6541    let status = resp.status();
6542    let content_type = resp
6543        .headers()
6544        .get("content-type")
6545        .and_then(|v| v.to_str().ok())
6546        .unwrap_or("application/octet-stream");
6547    let content_type = super::ContentType::from(content_type);
6548
6549    if !status.is_client_error() && !status.is_server_error() {
6550        let content = resp.text().await?;
6551        match content_type {
6552            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6553            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
6554            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::ApiEmptyResponse`")))),
6555        }
6556    } else {
6557        let content = resp.text().await?;
6558        let entity: Option<SendInviteError> = serde_json::from_str(&content).ok();
6559        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6560    }
6561}
6562
6563pub async fn send_login_link(configuration: &configuration::Configuration, params: SendLoginLinkParams) -> Result<models::ApiEmptyResponse, Error<SendLoginLinkError>> {
6564
6565    let uri_str = format!("{}/api/v1/tenant-users/{id}/send-login-link", configuration.base_path, id=crate::client::apis::urlencode(params.id));
6566    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6567
6568    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6569    if let Some(ref param_value) = params.redirect_url {
6570        req_builder = req_builder.query(&[("redirectURL", &param_value.to_string())]);
6571    }
6572    if let Some(ref user_agent) = configuration.user_agent {
6573        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6574    }
6575    if let Some(ref apikey) = configuration.api_key {
6576        let key = apikey.key.clone();
6577        let value = match apikey.prefix {
6578            Some(ref prefix) => format!("{} {}", prefix, key),
6579            None => key,
6580        };
6581        req_builder = req_builder.header("x-api-key", value);
6582    };
6583
6584    let req = req_builder.build()?;
6585    let resp = configuration.client.execute(req).await?;
6586
6587    let status = resp.status();
6588    let content_type = resp
6589        .headers()
6590        .get("content-type")
6591        .and_then(|v| v.to_str().ok())
6592        .unwrap_or("application/octet-stream");
6593    let content_type = super::ContentType::from(content_type);
6594
6595    if !status.is_client_error() && !status.is_server_error() {
6596        let content = resp.text().await?;
6597        match content_type {
6598            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6599            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
6600            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::ApiEmptyResponse`")))),
6601        }
6602    } else {
6603        let content = resp.text().await?;
6604        let entity: Option<SendLoginLinkError> = serde_json::from_str(&content).ok();
6605        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6606    }
6607}
6608
6609pub async fn un_block_user_from_comment(configuration: &configuration::Configuration, params: UnBlockUserFromCommentParams) -> Result<models::UnblockSuccess, Error<UnBlockUserFromCommentError>> {
6610
6611    let uri_str = format!("{}/api/v1/comments/{id}/un-block", configuration.base_path, id=crate::client::apis::urlencode(params.id));
6612    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6613
6614    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6615    if let Some(ref param_value) = params.user_id {
6616        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
6617    }
6618    if let Some(ref param_value) = params.anon_user_id {
6619        req_builder = req_builder.query(&[("anonUserId", &param_value.to_string())]);
6620    }
6621    if let Some(ref user_agent) = configuration.user_agent {
6622        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6623    }
6624    if let Some(ref apikey) = configuration.api_key {
6625        let key = apikey.key.clone();
6626        let value = match apikey.prefix {
6627            Some(ref prefix) => format!("{} {}", prefix, key),
6628            None => key,
6629        };
6630        req_builder = req_builder.header("x-api-key", value);
6631    };
6632    req_builder = req_builder.json(&params.un_block_from_comment_params);
6633
6634    let req = req_builder.build()?;
6635    let resp = configuration.client.execute(req).await?;
6636
6637    let status = resp.status();
6638    let content_type = resp
6639        .headers()
6640        .get("content-type")
6641        .and_then(|v| v.to_str().ok())
6642        .unwrap_or("application/octet-stream");
6643    let content_type = super::ContentType::from(content_type);
6644
6645    if !status.is_client_error() && !status.is_server_error() {
6646        let content = resp.text().await?;
6647        match content_type {
6648            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6649            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UnblockSuccess`"))),
6650            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::UnblockSuccess`")))),
6651        }
6652    } else {
6653        let content = resp.text().await?;
6654        let entity: Option<UnBlockUserFromCommentError> = serde_json::from_str(&content).ok();
6655        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6656    }
6657}
6658
6659pub async fn un_flag_comment(configuration: &configuration::Configuration, params: UnFlagCommentParams) -> Result<models::FlagCommentResponse, Error<UnFlagCommentError>> {
6660
6661    let uri_str = format!("{}/api/v1/comments/{id}/un-flag", configuration.base_path, id=crate::client::apis::urlencode(params.id));
6662    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6663
6664    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6665    if let Some(ref param_value) = params.user_id {
6666        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
6667    }
6668    if let Some(ref param_value) = params.anon_user_id {
6669        req_builder = req_builder.query(&[("anonUserId", &param_value.to_string())]);
6670    }
6671    if let Some(ref user_agent) = configuration.user_agent {
6672        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6673    }
6674    if let Some(ref apikey) = configuration.api_key {
6675        let key = apikey.key.clone();
6676        let value = match apikey.prefix {
6677            Some(ref prefix) => format!("{} {}", prefix, key),
6678            None => key,
6679        };
6680        req_builder = req_builder.header("x-api-key", value);
6681    };
6682
6683    let req = req_builder.build()?;
6684    let resp = configuration.client.execute(req).await?;
6685
6686    let status = resp.status();
6687    let content_type = resp
6688        .headers()
6689        .get("content-type")
6690        .and_then(|v| v.to_str().ok())
6691        .unwrap_or("application/octet-stream");
6692    let content_type = super::ContentType::from(content_type);
6693
6694    if !status.is_client_error() && !status.is_server_error() {
6695        let content = resp.text().await?;
6696        match content_type {
6697            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6698            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FlagCommentResponse`"))),
6699            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::FlagCommentResponse`")))),
6700        }
6701    } else {
6702        let content = resp.text().await?;
6703        let entity: Option<UnFlagCommentError> = serde_json::from_str(&content).ok();
6704        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6705    }
6706}
6707
6708pub async fn update_comment(configuration: &configuration::Configuration, params: UpdateCommentParams) -> Result<models::ApiEmptyResponse, Error<UpdateCommentError>> {
6709
6710    let uri_str = format!("{}/api/v1/comments/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
6711    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6712
6713    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6714    if let Some(ref param_value) = params.context_user_id {
6715        req_builder = req_builder.query(&[("contextUserId", &param_value.to_string())]);
6716    }
6717    if let Some(ref param_value) = params.do_spam_check {
6718        req_builder = req_builder.query(&[("doSpamCheck", &param_value.to_string())]);
6719    }
6720    if let Some(ref param_value) = params.is_live {
6721        req_builder = req_builder.query(&[("isLive", &param_value.to_string())]);
6722    }
6723    if let Some(ref user_agent) = configuration.user_agent {
6724        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6725    }
6726    if let Some(ref apikey) = configuration.api_key {
6727        let key = apikey.key.clone();
6728        let value = match apikey.prefix {
6729            Some(ref prefix) => format!("{} {}", prefix, key),
6730            None => key,
6731        };
6732        req_builder = req_builder.header("x-api-key", value);
6733    };
6734    req_builder = req_builder.json(&params.updatable_comment_params);
6735
6736    let req = req_builder.build()?;
6737    let resp = configuration.client.execute(req).await?;
6738
6739    let status = resp.status();
6740    let content_type = resp
6741        .headers()
6742        .get("content-type")
6743        .and_then(|v| v.to_str().ok())
6744        .unwrap_or("application/octet-stream");
6745    let content_type = super::ContentType::from(content_type);
6746
6747    if !status.is_client_error() && !status.is_server_error() {
6748        let content = resp.text().await?;
6749        match content_type {
6750            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6751            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
6752            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::ApiEmptyResponse`")))),
6753        }
6754    } else {
6755        let content = resp.text().await?;
6756        let entity: Option<UpdateCommentError> = serde_json::from_str(&content).ok();
6757        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6758    }
6759}
6760
6761pub async fn update_email_template(configuration: &configuration::Configuration, params: UpdateEmailTemplateParams) -> Result<models::ApiEmptyResponse, Error<UpdateEmailTemplateError>> {
6762
6763    let uri_str = format!("{}/api/v1/email-templates/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
6764    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6765
6766    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6767    if let Some(ref user_agent) = configuration.user_agent {
6768        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6769    }
6770    if let Some(ref apikey) = configuration.api_key {
6771        let key = apikey.key.clone();
6772        let value = match apikey.prefix {
6773            Some(ref prefix) => format!("{} {}", prefix, key),
6774            None => key,
6775        };
6776        req_builder = req_builder.header("x-api-key", value);
6777    };
6778    req_builder = req_builder.json(&params.update_email_template_body);
6779
6780    let req = req_builder.build()?;
6781    let resp = configuration.client.execute(req).await?;
6782
6783    let status = resp.status();
6784    let content_type = resp
6785        .headers()
6786        .get("content-type")
6787        .and_then(|v| v.to_str().ok())
6788        .unwrap_or("application/octet-stream");
6789    let content_type = super::ContentType::from(content_type);
6790
6791    if !status.is_client_error() && !status.is_server_error() {
6792        let content = resp.text().await?;
6793        match content_type {
6794            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6795            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
6796            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::ApiEmptyResponse`")))),
6797        }
6798    } else {
6799        let content = resp.text().await?;
6800        let entity: Option<UpdateEmailTemplateError> = serde_json::from_str(&content).ok();
6801        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6802    }
6803}
6804
6805pub async fn update_feed_post(configuration: &configuration::Configuration, params: UpdateFeedPostParams) -> Result<models::ApiEmptyResponse, Error<UpdateFeedPostError>> {
6806
6807    let uri_str = format!("{}/api/v1/feed-posts/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
6808    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6809
6810    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6811    if let Some(ref user_agent) = configuration.user_agent {
6812        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6813    }
6814    if let Some(ref apikey) = configuration.api_key {
6815        let key = apikey.key.clone();
6816        let value = match apikey.prefix {
6817            Some(ref prefix) => format!("{} {}", prefix, key),
6818            None => key,
6819        };
6820        req_builder = req_builder.header("x-api-key", value);
6821    };
6822    req_builder = req_builder.json(&params.feed_post);
6823
6824    let req = req_builder.build()?;
6825    let resp = configuration.client.execute(req).await?;
6826
6827    let status = resp.status();
6828    let content_type = resp
6829        .headers()
6830        .get("content-type")
6831        .and_then(|v| v.to_str().ok())
6832        .unwrap_or("application/octet-stream");
6833    let content_type = super::ContentType::from(content_type);
6834
6835    if !status.is_client_error() && !status.is_server_error() {
6836        let content = resp.text().await?;
6837        match content_type {
6838            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6839            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
6840            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::ApiEmptyResponse`")))),
6841        }
6842    } else {
6843        let content = resp.text().await?;
6844        let entity: Option<UpdateFeedPostError> = serde_json::from_str(&content).ok();
6845        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6846    }
6847}
6848
6849pub async fn update_moderator(configuration: &configuration::Configuration, params: UpdateModeratorParams) -> Result<models::ApiEmptyResponse, Error<UpdateModeratorError>> {
6850
6851    let uri_str = format!("{}/api/v1/moderators/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
6852    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6853
6854    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6855    if let Some(ref user_agent) = configuration.user_agent {
6856        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6857    }
6858    if let Some(ref apikey) = configuration.api_key {
6859        let key = apikey.key.clone();
6860        let value = match apikey.prefix {
6861            Some(ref prefix) => format!("{} {}", prefix, key),
6862            None => key,
6863        };
6864        req_builder = req_builder.header("x-api-key", value);
6865    };
6866    req_builder = req_builder.json(&params.update_moderator_body);
6867
6868    let req = req_builder.build()?;
6869    let resp = configuration.client.execute(req).await?;
6870
6871    let status = resp.status();
6872    let content_type = resp
6873        .headers()
6874        .get("content-type")
6875        .and_then(|v| v.to_str().ok())
6876        .unwrap_or("application/octet-stream");
6877    let content_type = super::ContentType::from(content_type);
6878
6879    if !status.is_client_error() && !status.is_server_error() {
6880        let content = resp.text().await?;
6881        match content_type {
6882            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6883            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
6884            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::ApiEmptyResponse`")))),
6885        }
6886    } else {
6887        let content = resp.text().await?;
6888        let entity: Option<UpdateModeratorError> = serde_json::from_str(&content).ok();
6889        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6890    }
6891}
6892
6893pub async fn update_notification(configuration: &configuration::Configuration, params: UpdateNotificationParams) -> Result<models::ApiEmptyResponse, Error<UpdateNotificationError>> {
6894
6895    let uri_str = format!("{}/api/v1/notifications/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
6896    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6897
6898    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6899    if let Some(ref param_value) = params.user_id {
6900        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
6901    }
6902    if let Some(ref user_agent) = configuration.user_agent {
6903        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6904    }
6905    if let Some(ref apikey) = configuration.api_key {
6906        let key = apikey.key.clone();
6907        let value = match apikey.prefix {
6908            Some(ref prefix) => format!("{} {}", prefix, key),
6909            None => key,
6910        };
6911        req_builder = req_builder.header("x-api-key", value);
6912    };
6913    req_builder = req_builder.json(&params.update_notification_body);
6914
6915    let req = req_builder.build()?;
6916    let resp = configuration.client.execute(req).await?;
6917
6918    let status = resp.status();
6919    let content_type = resp
6920        .headers()
6921        .get("content-type")
6922        .and_then(|v| v.to_str().ok())
6923        .unwrap_or("application/octet-stream");
6924    let content_type = super::ContentType::from(content_type);
6925
6926    if !status.is_client_error() && !status.is_server_error() {
6927        let content = resp.text().await?;
6928        match content_type {
6929            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6930            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
6931            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::ApiEmptyResponse`")))),
6932        }
6933    } else {
6934        let content = resp.text().await?;
6935        let entity: Option<UpdateNotificationError> = serde_json::from_str(&content).ok();
6936        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6937    }
6938}
6939
6940pub async fn update_question_config(configuration: &configuration::Configuration, params: UpdateQuestionConfigParams) -> Result<models::ApiEmptyResponse, Error<UpdateQuestionConfigError>> {
6941
6942    let uri_str = format!("{}/api/v1/question-configs/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
6943    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6944
6945    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6946    if let Some(ref user_agent) = configuration.user_agent {
6947        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6948    }
6949    if let Some(ref apikey) = configuration.api_key {
6950        let key = apikey.key.clone();
6951        let value = match apikey.prefix {
6952            Some(ref prefix) => format!("{} {}", prefix, key),
6953            None => key,
6954        };
6955        req_builder = req_builder.header("x-api-key", value);
6956    };
6957    req_builder = req_builder.json(&params.update_question_config_body);
6958
6959    let req = req_builder.build()?;
6960    let resp = configuration.client.execute(req).await?;
6961
6962    let status = resp.status();
6963    let content_type = resp
6964        .headers()
6965        .get("content-type")
6966        .and_then(|v| v.to_str().ok())
6967        .unwrap_or("application/octet-stream");
6968    let content_type = super::ContentType::from(content_type);
6969
6970    if !status.is_client_error() && !status.is_server_error() {
6971        let content = resp.text().await?;
6972        match content_type {
6973            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6974            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
6975            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::ApiEmptyResponse`")))),
6976        }
6977    } else {
6978        let content = resp.text().await?;
6979        let entity: Option<UpdateQuestionConfigError> = serde_json::from_str(&content).ok();
6980        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6981    }
6982}
6983
6984pub async fn update_question_result(configuration: &configuration::Configuration, params: UpdateQuestionResultParams) -> Result<models::ApiEmptyResponse, Error<UpdateQuestionResultError>> {
6985
6986    let uri_str = format!("{}/api/v1/question-results/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
6987    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6988
6989    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
6990    if let Some(ref user_agent) = configuration.user_agent {
6991        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6992    }
6993    if let Some(ref apikey) = configuration.api_key {
6994        let key = apikey.key.clone();
6995        let value = match apikey.prefix {
6996            Some(ref prefix) => format!("{} {}", prefix, key),
6997            None => key,
6998        };
6999        req_builder = req_builder.header("x-api-key", value);
7000    };
7001    req_builder = req_builder.json(&params.update_question_result_body);
7002
7003    let req = req_builder.build()?;
7004    let resp = configuration.client.execute(req).await?;
7005
7006    let status = resp.status();
7007    let content_type = resp
7008        .headers()
7009        .get("content-type")
7010        .and_then(|v| v.to_str().ok())
7011        .unwrap_or("application/octet-stream");
7012    let content_type = super::ContentType::from(content_type);
7013
7014    if !status.is_client_error() && !status.is_server_error() {
7015        let content = resp.text().await?;
7016        match content_type {
7017            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7018            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
7019            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::ApiEmptyResponse`")))),
7020        }
7021    } else {
7022        let content = resp.text().await?;
7023        let entity: Option<UpdateQuestionResultError> = serde_json::from_str(&content).ok();
7024        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7025    }
7026}
7027
7028pub async fn update_subscription(configuration: &configuration::Configuration, params: UpdateSubscriptionParams) -> Result<models::UpdateSubscriptionApiResponse, Error<UpdateSubscriptionError>> {
7029
7030    let uri_str = format!("{}/api/v1/subscriptions/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
7031    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7032
7033    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
7034    if let Some(ref param_value) = params.user_id {
7035        req_builder = req_builder.query(&[("userId", &param_value.to_string())]);
7036    }
7037    if let Some(ref user_agent) = configuration.user_agent {
7038        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7039    }
7040    if let Some(ref apikey) = configuration.api_key {
7041        let key = apikey.key.clone();
7042        let value = match apikey.prefix {
7043            Some(ref prefix) => format!("{} {}", prefix, key),
7044            None => key,
7045        };
7046        req_builder = req_builder.header("x-api-key", value);
7047    };
7048    req_builder = req_builder.json(&params.update_api_user_subscription_data);
7049
7050    let req = req_builder.build()?;
7051    let resp = configuration.client.execute(req).await?;
7052
7053    let status = resp.status();
7054    let content_type = resp
7055        .headers()
7056        .get("content-type")
7057        .and_then(|v| v.to_str().ok())
7058        .unwrap_or("application/octet-stream");
7059    let content_type = super::ContentType::from(content_type);
7060
7061    if !status.is_client_error() && !status.is_server_error() {
7062        let content = resp.text().await?;
7063        match content_type {
7064            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7065            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UpdateSubscriptionApiResponse`"))),
7066            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::UpdateSubscriptionApiResponse`")))),
7067        }
7068    } else {
7069        let content = resp.text().await?;
7070        let entity: Option<UpdateSubscriptionError> = serde_json::from_str(&content).ok();
7071        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7072    }
7073}
7074
7075pub async fn update_tenant(configuration: &configuration::Configuration, params: UpdateTenantParams) -> Result<models::ApiEmptyResponse, Error<UpdateTenantError>> {
7076
7077    let uri_str = format!("{}/api/v1/tenants/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
7078    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7079
7080    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
7081    if let Some(ref user_agent) = configuration.user_agent {
7082        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7083    }
7084    if let Some(ref apikey) = configuration.api_key {
7085        let key = apikey.key.clone();
7086        let value = match apikey.prefix {
7087            Some(ref prefix) => format!("{} {}", prefix, key),
7088            None => key,
7089        };
7090        req_builder = req_builder.header("x-api-key", value);
7091    };
7092    req_builder = req_builder.json(&params.update_tenant_body);
7093
7094    let req = req_builder.build()?;
7095    let resp = configuration.client.execute(req).await?;
7096
7097    let status = resp.status();
7098    let content_type = resp
7099        .headers()
7100        .get("content-type")
7101        .and_then(|v| v.to_str().ok())
7102        .unwrap_or("application/octet-stream");
7103    let content_type = super::ContentType::from(content_type);
7104
7105    if !status.is_client_error() && !status.is_server_error() {
7106        let content = resp.text().await?;
7107        match content_type {
7108            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7109            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
7110            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::ApiEmptyResponse`")))),
7111        }
7112    } else {
7113        let content = resp.text().await?;
7114        let entity: Option<UpdateTenantError> = serde_json::from_str(&content).ok();
7115        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7116    }
7117}
7118
7119pub async fn update_tenant_package(configuration: &configuration::Configuration, params: UpdateTenantPackageParams) -> Result<models::ApiEmptyResponse, Error<UpdateTenantPackageError>> {
7120
7121    let uri_str = format!("{}/api/v1/tenant-packages/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
7122    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7123
7124    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
7125    if let Some(ref user_agent) = configuration.user_agent {
7126        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7127    }
7128    if let Some(ref apikey) = configuration.api_key {
7129        let key = apikey.key.clone();
7130        let value = match apikey.prefix {
7131            Some(ref prefix) => format!("{} {}", prefix, key),
7132            None => key,
7133        };
7134        req_builder = req_builder.header("x-api-key", value);
7135    };
7136    req_builder = req_builder.json(&params.update_tenant_package_body);
7137
7138    let req = req_builder.build()?;
7139    let resp = configuration.client.execute(req).await?;
7140
7141    let status = resp.status();
7142    let content_type = resp
7143        .headers()
7144        .get("content-type")
7145        .and_then(|v| v.to_str().ok())
7146        .unwrap_or("application/octet-stream");
7147    let content_type = super::ContentType::from(content_type);
7148
7149    if !status.is_client_error() && !status.is_server_error() {
7150        let content = resp.text().await?;
7151        match content_type {
7152            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7153            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
7154            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::ApiEmptyResponse`")))),
7155        }
7156    } else {
7157        let content = resp.text().await?;
7158        let entity: Option<UpdateTenantPackageError> = serde_json::from_str(&content).ok();
7159        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7160    }
7161}
7162
7163pub async fn update_tenant_user(configuration: &configuration::Configuration, params: UpdateTenantUserParams) -> Result<models::ApiEmptyResponse, Error<UpdateTenantUserError>> {
7164
7165    let uri_str = format!("{}/api/v1/tenant-users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
7166    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7167
7168    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
7169    if let Some(ref param_value) = params.update_comments {
7170        req_builder = req_builder.query(&[("updateComments", &param_value.to_string())]);
7171    }
7172    if let Some(ref user_agent) = configuration.user_agent {
7173        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7174    }
7175    if let Some(ref apikey) = configuration.api_key {
7176        let key = apikey.key.clone();
7177        let value = match apikey.prefix {
7178            Some(ref prefix) => format!("{} {}", prefix, key),
7179            None => key,
7180        };
7181        req_builder = req_builder.header("x-api-key", value);
7182    };
7183    req_builder = req_builder.json(&params.update_tenant_user_body);
7184
7185    let req = req_builder.build()?;
7186    let resp = configuration.client.execute(req).await?;
7187
7188    let status = resp.status();
7189    let content_type = resp
7190        .headers()
7191        .get("content-type")
7192        .and_then(|v| v.to_str().ok())
7193        .unwrap_or("application/octet-stream");
7194    let content_type = super::ContentType::from(content_type);
7195
7196    if !status.is_client_error() && !status.is_server_error() {
7197        let content = resp.text().await?;
7198        match content_type {
7199            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7200            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
7201            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::ApiEmptyResponse`")))),
7202        }
7203    } else {
7204        let content = resp.text().await?;
7205        let entity: Option<UpdateTenantUserError> = serde_json::from_str(&content).ok();
7206        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7207    }
7208}
7209
7210pub async fn update_user_badge(configuration: &configuration::Configuration, params: UpdateUserBadgeParams) -> Result<models::ApiEmptySuccessResponse, Error<UpdateUserBadgeError>> {
7211
7212    let uri_str = format!("{}/api/v1/user-badges/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
7213    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7214
7215    req_builder = req_builder.query(&[("tenantId", &params.tenant_id.to_string())]);
7216    if let Some(ref user_agent) = configuration.user_agent {
7217        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7218    }
7219    if let Some(ref apikey) = configuration.api_key {
7220        let key = apikey.key.clone();
7221        let value = match apikey.prefix {
7222            Some(ref prefix) => format!("{} {}", prefix, key),
7223            None => key,
7224        };
7225        req_builder = req_builder.header("x-api-key", value);
7226    };
7227    req_builder = req_builder.json(&params.update_user_badge_params);
7228
7229    let req = req_builder.build()?;
7230    let resp = configuration.client.execute(req).await?;
7231
7232    let status = resp.status();
7233    let content_type = resp
7234        .headers()
7235        .get("content-type")
7236        .and_then(|v| v.to_str().ok())
7237        .unwrap_or("application/octet-stream");
7238    let content_type = super::ContentType::from(content_type);
7239
7240    if !status.is_client_error() && !status.is_server_error() {
7241        let content = resp.text().await?;
7242        match content_type {
7243            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7244            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptySuccessResponse`"))),
7245            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::ApiEmptySuccessResponse`")))),
7246        }
7247    } else {
7248        let content = resp.text().await?;
7249        let entity: Option<UpdateUserBadgeError> = serde_json::from_str(&content).ok();
7250        Err(Error::ResponseError(ResponseContent { status, content, entity }))
7251    }
7252}
7253