1use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::client::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17#[derive(Clone, Debug)]
19pub struct AddDomainConfigParams {
20 pub tenant_id: String,
21 pub add_domain_config_params: models::AddDomainConfigParams
22}
23
24#[derive(Clone, Debug)]
26pub struct AddPageParams {
27 pub tenant_id: String,
28 pub create_api_page_data: models::CreateApiPageData
29}
30
31#[derive(Clone, Debug)]
33pub struct AddSsoUserParams {
34 pub tenant_id: String,
35 pub create_apisso_user_data: models::CreateApissoUserData
36}
37
38#[derive(Clone, Debug)]
40pub struct AggregateParams {
41 pub tenant_id: String,
42 pub aggregation_request: models::AggregationRequest,
43 pub parent_tenant_id: Option<String>,
44 pub include_stats: Option<bool>
45}
46
47#[derive(Clone, Debug)]
49pub struct AggregateQuestionResultsParams {
50 pub tenant_id: String,
51 pub question_id: Option<String>,
52 pub question_ids: Option<Vec<String>>,
53 pub url_id: Option<String>,
54 pub time_bucket: Option<models::AggregateTimeBucket>,
55 pub start_date: Option<String>,
56 pub force_recalculate: Option<bool>
57}
58
59#[derive(Clone, Debug)]
61pub struct BlockUserFromCommentParams {
62 pub tenant_id: String,
63 pub id: String,
64 pub block_from_comment_params: models::BlockFromCommentParams,
65 pub user_id: Option<String>,
66 pub anon_user_id: Option<String>
67}
68
69#[derive(Clone, Debug)]
71pub struct BulkAggregateQuestionResultsParams {
72 pub tenant_id: String,
73 pub bulk_aggregate_question_results_request: models::BulkAggregateQuestionResultsRequest,
74 pub force_recalculate: Option<bool>
75}
76
77#[derive(Clone, Debug)]
79pub struct CombineCommentsWithQuestionResultsParams {
80 pub tenant_id: String,
81 pub question_id: Option<String>,
82 pub question_ids: Option<Vec<String>>,
83 pub url_id: Option<String>,
84 pub start_date: Option<String>,
85 pub force_recalculate: Option<bool>,
86 pub min_value: Option<f64>,
87 pub max_value: Option<f64>,
88 pub limit: Option<f64>
89}
90
91#[derive(Clone, Debug)]
93pub struct CreateFeedPostParams {
94 pub tenant_id: String,
95 pub create_feed_post_params: models::CreateFeedPostParams,
96 pub broadcast_id: Option<String>,
97 pub is_live: Option<bool>,
98 pub do_spam_check: Option<bool>,
99 pub skip_dup_check: Option<bool>
100}
101
102#[derive(Clone, Debug)]
104pub struct CreateSubscriptionParams {
105 pub tenant_id: String,
106 pub create_api_user_subscription_data: models::CreateApiUserSubscriptionData
107}
108
109#[derive(Clone, Debug)]
111pub struct CreateUserBadgeParams {
112 pub tenant_id: String,
113 pub create_user_badge_params: models::CreateUserBadgeParams
114}
115
116#[derive(Clone, Debug)]
118pub struct DeleteCommentParams {
119 pub tenant_id: String,
120 pub id: String,
121 pub context_user_id: Option<String>,
122 pub is_live: Option<bool>
123}
124
125#[derive(Clone, Debug)]
127pub struct DeleteDomainConfigParams {
128 pub tenant_id: String,
129 pub domain: String
130}
131
132#[derive(Clone, Debug)]
134pub struct DeletePageParams {
135 pub tenant_id: String,
136 pub id: String
137}
138
139#[derive(Clone, Debug)]
141pub struct DeleteSsoUserParams {
142 pub tenant_id: String,
143 pub id: String,
144 pub delete_comments: Option<bool>,
145 pub comment_delete_mode: Option<String>
146}
147
148#[derive(Clone, Debug)]
150pub struct DeleteSubscriptionParams {
151 pub tenant_id: String,
152 pub id: String,
153 pub user_id: Option<String>
154}
155
156#[derive(Clone, Debug)]
158pub struct DeleteUserBadgeParams {
159 pub tenant_id: String,
160 pub id: String
161}
162
163#[derive(Clone, Debug)]
165pub struct FlagCommentParams {
166 pub tenant_id: String,
167 pub id: String,
168 pub user_id: Option<String>,
169 pub anon_user_id: Option<String>
170}
171
172#[derive(Clone, Debug)]
174pub struct GetAuditLogsParams {
175 pub tenant_id: String,
176 pub limit: Option<f64>,
177 pub skip: Option<f64>,
178 pub order: Option<models::SortDir>,
179 pub after: Option<f64>,
180 pub before: Option<f64>
181}
182
183#[derive(Clone, Debug)]
185pub struct GetCommentParams {
186 pub tenant_id: String,
187 pub id: String
188}
189
190#[derive(Clone, Debug)]
192pub struct GetCommentsParams {
193 pub tenant_id: String,
194 pub page: Option<i32>,
195 pub limit: Option<i32>,
196 pub skip: Option<i32>,
197 pub as_tree: Option<bool>,
198 pub skip_children: Option<i32>,
199 pub limit_children: Option<i32>,
200 pub max_tree_depth: Option<i32>,
201 pub url_id: Option<String>,
202 pub user_id: Option<String>,
203 pub anon_user_id: Option<String>,
204 pub context_user_id: Option<String>,
205 pub hash_tag: Option<String>,
206 pub parent_id: Option<String>,
207 pub direction: Option<models::SortDirections>
208}
209
210#[derive(Clone, Debug)]
212pub struct GetDomainConfigParams {
213 pub tenant_id: String,
214 pub domain: String
215}
216
217#[derive(Clone, Debug)]
219pub struct GetDomainConfigsParams {
220 pub tenant_id: String
221}
222
223#[derive(Clone, Debug)]
225pub struct GetFeedPostsParams {
226 pub tenant_id: String,
227 pub after_id: Option<String>,
228 pub limit: Option<i32>,
229 pub tags: Option<Vec<String>>
230}
231
232#[derive(Clone, Debug)]
234pub struct GetPageByUrlidParams {
235 pub tenant_id: String,
236 pub url_id: String
237}
238
239#[derive(Clone, Debug)]
241pub struct GetPagesParams {
242 pub tenant_id: String
243}
244
245#[derive(Clone, Debug)]
247pub struct GetSsoUserByEmailParams {
248 pub tenant_id: String,
249 pub email: String
250}
251
252#[derive(Clone, Debug)]
254pub struct GetSsoUserByIdParams {
255 pub tenant_id: String,
256 pub id: String
257}
258
259#[derive(Clone, Debug)]
261pub struct GetSsoUsersParams {
262 pub tenant_id: String,
263 pub skip: Option<i32>
264}
265
266#[derive(Clone, Debug)]
268pub struct GetSubscriptionsParams {
269 pub tenant_id: String,
270 pub user_id: Option<String>
271}
272
273#[derive(Clone, Debug)]
275pub struct GetUserBadgeParams {
276 pub tenant_id: String,
277 pub id: String
278}
279
280#[derive(Clone, Debug)]
282pub struct GetUserBadgeProgressByIdParams {
283 pub tenant_id: String,
284 pub id: String
285}
286
287#[derive(Clone, Debug)]
289pub struct GetUserBadgeProgressByUserIdParams {
290 pub tenant_id: String,
291 pub user_id: String
292}
293
294#[derive(Clone, Debug)]
296pub struct GetUserBadgeProgressListParams {
297 pub tenant_id: String,
298 pub user_id: Option<String>,
299 pub limit: Option<f64>,
300 pub skip: Option<f64>
301}
302
303#[derive(Clone, Debug)]
305pub struct GetUserBadgesParams {
306 pub tenant_id: String,
307 pub user_id: Option<String>,
308 pub badge_id: Option<String>,
309 pub r#type: Option<f64>,
310 pub displayed_on_comments: Option<bool>,
311 pub limit: Option<f64>,
312 pub skip: Option<f64>
313}
314
315#[derive(Clone, Debug)]
317pub struct PatchDomainConfigParams {
318 pub tenant_id: String,
319 pub domain_to_update: String,
320 pub patch_domain_config_params: models::PatchDomainConfigParams
321}
322
323#[derive(Clone, Debug)]
325pub struct PatchPageParams {
326 pub tenant_id: String,
327 pub id: String,
328 pub update_api_page_data: models::UpdateApiPageData
329}
330
331#[derive(Clone, Debug)]
333pub struct PatchSsoUserParams {
334 pub tenant_id: String,
335 pub id: String,
336 pub update_apisso_user_data: models::UpdateApissoUserData,
337 pub update_comments: Option<bool>
338}
339
340#[derive(Clone, Debug)]
342pub struct PutDomainConfigParams {
343 pub tenant_id: String,
344 pub domain_to_update: String,
345 pub update_domain_config_params: models::UpdateDomainConfigParams
346}
347
348#[derive(Clone, Debug)]
350pub struct PutSsoUserParams {
351 pub tenant_id: String,
352 pub id: String,
353 pub update_apisso_user_data: models::UpdateApissoUserData,
354 pub update_comments: Option<bool>
355}
356
357#[derive(Clone, Debug)]
359pub struct SaveCommentParams {
360 pub tenant_id: String,
361 pub create_comment_params: models::CreateCommentParams,
362 pub is_live: Option<bool>,
363 pub do_spam_check: Option<bool>,
364 pub send_emails: Option<bool>,
365 pub populate_notifications: Option<bool>
366}
367
368#[derive(Clone, Debug)]
370pub struct SaveCommentsBulkParams {
371 pub tenant_id: String,
372 pub create_comment_params: Vec<models::CreateCommentParams>,
373 pub is_live: Option<bool>,
374 pub do_spam_check: Option<bool>,
375 pub send_emails: Option<bool>,
376 pub populate_notifications: Option<bool>
377}
378
379#[derive(Clone, Debug)]
381pub struct UnBlockUserFromCommentParams {
382 pub tenant_id: String,
383 pub id: String,
384 pub un_block_from_comment_params: models::UnBlockFromCommentParams,
385 pub user_id: Option<String>,
386 pub anon_user_id: Option<String>
387}
388
389#[derive(Clone, Debug)]
391pub struct UnFlagCommentParams {
392 pub tenant_id: String,
393 pub id: String,
394 pub user_id: Option<String>,
395 pub anon_user_id: Option<String>
396}
397
398#[derive(Clone, Debug)]
400pub struct UpdateCommentParams {
401 pub tenant_id: String,
402 pub id: String,
403 pub body: models::PickApiCommentPeriodUpdatableCommentFields,
404 pub context_user_id: Option<String>,
405 pub do_spam_check: Option<bool>,
406 pub is_live: Option<bool>
407}
408
409#[derive(Clone, Debug)]
411pub struct UpdateFeedPostParams {
412 pub tenant_id: String,
413 pub id: String,
414 pub feed_post: models::FeedPost
415}
416
417#[derive(Clone, Debug)]
419pub struct UpdateUserBadgeParams {
420 pub tenant_id: String,
421 pub id: String,
422 pub update_user_badge_params: models::UpdateUserBadgeParams
423}
424
425
426#[derive(Debug, Clone, Serialize, Deserialize)]
428#[serde(untagged)]
429pub enum AddDomainConfigError {
430 UnknownValue(serde_json::Value),
431}
432
433#[derive(Debug, Clone, Serialize, Deserialize)]
435#[serde(untagged)]
436pub enum AddPageError {
437 UnknownValue(serde_json::Value),
438}
439
440#[derive(Debug, Clone, Serialize, Deserialize)]
442#[serde(untagged)]
443pub enum AddSsoUserError {
444 UnknownValue(serde_json::Value),
445}
446
447#[derive(Debug, Clone, Serialize, Deserialize)]
449#[serde(untagged)]
450pub enum AggregateError {
451 UnknownValue(serde_json::Value),
452}
453
454#[derive(Debug, Clone, Serialize, Deserialize)]
456#[serde(untagged)]
457pub enum AggregateQuestionResultsError {
458 UnknownValue(serde_json::Value),
459}
460
461#[derive(Debug, Clone, Serialize, Deserialize)]
463#[serde(untagged)]
464pub enum BlockUserFromCommentError {
465 UnknownValue(serde_json::Value),
466}
467
468#[derive(Debug, Clone, Serialize, Deserialize)]
470#[serde(untagged)]
471pub enum BulkAggregateQuestionResultsError {
472 UnknownValue(serde_json::Value),
473}
474
475#[derive(Debug, Clone, Serialize, Deserialize)]
477#[serde(untagged)]
478pub enum CombineCommentsWithQuestionResultsError {
479 UnknownValue(serde_json::Value),
480}
481
482#[derive(Debug, Clone, Serialize, Deserialize)]
484#[serde(untagged)]
485pub enum CreateFeedPostError {
486 UnknownValue(serde_json::Value),
487}
488
489#[derive(Debug, Clone, Serialize, Deserialize)]
491#[serde(untagged)]
492pub enum CreateSubscriptionError {
493 UnknownValue(serde_json::Value),
494}
495
496#[derive(Debug, Clone, Serialize, Deserialize)]
498#[serde(untagged)]
499pub enum CreateUserBadgeError {
500 UnknownValue(serde_json::Value),
501}
502
503#[derive(Debug, Clone, Serialize, Deserialize)]
505#[serde(untagged)]
506pub enum DeleteCommentError {
507 UnknownValue(serde_json::Value),
508}
509
510#[derive(Debug, Clone, Serialize, Deserialize)]
512#[serde(untagged)]
513pub enum DeleteDomainConfigError {
514 UnknownValue(serde_json::Value),
515}
516
517#[derive(Debug, Clone, Serialize, Deserialize)]
519#[serde(untagged)]
520pub enum DeletePageError {
521 UnknownValue(serde_json::Value),
522}
523
524#[derive(Debug, Clone, Serialize, Deserialize)]
526#[serde(untagged)]
527pub enum DeleteSsoUserError {
528 UnknownValue(serde_json::Value),
529}
530
531#[derive(Debug, Clone, Serialize, Deserialize)]
533#[serde(untagged)]
534pub enum DeleteSubscriptionError {
535 UnknownValue(serde_json::Value),
536}
537
538#[derive(Debug, Clone, Serialize, Deserialize)]
540#[serde(untagged)]
541pub enum DeleteUserBadgeError {
542 UnknownValue(serde_json::Value),
543}
544
545#[derive(Debug, Clone, Serialize, Deserialize)]
547#[serde(untagged)]
548pub enum FlagCommentError {
549 UnknownValue(serde_json::Value),
550}
551
552#[derive(Debug, Clone, Serialize, Deserialize)]
554#[serde(untagged)]
555pub enum GetAuditLogsError {
556 UnknownValue(serde_json::Value),
557}
558
559#[derive(Debug, Clone, Serialize, Deserialize)]
561#[serde(untagged)]
562pub enum GetCommentError {
563 UnknownValue(serde_json::Value),
564}
565
566#[derive(Debug, Clone, Serialize, Deserialize)]
568#[serde(untagged)]
569pub enum GetCommentsError {
570 UnknownValue(serde_json::Value),
571}
572
573#[derive(Debug, Clone, Serialize, Deserialize)]
575#[serde(untagged)]
576pub enum GetDomainConfigError {
577 UnknownValue(serde_json::Value),
578}
579
580#[derive(Debug, Clone, Serialize, Deserialize)]
582#[serde(untagged)]
583pub enum GetDomainConfigsError {
584 UnknownValue(serde_json::Value),
585}
586
587#[derive(Debug, Clone, Serialize, Deserialize)]
589#[serde(untagged)]
590pub enum GetFeedPostsError {
591 UnknownValue(serde_json::Value),
592}
593
594#[derive(Debug, Clone, Serialize, Deserialize)]
596#[serde(untagged)]
597pub enum GetPageByUrlidError {
598 UnknownValue(serde_json::Value),
599}
600
601#[derive(Debug, Clone, Serialize, Deserialize)]
603#[serde(untagged)]
604pub enum GetPagesError {
605 UnknownValue(serde_json::Value),
606}
607
608#[derive(Debug, Clone, Serialize, Deserialize)]
610#[serde(untagged)]
611pub enum GetSsoUserByEmailError {
612 UnknownValue(serde_json::Value),
613}
614
615#[derive(Debug, Clone, Serialize, Deserialize)]
617#[serde(untagged)]
618pub enum GetSsoUserByIdError {
619 UnknownValue(serde_json::Value),
620}
621
622#[derive(Debug, Clone, Serialize, Deserialize)]
624#[serde(untagged)]
625pub enum GetSsoUsersError {
626 UnknownValue(serde_json::Value),
627}
628
629#[derive(Debug, Clone, Serialize, Deserialize)]
631#[serde(untagged)]
632pub enum GetSubscriptionsError {
633 UnknownValue(serde_json::Value),
634}
635
636#[derive(Debug, Clone, Serialize, Deserialize)]
638#[serde(untagged)]
639pub enum GetUserBadgeError {
640 UnknownValue(serde_json::Value),
641}
642
643#[derive(Debug, Clone, Serialize, Deserialize)]
645#[serde(untagged)]
646pub enum GetUserBadgeProgressByIdError {
647 UnknownValue(serde_json::Value),
648}
649
650#[derive(Debug, Clone, Serialize, Deserialize)]
652#[serde(untagged)]
653pub enum GetUserBadgeProgressByUserIdError {
654 UnknownValue(serde_json::Value),
655}
656
657#[derive(Debug, Clone, Serialize, Deserialize)]
659#[serde(untagged)]
660pub enum GetUserBadgeProgressListError {
661 UnknownValue(serde_json::Value),
662}
663
664#[derive(Debug, Clone, Serialize, Deserialize)]
666#[serde(untagged)]
667pub enum GetUserBadgesError {
668 UnknownValue(serde_json::Value),
669}
670
671#[derive(Debug, Clone, Serialize, Deserialize)]
673#[serde(untagged)]
674pub enum PatchDomainConfigError {
675 UnknownValue(serde_json::Value),
676}
677
678#[derive(Debug, Clone, Serialize, Deserialize)]
680#[serde(untagged)]
681pub enum PatchPageError {
682 UnknownValue(serde_json::Value),
683}
684
685#[derive(Debug, Clone, Serialize, Deserialize)]
687#[serde(untagged)]
688pub enum PatchSsoUserError {
689 UnknownValue(serde_json::Value),
690}
691
692#[derive(Debug, Clone, Serialize, Deserialize)]
694#[serde(untagged)]
695pub enum PutDomainConfigError {
696 UnknownValue(serde_json::Value),
697}
698
699#[derive(Debug, Clone, Serialize, Deserialize)]
701#[serde(untagged)]
702pub enum PutSsoUserError {
703 UnknownValue(serde_json::Value),
704}
705
706#[derive(Debug, Clone, Serialize, Deserialize)]
708#[serde(untagged)]
709pub enum SaveCommentError {
710 UnknownValue(serde_json::Value),
711}
712
713#[derive(Debug, Clone, Serialize, Deserialize)]
715#[serde(untagged)]
716pub enum SaveCommentsBulkError {
717 UnknownValue(serde_json::Value),
718}
719
720#[derive(Debug, Clone, Serialize, Deserialize)]
722#[serde(untagged)]
723pub enum UnBlockUserFromCommentError {
724 UnknownValue(serde_json::Value),
725}
726
727#[derive(Debug, Clone, Serialize, Deserialize)]
729#[serde(untagged)]
730pub enum UnFlagCommentError {
731 UnknownValue(serde_json::Value),
732}
733
734#[derive(Debug, Clone, Serialize, Deserialize)]
736#[serde(untagged)]
737pub enum UpdateCommentError {
738 UnknownValue(serde_json::Value),
739}
740
741#[derive(Debug, Clone, Serialize, Deserialize)]
743#[serde(untagged)]
744pub enum UpdateFeedPostError {
745 UnknownValue(serde_json::Value),
746}
747
748#[derive(Debug, Clone, Serialize, Deserialize)]
750#[serde(untagged)]
751pub enum UpdateUserBadgeError {
752 UnknownValue(serde_json::Value),
753}
754
755
756pub async fn add_domain_config(configuration: &configuration::Configuration, params: AddDomainConfigParams) -> Result<models::AddDomainConfig200Response, Error<AddDomainConfigError>> {
757
758 let uri_str = format!("{}/api/v1/domain-configs", configuration.base_path);
759 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
760
761 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
762 if let Some(ref user_agent) = configuration.user_agent {
763 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
764 }
765 if let Some(ref apikey) = configuration.api_key {
766 let key = apikey.key.clone();
767 let value = match apikey.prefix {
768 Some(ref prefix) => format!("{} {}", prefix, key),
769 None => key,
770 };
771 req_builder = req_builder.header("x-api-key", value);
772 };
773 req_builder = req_builder.json(¶ms.add_domain_config_params);
774
775 let req = req_builder.build()?;
776 let resp = configuration.client.execute(req).await?;
777
778 let status = resp.status();
779
780 if !status.is_client_error() && !status.is_server_error() {
781 let content = resp.text().await?;
782 serde_json::from_str(&content).map_err(Error::from)
783 } else {
784 let content = resp.text().await?;
785 let entity: Option<AddDomainConfigError> = serde_json::from_str(&content).ok();
786 Err(Error::ResponseError(ResponseContent { status, content, entity }))
787 }
788}
789
790pub async fn add_page(configuration: &configuration::Configuration, params: AddPageParams) -> Result<models::AddPageApiResponse, Error<AddPageError>> {
791
792 let uri_str = format!("{}/api/v1/pages", configuration.base_path);
793 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
794
795 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
796 if let Some(ref user_agent) = configuration.user_agent {
797 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
798 }
799 if let Some(ref apikey) = configuration.api_key {
800 let key = apikey.key.clone();
801 let value = match apikey.prefix {
802 Some(ref prefix) => format!("{} {}", prefix, key),
803 None => key,
804 };
805 req_builder = req_builder.header("x-api-key", value);
806 };
807 req_builder = req_builder.json(¶ms.create_api_page_data);
808
809 let req = req_builder.build()?;
810 let resp = configuration.client.execute(req).await?;
811
812 let status = resp.status();
813
814 if !status.is_client_error() && !status.is_server_error() {
815 let content = resp.text().await?;
816 serde_json::from_str(&content).map_err(Error::from)
817 } else {
818 let content = resp.text().await?;
819 let entity: Option<AddPageError> = serde_json::from_str(&content).ok();
820 Err(Error::ResponseError(ResponseContent { status, content, entity }))
821 }
822}
823
824pub async fn add_sso_user(configuration: &configuration::Configuration, params: AddSsoUserParams) -> Result<models::AddSsoUserApiResponse, Error<AddSsoUserError>> {
825
826 let uri_str = format!("{}/api/v1/sso-users", configuration.base_path);
827 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
828
829 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
830 if let Some(ref user_agent) = configuration.user_agent {
831 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
832 }
833 if let Some(ref apikey) = configuration.api_key {
834 let key = apikey.key.clone();
835 let value = match apikey.prefix {
836 Some(ref prefix) => format!("{} {}", prefix, key),
837 None => key,
838 };
839 req_builder = req_builder.header("x-api-key", value);
840 };
841 req_builder = req_builder.json(¶ms.create_apisso_user_data);
842
843 let req = req_builder.build()?;
844 let resp = configuration.client.execute(req).await?;
845
846 let status = resp.status();
847
848 if !status.is_client_error() && !status.is_server_error() {
849 let content = resp.text().await?;
850 serde_json::from_str(&content).map_err(Error::from)
851 } else {
852 let content = resp.text().await?;
853 let entity: Option<AddSsoUserError> = serde_json::from_str(&content).ok();
854 Err(Error::ResponseError(ResponseContent { status, content, entity }))
855 }
856}
857
858pub async fn aggregate(configuration: &configuration::Configuration, params: AggregateParams) -> Result<models::AggregationResponse, Error<AggregateError>> {
860
861 let uri_str = format!("{}/api/v1/aggregate", configuration.base_path);
862 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
863
864 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
865 if let Some(ref param_value) = params.parent_tenant_id {
866 req_builder = req_builder.query(&[("parentTenantId", ¶m_value.to_string())]);
867 }
868 if let Some(ref param_value) = params.include_stats {
869 req_builder = req_builder.query(&[("includeStats", ¶m_value.to_string())]);
870 }
871 if let Some(ref user_agent) = configuration.user_agent {
872 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
873 }
874 if let Some(ref apikey) = configuration.api_key {
875 let key = apikey.key.clone();
876 let value = match apikey.prefix {
877 Some(ref prefix) => format!("{} {}", prefix, key),
878 None => key,
879 };
880 req_builder = req_builder.header("x-api-key", value);
881 };
882 req_builder = req_builder.json(¶ms.aggregation_request);
883
884 let req = req_builder.build()?;
885 let resp = configuration.client.execute(req).await?;
886
887 let status = resp.status();
888
889 if !status.is_client_error() && !status.is_server_error() {
890 let content = resp.text().await?;
891 serde_json::from_str(&content).map_err(Error::from)
892 } else {
893 let content = resp.text().await?;
894 let entity: Option<AggregateError> = serde_json::from_str(&content).ok();
895 Err(Error::ResponseError(ResponseContent { status, content, entity }))
896 }
897}
898
899pub async fn aggregate_question_results(configuration: &configuration::Configuration, params: AggregateQuestionResultsParams) -> Result<models::AggregateQuestionResults200Response, Error<AggregateQuestionResultsError>> {
900
901 let uri_str = format!("{}/api/v1/question-results-aggregation", configuration.base_path);
902 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
903
904 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
905 if let Some(ref param_value) = params.question_id {
906 req_builder = req_builder.query(&[("questionId", ¶m_value.to_string())]);
907 }
908 if let Some(ref param_value) = params.question_ids {
909 req_builder = match "multi" {
910 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("questionIds".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
911 _ => req_builder.query(&[("questionIds", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
912 };
913 }
914 if let Some(ref param_value) = params.url_id {
915 req_builder = req_builder.query(&[("urlId", ¶m_value.to_string())]);
916 }
917 if let Some(ref param_value) = params.time_bucket {
918 req_builder = req_builder.query(&[("timeBucket", ¶m_value.to_string())]);
919 }
920 if let Some(ref param_value) = params.start_date {
921 req_builder = req_builder.query(&[("startDate", ¶m_value.to_string())]);
922 }
923 if let Some(ref param_value) = params.force_recalculate {
924 req_builder = req_builder.query(&[("forceRecalculate", ¶m_value.to_string())]);
925 }
926 if let Some(ref user_agent) = configuration.user_agent {
927 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
928 }
929 if let Some(ref apikey) = configuration.api_key {
930 let key = apikey.key.clone();
931 let value = match apikey.prefix {
932 Some(ref prefix) => format!("{} {}", prefix, key),
933 None => key,
934 };
935 req_builder = req_builder.header("x-api-key", value);
936 };
937
938 let req = req_builder.build()?;
939 let resp = configuration.client.execute(req).await?;
940
941 let status = resp.status();
942
943 if !status.is_client_error() && !status.is_server_error() {
944 let content = resp.text().await?;
945 serde_json::from_str(&content).map_err(Error::from)
946 } else {
947 let content = resp.text().await?;
948 let entity: Option<AggregateQuestionResultsError> = serde_json::from_str(&content).ok();
949 Err(Error::ResponseError(ResponseContent { status, content, entity }))
950 }
951}
952
953pub async fn block_user_from_comment(configuration: &configuration::Configuration, params: BlockUserFromCommentParams) -> Result<models::BlockFromCommentPublic200Response, Error<BlockUserFromCommentError>> {
954
955 let uri_str = format!("{}/api/v1/comments/{id}/block", configuration.base_path, id=crate::client::apis::urlencode(params.id));
956 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
957
958 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
959 if let Some(ref param_value) = params.user_id {
960 req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
961 }
962 if let Some(ref param_value) = params.anon_user_id {
963 req_builder = req_builder.query(&[("anonUserId", ¶m_value.to_string())]);
964 }
965 if let Some(ref user_agent) = configuration.user_agent {
966 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
967 }
968 if let Some(ref apikey) = configuration.api_key {
969 let key = apikey.key.clone();
970 let value = match apikey.prefix {
971 Some(ref prefix) => format!("{} {}", prefix, key),
972 None => key,
973 };
974 req_builder = req_builder.header("x-api-key", value);
975 };
976 req_builder = req_builder.json(¶ms.block_from_comment_params);
977
978 let req = req_builder.build()?;
979 let resp = configuration.client.execute(req).await?;
980
981 let status = resp.status();
982
983 if !status.is_client_error() && !status.is_server_error() {
984 let content = resp.text().await?;
985 serde_json::from_str(&content).map_err(Error::from)
986 } else {
987 let content = resp.text().await?;
988 let entity: Option<BlockUserFromCommentError> = serde_json::from_str(&content).ok();
989 Err(Error::ResponseError(ResponseContent { status, content, entity }))
990 }
991}
992
993pub async fn bulk_aggregate_question_results(configuration: &configuration::Configuration, params: BulkAggregateQuestionResultsParams) -> Result<models::BulkAggregateQuestionResults200Response, Error<BulkAggregateQuestionResultsError>> {
994
995 let uri_str = format!("{}/api/v1/question-results-aggregation/bulk", configuration.base_path);
996 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
997
998 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
999 if let Some(ref param_value) = params.force_recalculate {
1000 req_builder = req_builder.query(&[("forceRecalculate", ¶m_value.to_string())]);
1001 }
1002 if let Some(ref user_agent) = configuration.user_agent {
1003 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1004 }
1005 if let Some(ref apikey) = configuration.api_key {
1006 let key = apikey.key.clone();
1007 let value = match apikey.prefix {
1008 Some(ref prefix) => format!("{} {}", prefix, key),
1009 None => key,
1010 };
1011 req_builder = req_builder.header("x-api-key", value);
1012 };
1013 req_builder = req_builder.json(¶ms.bulk_aggregate_question_results_request);
1014
1015 let req = req_builder.build()?;
1016 let resp = configuration.client.execute(req).await?;
1017
1018 let status = resp.status();
1019
1020 if !status.is_client_error() && !status.is_server_error() {
1021 let content = resp.text().await?;
1022 serde_json::from_str(&content).map_err(Error::from)
1023 } else {
1024 let content = resp.text().await?;
1025 let entity: Option<BulkAggregateQuestionResultsError> = serde_json::from_str(&content).ok();
1026 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1027 }
1028}
1029
1030pub async fn combine_comments_with_question_results(configuration: &configuration::Configuration, params: CombineCommentsWithQuestionResultsParams) -> Result<models::CombineCommentsWithQuestionResults200Response, Error<CombineCommentsWithQuestionResultsError>> {
1031
1032 let uri_str = format!("{}/api/v1/question-results-aggregation/combine/comments", configuration.base_path);
1033 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1034
1035 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1036 if let Some(ref param_value) = params.question_id {
1037 req_builder = req_builder.query(&[("questionId", ¶m_value.to_string())]);
1038 }
1039 if let Some(ref param_value) = params.question_ids {
1040 req_builder = match "multi" {
1041 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("questionIds".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
1042 _ => req_builder.query(&[("questionIds", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
1043 };
1044 }
1045 if let Some(ref param_value) = params.url_id {
1046 req_builder = req_builder.query(&[("urlId", ¶m_value.to_string())]);
1047 }
1048 if let Some(ref param_value) = params.start_date {
1049 req_builder = req_builder.query(&[("startDate", ¶m_value.to_string())]);
1050 }
1051 if let Some(ref param_value) = params.force_recalculate {
1052 req_builder = req_builder.query(&[("forceRecalculate", ¶m_value.to_string())]);
1053 }
1054 if let Some(ref param_value) = params.min_value {
1055 req_builder = req_builder.query(&[("minValue", ¶m_value.to_string())]);
1056 }
1057 if let Some(ref param_value) = params.max_value {
1058 req_builder = req_builder.query(&[("maxValue", ¶m_value.to_string())]);
1059 }
1060 if let Some(ref param_value) = params.limit {
1061 req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
1062 }
1063 if let Some(ref user_agent) = configuration.user_agent {
1064 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1065 }
1066 if let Some(ref apikey) = configuration.api_key {
1067 let key = apikey.key.clone();
1068 let value = match apikey.prefix {
1069 Some(ref prefix) => format!("{} {}", prefix, key),
1070 None => key,
1071 };
1072 req_builder = req_builder.header("x-api-key", value);
1073 };
1074
1075 let req = req_builder.build()?;
1076 let resp = configuration.client.execute(req).await?;
1077
1078 let status = resp.status();
1079
1080 if !status.is_client_error() && !status.is_server_error() {
1081 let content = resp.text().await?;
1082 serde_json::from_str(&content).map_err(Error::from)
1083 } else {
1084 let content = resp.text().await?;
1085 let entity: Option<CombineCommentsWithQuestionResultsError> = serde_json::from_str(&content).ok();
1086 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1087 }
1088}
1089
1090pub async fn create_feed_post(configuration: &configuration::Configuration, params: CreateFeedPostParams) -> Result<models::CreateFeedPost200Response, Error<CreateFeedPostError>> {
1091
1092 let uri_str = format!("{}/api/v1/feed-posts", configuration.base_path);
1093 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1094
1095 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1096 if let Some(ref param_value) = params.broadcast_id {
1097 req_builder = req_builder.query(&[("broadcastId", ¶m_value.to_string())]);
1098 }
1099 if let Some(ref param_value) = params.is_live {
1100 req_builder = req_builder.query(&[("isLive", ¶m_value.to_string())]);
1101 }
1102 if let Some(ref param_value) = params.do_spam_check {
1103 req_builder = req_builder.query(&[("doSpamCheck", ¶m_value.to_string())]);
1104 }
1105 if let Some(ref param_value) = params.skip_dup_check {
1106 req_builder = req_builder.query(&[("skipDupCheck", ¶m_value.to_string())]);
1107 }
1108 if let Some(ref user_agent) = configuration.user_agent {
1109 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1110 }
1111 if let Some(ref apikey) = configuration.api_key {
1112 let key = apikey.key.clone();
1113 let value = match apikey.prefix {
1114 Some(ref prefix) => format!("{} {}", prefix, key),
1115 None => key,
1116 };
1117 req_builder = req_builder.header("x-api-key", value);
1118 };
1119 req_builder = req_builder.json(¶ms.create_feed_post_params);
1120
1121 let req = req_builder.build()?;
1122 let resp = configuration.client.execute(req).await?;
1123
1124 let status = resp.status();
1125
1126 if !status.is_client_error() && !status.is_server_error() {
1127 let content = resp.text().await?;
1128 serde_json::from_str(&content).map_err(Error::from)
1129 } else {
1130 let content = resp.text().await?;
1131 let entity: Option<CreateFeedPostError> = serde_json::from_str(&content).ok();
1132 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1133 }
1134}
1135
1136pub async fn create_subscription(configuration: &configuration::Configuration, params: CreateSubscriptionParams) -> Result<models::CreateSubscriptionApiResponse, Error<CreateSubscriptionError>> {
1137
1138 let uri_str = format!("{}/api/v1/subscriptions", configuration.base_path);
1139 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1140
1141 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1142 if let Some(ref user_agent) = configuration.user_agent {
1143 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1144 }
1145 if let Some(ref apikey) = configuration.api_key {
1146 let key = apikey.key.clone();
1147 let value = match apikey.prefix {
1148 Some(ref prefix) => format!("{} {}", prefix, key),
1149 None => key,
1150 };
1151 req_builder = req_builder.header("x-api-key", value);
1152 };
1153 req_builder = req_builder.json(¶ms.create_api_user_subscription_data);
1154
1155 let req = req_builder.build()?;
1156 let resp = configuration.client.execute(req).await?;
1157
1158 let status = resp.status();
1159
1160 if !status.is_client_error() && !status.is_server_error() {
1161 let content = resp.text().await?;
1162 serde_json::from_str(&content).map_err(Error::from)
1163 } else {
1164 let content = resp.text().await?;
1165 let entity: Option<CreateSubscriptionError> = serde_json::from_str(&content).ok();
1166 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1167 }
1168}
1169
1170pub async fn create_user_badge(configuration: &configuration::Configuration, params: CreateUserBadgeParams) -> Result<models::CreateUserBadge200Response, Error<CreateUserBadgeError>> {
1171
1172 let uri_str = format!("{}/api/v1/user-badges", configuration.base_path);
1173 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1174
1175 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1176 if let Some(ref user_agent) = configuration.user_agent {
1177 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1178 }
1179 if let Some(ref apikey) = configuration.api_key {
1180 let key = apikey.key.clone();
1181 let value = match apikey.prefix {
1182 Some(ref prefix) => format!("{} {}", prefix, key),
1183 None => key,
1184 };
1185 req_builder = req_builder.header("x-api-key", value);
1186 };
1187 req_builder = req_builder.json(¶ms.create_user_badge_params);
1188
1189 let req = req_builder.build()?;
1190 let resp = configuration.client.execute(req).await?;
1191
1192 let status = resp.status();
1193
1194 if !status.is_client_error() && !status.is_server_error() {
1195 let content = resp.text().await?;
1196 serde_json::from_str(&content).map_err(Error::from)
1197 } else {
1198 let content = resp.text().await?;
1199 let entity: Option<CreateUserBadgeError> = serde_json::from_str(&content).ok();
1200 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1201 }
1202}
1203
1204pub async fn delete_comment(configuration: &configuration::Configuration, params: DeleteCommentParams) -> Result<models::DeleteComment200Response, Error<DeleteCommentError>> {
1205
1206 let uri_str = format!("{}/api/v1/comments/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
1207 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1208
1209 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1210 if let Some(ref param_value) = params.context_user_id {
1211 req_builder = req_builder.query(&[("contextUserId", ¶m_value.to_string())]);
1212 }
1213 if let Some(ref param_value) = params.is_live {
1214 req_builder = req_builder.query(&[("isLive", ¶m_value.to_string())]);
1215 }
1216 if let Some(ref user_agent) = configuration.user_agent {
1217 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1218 }
1219 if let Some(ref apikey) = configuration.api_key {
1220 let key = apikey.key.clone();
1221 let value = match apikey.prefix {
1222 Some(ref prefix) => format!("{} {}", prefix, key),
1223 None => key,
1224 };
1225 req_builder = req_builder.header("x-api-key", value);
1226 };
1227
1228 let req = req_builder.build()?;
1229 let resp = configuration.client.execute(req).await?;
1230
1231 let status = resp.status();
1232
1233 if !status.is_client_error() && !status.is_server_error() {
1234 let content = resp.text().await?;
1235 serde_json::from_str(&content).map_err(Error::from)
1236 } else {
1237 let content = resp.text().await?;
1238 let entity: Option<DeleteCommentError> = serde_json::from_str(&content).ok();
1239 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1240 }
1241}
1242
1243pub async fn delete_domain_config(configuration: &configuration::Configuration, params: DeleteDomainConfigParams) -> Result<models::DeleteDomainConfig200Response, Error<DeleteDomainConfigError>> {
1244
1245 let uri_str = format!("{}/api/v1/domain-configs/{domain}", configuration.base_path, domain=crate::client::apis::urlencode(params.domain));
1246 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1247
1248 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1249 if let Some(ref user_agent) = configuration.user_agent {
1250 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1251 }
1252 if let Some(ref apikey) = configuration.api_key {
1253 let key = apikey.key.clone();
1254 let value = match apikey.prefix {
1255 Some(ref prefix) => format!("{} {}", prefix, key),
1256 None => key,
1257 };
1258 req_builder = req_builder.header("x-api-key", value);
1259 };
1260
1261 let req = req_builder.build()?;
1262 let resp = configuration.client.execute(req).await?;
1263
1264 let status = resp.status();
1265
1266 if !status.is_client_error() && !status.is_server_error() {
1267 let content = resp.text().await?;
1268 serde_json::from_str(&content).map_err(Error::from)
1269 } else {
1270 let content = resp.text().await?;
1271 let entity: Option<DeleteDomainConfigError> = serde_json::from_str(&content).ok();
1272 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1273 }
1274}
1275
1276pub async fn delete_page(configuration: &configuration::Configuration, params: DeletePageParams) -> Result<models::DeletePageApiResponse, Error<DeletePageError>> {
1277
1278 let uri_str = format!("{}/api/v1/pages/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
1279 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1280
1281 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1282 if let Some(ref user_agent) = configuration.user_agent {
1283 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1284 }
1285 if let Some(ref apikey) = configuration.api_key {
1286 let key = apikey.key.clone();
1287 let value = match apikey.prefix {
1288 Some(ref prefix) => format!("{} {}", prefix, key),
1289 None => key,
1290 };
1291 req_builder = req_builder.header("x-api-key", value);
1292 };
1293
1294 let req = req_builder.build()?;
1295 let resp = configuration.client.execute(req).await?;
1296
1297 let status = resp.status();
1298
1299 if !status.is_client_error() && !status.is_server_error() {
1300 let content = resp.text().await?;
1301 serde_json::from_str(&content).map_err(Error::from)
1302 } else {
1303 let content = resp.text().await?;
1304 let entity: Option<DeletePageError> = serde_json::from_str(&content).ok();
1305 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1306 }
1307}
1308
1309pub async fn delete_sso_user(configuration: &configuration::Configuration, params: DeleteSsoUserParams) -> Result<models::DeleteSsoUserApiResponse, Error<DeleteSsoUserError>> {
1310
1311 let uri_str = format!("{}/api/v1/sso-users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
1312 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1313
1314 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1315 if let Some(ref param_value) = params.delete_comments {
1316 req_builder = req_builder.query(&[("deleteComments", ¶m_value.to_string())]);
1317 }
1318 if let Some(ref param_value) = params.comment_delete_mode {
1319 req_builder = req_builder.query(&[("commentDeleteMode", ¶m_value.to_string())]);
1320 }
1321 if let Some(ref user_agent) = configuration.user_agent {
1322 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1323 }
1324 if let Some(ref apikey) = configuration.api_key {
1325 let key = apikey.key.clone();
1326 let value = match apikey.prefix {
1327 Some(ref prefix) => format!("{} {}", prefix, key),
1328 None => key,
1329 };
1330 req_builder = req_builder.header("x-api-key", value);
1331 };
1332
1333 let req = req_builder.build()?;
1334 let resp = configuration.client.execute(req).await?;
1335
1336 let status = resp.status();
1337
1338 if !status.is_client_error() && !status.is_server_error() {
1339 let content = resp.text().await?;
1340 serde_json::from_str(&content).map_err(Error::from)
1341 } else {
1342 let content = resp.text().await?;
1343 let entity: Option<DeleteSsoUserError> = serde_json::from_str(&content).ok();
1344 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1345 }
1346}
1347
1348pub async fn delete_subscription(configuration: &configuration::Configuration, params: DeleteSubscriptionParams) -> Result<models::DeleteSubscriptionApiResponse, Error<DeleteSubscriptionError>> {
1349
1350 let uri_str = format!("{}/api/v1/subscriptions/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
1351 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1352
1353 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1354 if let Some(ref param_value) = params.user_id {
1355 req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
1356 }
1357 if let Some(ref user_agent) = configuration.user_agent {
1358 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1359 }
1360 if let Some(ref apikey) = configuration.api_key {
1361 let key = apikey.key.clone();
1362 let value = match apikey.prefix {
1363 Some(ref prefix) => format!("{} {}", prefix, key),
1364 None => key,
1365 };
1366 req_builder = req_builder.header("x-api-key", value);
1367 };
1368
1369 let req = req_builder.build()?;
1370 let resp = configuration.client.execute(req).await?;
1371
1372 let status = resp.status();
1373
1374 if !status.is_client_error() && !status.is_server_error() {
1375 let content = resp.text().await?;
1376 serde_json::from_str(&content).map_err(Error::from)
1377 } else {
1378 let content = resp.text().await?;
1379 let entity: Option<DeleteSubscriptionError> = serde_json::from_str(&content).ok();
1380 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1381 }
1382}
1383
1384pub async fn delete_user_badge(configuration: &configuration::Configuration, params: DeleteUserBadgeParams) -> Result<models::UpdateUserBadge200Response, Error<DeleteUserBadgeError>> {
1385
1386 let uri_str = format!("{}/api/v1/user-badges/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
1387 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1388
1389 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1390 if let Some(ref user_agent) = configuration.user_agent {
1391 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1392 }
1393 if let Some(ref apikey) = configuration.api_key {
1394 let key = apikey.key.clone();
1395 let value = match apikey.prefix {
1396 Some(ref prefix) => format!("{} {}", prefix, key),
1397 None => key,
1398 };
1399 req_builder = req_builder.header("x-api-key", value);
1400 };
1401
1402 let req = req_builder.build()?;
1403 let resp = configuration.client.execute(req).await?;
1404
1405 let status = resp.status();
1406
1407 if !status.is_client_error() && !status.is_server_error() {
1408 let content = resp.text().await?;
1409 serde_json::from_str(&content).map_err(Error::from)
1410 } else {
1411 let content = resp.text().await?;
1412 let entity: Option<DeleteUserBadgeError> = serde_json::from_str(&content).ok();
1413 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1414 }
1415}
1416
1417pub async fn flag_comment(configuration: &configuration::Configuration, params: FlagCommentParams) -> Result<models::FlagComment200Response, Error<FlagCommentError>> {
1418
1419 let uri_str = format!("{}/api/v1/comments/{id}/flag", configuration.base_path, id=crate::client::apis::urlencode(params.id));
1420 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1421
1422 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1423 if let Some(ref param_value) = params.user_id {
1424 req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
1425 }
1426 if let Some(ref param_value) = params.anon_user_id {
1427 req_builder = req_builder.query(&[("anonUserId", ¶m_value.to_string())]);
1428 }
1429 if let Some(ref user_agent) = configuration.user_agent {
1430 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1431 }
1432 if let Some(ref apikey) = configuration.api_key {
1433 let key = apikey.key.clone();
1434 let value = match apikey.prefix {
1435 Some(ref prefix) => format!("{} {}", prefix, key),
1436 None => key,
1437 };
1438 req_builder = req_builder.header("x-api-key", value);
1439 };
1440
1441 let req = req_builder.build()?;
1442 let resp = configuration.client.execute(req).await?;
1443
1444 let status = resp.status();
1445
1446 if !status.is_client_error() && !status.is_server_error() {
1447 let content = resp.text().await?;
1448 serde_json::from_str(&content).map_err(Error::from)
1449 } else {
1450 let content = resp.text().await?;
1451 let entity: Option<FlagCommentError> = serde_json::from_str(&content).ok();
1452 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1453 }
1454}
1455
1456pub async fn get_audit_logs(configuration: &configuration::Configuration, params: GetAuditLogsParams) -> Result<models::GetAuditLogs200Response, Error<GetAuditLogsError>> {
1457
1458 let uri_str = format!("{}/api/v1/audit-logs", configuration.base_path);
1459 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1460
1461 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1462 if let Some(ref param_value) = params.limit {
1463 req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
1464 }
1465 if let Some(ref param_value) = params.skip {
1466 req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
1467 }
1468 if let Some(ref param_value) = params.order {
1469 req_builder = req_builder.query(&[("order", ¶m_value.to_string())]);
1470 }
1471 if let Some(ref param_value) = params.after {
1472 req_builder = req_builder.query(&[("after", ¶m_value.to_string())]);
1473 }
1474 if let Some(ref param_value) = params.before {
1475 req_builder = req_builder.query(&[("before", ¶m_value.to_string())]);
1476 }
1477 if let Some(ref user_agent) = configuration.user_agent {
1478 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1479 }
1480 if let Some(ref apikey) = configuration.api_key {
1481 let key = apikey.key.clone();
1482 let value = match apikey.prefix {
1483 Some(ref prefix) => format!("{} {}", prefix, key),
1484 None => key,
1485 };
1486 req_builder = req_builder.header("x-api-key", value);
1487 };
1488
1489 let req = req_builder.build()?;
1490 let resp = configuration.client.execute(req).await?;
1491
1492 let status = resp.status();
1493
1494 if !status.is_client_error() && !status.is_server_error() {
1495 let content = resp.text().await?;
1496 serde_json::from_str(&content).map_err(Error::from)
1497 } else {
1498 let content = resp.text().await?;
1499 let entity: Option<GetAuditLogsError> = serde_json::from_str(&content).ok();
1500 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1501 }
1502}
1503
1504pub async fn get_comment(configuration: &configuration::Configuration, params: GetCommentParams) -> Result<models::GetComment200Response, Error<GetCommentError>> {
1505
1506 let uri_str = format!("{}/api/v1/comments/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
1507 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1508
1509 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1510 if let Some(ref user_agent) = configuration.user_agent {
1511 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1512 }
1513 if let Some(ref apikey) = configuration.api_key {
1514 let key = apikey.key.clone();
1515 let value = match apikey.prefix {
1516 Some(ref prefix) => format!("{} {}", prefix, key),
1517 None => key,
1518 };
1519 req_builder = req_builder.header("x-api-key", value);
1520 };
1521
1522 let req = req_builder.build()?;
1523 let resp = configuration.client.execute(req).await?;
1524
1525 let status = resp.status();
1526
1527 if !status.is_client_error() && !status.is_server_error() {
1528 let content = resp.text().await?;
1529 serde_json::from_str(&content).map_err(Error::from)
1530 } else {
1531 let content = resp.text().await?;
1532 let entity: Option<GetCommentError> = serde_json::from_str(&content).ok();
1533 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1534 }
1535}
1536
1537pub async fn get_comments(configuration: &configuration::Configuration, params: GetCommentsParams) -> Result<models::GetComments200Response, Error<GetCommentsError>> {
1538
1539 let uri_str = format!("{}/api/v1/comments", configuration.base_path);
1540 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1541
1542 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1543 if let Some(ref param_value) = params.page {
1544 req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
1545 }
1546 if let Some(ref param_value) = params.limit {
1547 req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
1548 }
1549 if let Some(ref param_value) = params.skip {
1550 req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
1551 }
1552 if let Some(ref param_value) = params.as_tree {
1553 req_builder = req_builder.query(&[("asTree", ¶m_value.to_string())]);
1554 }
1555 if let Some(ref param_value) = params.skip_children {
1556 req_builder = req_builder.query(&[("skipChildren", ¶m_value.to_string())]);
1557 }
1558 if let Some(ref param_value) = params.limit_children {
1559 req_builder = req_builder.query(&[("limitChildren", ¶m_value.to_string())]);
1560 }
1561 if let Some(ref param_value) = params.max_tree_depth {
1562 req_builder = req_builder.query(&[("maxTreeDepth", ¶m_value.to_string())]);
1563 }
1564 if let Some(ref param_value) = params.url_id {
1565 req_builder = req_builder.query(&[("urlId", ¶m_value.to_string())]);
1566 }
1567 if let Some(ref param_value) = params.user_id {
1568 req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
1569 }
1570 if let Some(ref param_value) = params.anon_user_id {
1571 req_builder = req_builder.query(&[("anonUserId", ¶m_value.to_string())]);
1572 }
1573 if let Some(ref param_value) = params.context_user_id {
1574 req_builder = req_builder.query(&[("contextUserId", ¶m_value.to_string())]);
1575 }
1576 if let Some(ref param_value) = params.hash_tag {
1577 req_builder = req_builder.query(&[("hashTag", ¶m_value.to_string())]);
1578 }
1579 if let Some(ref param_value) = params.parent_id {
1580 req_builder = req_builder.query(&[("parentId", ¶m_value.to_string())]);
1581 }
1582 if let Some(ref param_value) = params.direction {
1583 req_builder = req_builder.query(&[("direction", ¶m_value.to_string())]);
1584 }
1585 if let Some(ref user_agent) = configuration.user_agent {
1586 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1587 }
1588 if let Some(ref apikey) = configuration.api_key {
1589 let key = apikey.key.clone();
1590 let value = match apikey.prefix {
1591 Some(ref prefix) => format!("{} {}", prefix, key),
1592 None => key,
1593 };
1594 req_builder = req_builder.header("x-api-key", value);
1595 };
1596
1597 let req = req_builder.build()?;
1598 let resp = configuration.client.execute(req).await?;
1599
1600 let status = resp.status();
1601
1602 if !status.is_client_error() && !status.is_server_error() {
1603 let content = resp.text().await?;
1604 serde_json::from_str(&content).map_err(Error::from)
1605 } else {
1606 let content = resp.text().await?;
1607 let entity: Option<GetCommentsError> = serde_json::from_str(&content).ok();
1608 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1609 }
1610}
1611
1612pub async fn get_domain_config(configuration: &configuration::Configuration, params: GetDomainConfigParams) -> Result<models::GetDomainConfig200Response, Error<GetDomainConfigError>> {
1613
1614 let uri_str = format!("{}/api/v1/domain-configs/{domain}", configuration.base_path, domain=crate::client::apis::urlencode(params.domain));
1615 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1616
1617 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1618 if let Some(ref user_agent) = configuration.user_agent {
1619 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1620 }
1621 if let Some(ref apikey) = configuration.api_key {
1622 let key = apikey.key.clone();
1623 let value = match apikey.prefix {
1624 Some(ref prefix) => format!("{} {}", prefix, key),
1625 None => key,
1626 };
1627 req_builder = req_builder.header("x-api-key", value);
1628 };
1629
1630 let req = req_builder.build()?;
1631 let resp = configuration.client.execute(req).await?;
1632
1633 let status = resp.status();
1634
1635 if !status.is_client_error() && !status.is_server_error() {
1636 let content = resp.text().await?;
1637 serde_json::from_str(&content).map_err(Error::from)
1638 } else {
1639 let content = resp.text().await?;
1640 let entity: Option<GetDomainConfigError> = serde_json::from_str(&content).ok();
1641 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1642 }
1643}
1644
1645pub async fn get_domain_configs(configuration: &configuration::Configuration, params: GetDomainConfigsParams) -> Result<models::GetDomainConfigs200Response, Error<GetDomainConfigsError>> {
1646
1647 let uri_str = format!("{}/api/v1/domain-configs", configuration.base_path);
1648 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1649
1650 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1651 if let Some(ref user_agent) = configuration.user_agent {
1652 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1653 }
1654 if let Some(ref apikey) = configuration.api_key {
1655 let key = apikey.key.clone();
1656 let value = match apikey.prefix {
1657 Some(ref prefix) => format!("{} {}", prefix, key),
1658 None => key,
1659 };
1660 req_builder = req_builder.header("x-api-key", value);
1661 };
1662
1663 let req = req_builder.build()?;
1664 let resp = configuration.client.execute(req).await?;
1665
1666 let status = resp.status();
1667
1668 if !status.is_client_error() && !status.is_server_error() {
1669 let content = resp.text().await?;
1670 serde_json::from_str(&content).map_err(Error::from)
1671 } else {
1672 let content = resp.text().await?;
1673 let entity: Option<GetDomainConfigsError> = serde_json::from_str(&content).ok();
1674 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1675 }
1676}
1677
1678pub async fn get_feed_posts(configuration: &configuration::Configuration, params: GetFeedPostsParams) -> Result<models::GetFeedPosts200Response, Error<GetFeedPostsError>> {
1680
1681 let uri_str = format!("{}/api/v1/feed-posts", configuration.base_path);
1682 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1683
1684 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1685 if let Some(ref param_value) = params.after_id {
1686 req_builder = req_builder.query(&[("afterId", ¶m_value.to_string())]);
1687 }
1688 if let Some(ref param_value) = params.limit {
1689 req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
1690 }
1691 if let Some(ref param_value) = params.tags {
1692 req_builder = match "multi" {
1693 "multi" => req_builder.query(¶m_value.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
1694 _ => req_builder.query(&[("tags", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
1695 };
1696 }
1697 if let Some(ref user_agent) = configuration.user_agent {
1698 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1699 }
1700 if let Some(ref apikey) = configuration.api_key {
1701 let key = apikey.key.clone();
1702 let value = match apikey.prefix {
1703 Some(ref prefix) => format!("{} {}", prefix, key),
1704 None => key,
1705 };
1706 req_builder = req_builder.header("x-api-key", value);
1707 };
1708
1709 let req = req_builder.build()?;
1710 let resp = configuration.client.execute(req).await?;
1711
1712 let status = resp.status();
1713
1714 if !status.is_client_error() && !status.is_server_error() {
1715 let content = resp.text().await?;
1716 serde_json::from_str(&content).map_err(Error::from)
1717 } else {
1718 let content = resp.text().await?;
1719 let entity: Option<GetFeedPostsError> = serde_json::from_str(&content).ok();
1720 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1721 }
1722}
1723
1724pub async fn get_page_by_urlid(configuration: &configuration::Configuration, params: GetPageByUrlidParams) -> Result<models::GetPageByUrlidApiResponse, Error<GetPageByUrlidError>> {
1725
1726 let uri_str = format!("{}/api/v1/pages/by-url-id", configuration.base_path);
1727 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1728
1729 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1730 req_builder = req_builder.query(&[("urlId", ¶ms.url_id.to_string())]);
1731 if let Some(ref user_agent) = configuration.user_agent {
1732 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1733 }
1734 if let Some(ref apikey) = configuration.api_key {
1735 let key = apikey.key.clone();
1736 let value = match apikey.prefix {
1737 Some(ref prefix) => format!("{} {}", prefix, key),
1738 None => key,
1739 };
1740 req_builder = req_builder.header("x-api-key", value);
1741 };
1742
1743 let req = req_builder.build()?;
1744 let resp = configuration.client.execute(req).await?;
1745
1746 let status = resp.status();
1747
1748 if !status.is_client_error() && !status.is_server_error() {
1749 let content = resp.text().await?;
1750 serde_json::from_str(&content).map_err(Error::from)
1751 } else {
1752 let content = resp.text().await?;
1753 let entity: Option<GetPageByUrlidError> = serde_json::from_str(&content).ok();
1754 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1755 }
1756}
1757
1758pub async fn get_pages(configuration: &configuration::Configuration, params: GetPagesParams) -> Result<models::GetPagesApiResponse, Error<GetPagesError>> {
1759
1760 let uri_str = format!("{}/api/v1/pages", configuration.base_path);
1761 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1762
1763 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1764 if let Some(ref user_agent) = configuration.user_agent {
1765 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1766 }
1767 if let Some(ref apikey) = configuration.api_key {
1768 let key = apikey.key.clone();
1769 let value = match apikey.prefix {
1770 Some(ref prefix) => format!("{} {}", prefix, key),
1771 None => key,
1772 };
1773 req_builder = req_builder.header("x-api-key", value);
1774 };
1775
1776 let req = req_builder.build()?;
1777 let resp = configuration.client.execute(req).await?;
1778
1779 let status = resp.status();
1780
1781 if !status.is_client_error() && !status.is_server_error() {
1782 let content = resp.text().await?;
1783 serde_json::from_str(&content).map_err(Error::from)
1784 } else {
1785 let content = resp.text().await?;
1786 let entity: Option<GetPagesError> = serde_json::from_str(&content).ok();
1787 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1788 }
1789}
1790
1791pub async fn get_sso_user_by_email(configuration: &configuration::Configuration, params: GetSsoUserByEmailParams) -> Result<models::GetSsoUserByEmailApiResponse, Error<GetSsoUserByEmailError>> {
1792
1793 let uri_str = format!("{}/api/v1/sso-users/by-email/{email}", configuration.base_path, email=crate::client::apis::urlencode(params.email));
1794 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1795
1796 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1797 if let Some(ref user_agent) = configuration.user_agent {
1798 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1799 }
1800 if let Some(ref apikey) = configuration.api_key {
1801 let key = apikey.key.clone();
1802 let value = match apikey.prefix {
1803 Some(ref prefix) => format!("{} {}", prefix, key),
1804 None => key,
1805 };
1806 req_builder = req_builder.header("x-api-key", value);
1807 };
1808
1809 let req = req_builder.build()?;
1810 let resp = configuration.client.execute(req).await?;
1811
1812 let status = resp.status();
1813
1814 if !status.is_client_error() && !status.is_server_error() {
1815 let content = resp.text().await?;
1816 serde_json::from_str(&content).map_err(Error::from)
1817 } else {
1818 let content = resp.text().await?;
1819 let entity: Option<GetSsoUserByEmailError> = serde_json::from_str(&content).ok();
1820 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1821 }
1822}
1823
1824pub async fn get_sso_user_by_id(configuration: &configuration::Configuration, params: GetSsoUserByIdParams) -> Result<models::GetSsoUserByIdApiResponse, Error<GetSsoUserByIdError>> {
1825
1826 let uri_str = format!("{}/api/v1/sso-users/by-id/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
1827 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1828
1829 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1830 if let Some(ref user_agent) = configuration.user_agent {
1831 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1832 }
1833 if let Some(ref apikey) = configuration.api_key {
1834 let key = apikey.key.clone();
1835 let value = match apikey.prefix {
1836 Some(ref prefix) => format!("{} {}", prefix, key),
1837 None => key,
1838 };
1839 req_builder = req_builder.header("x-api-key", value);
1840 };
1841
1842 let req = req_builder.build()?;
1843 let resp = configuration.client.execute(req).await?;
1844
1845 let status = resp.status();
1846
1847 if !status.is_client_error() && !status.is_server_error() {
1848 let content = resp.text().await?;
1849 serde_json::from_str(&content).map_err(Error::from)
1850 } else {
1851 let content = resp.text().await?;
1852 let entity: Option<GetSsoUserByIdError> = serde_json::from_str(&content).ok();
1853 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1854 }
1855}
1856
1857pub async fn get_sso_users(configuration: &configuration::Configuration, params: GetSsoUsersParams) -> Result<models::GetSsoUsers200Response, Error<GetSsoUsersError>> {
1858
1859 let uri_str = format!("{}/api/v1/sso-users", configuration.base_path);
1860 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1861
1862 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1863 if let Some(ref param_value) = params.skip {
1864 req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
1865 }
1866 if let Some(ref user_agent) = configuration.user_agent {
1867 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1868 }
1869 if let Some(ref apikey) = configuration.api_key {
1870 let key = apikey.key.clone();
1871 let value = match apikey.prefix {
1872 Some(ref prefix) => format!("{} {}", prefix, key),
1873 None => key,
1874 };
1875 req_builder = req_builder.header("x-api-key", value);
1876 };
1877
1878 let req = req_builder.build()?;
1879 let resp = configuration.client.execute(req).await?;
1880
1881 let status = resp.status();
1882
1883 if !status.is_client_error() && !status.is_server_error() {
1884 let content = resp.text().await?;
1885 serde_json::from_str(&content).map_err(Error::from)
1886 } else {
1887 let content = resp.text().await?;
1888 let entity: Option<GetSsoUsersError> = serde_json::from_str(&content).ok();
1889 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1890 }
1891}
1892
1893pub async fn get_subscriptions(configuration: &configuration::Configuration, params: GetSubscriptionsParams) -> Result<models::GetSubscriptionsApiResponse, Error<GetSubscriptionsError>> {
1894
1895 let uri_str = format!("{}/api/v1/subscriptions", configuration.base_path);
1896 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1897
1898 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1899 if let Some(ref param_value) = params.user_id {
1900 req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
1901 }
1902 if let Some(ref user_agent) = configuration.user_agent {
1903 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1904 }
1905 if let Some(ref apikey) = configuration.api_key {
1906 let key = apikey.key.clone();
1907 let value = match apikey.prefix {
1908 Some(ref prefix) => format!("{} {}", prefix, key),
1909 None => key,
1910 };
1911 req_builder = req_builder.header("x-api-key", value);
1912 };
1913
1914 let req = req_builder.build()?;
1915 let resp = configuration.client.execute(req).await?;
1916
1917 let status = resp.status();
1918
1919 if !status.is_client_error() && !status.is_server_error() {
1920 let content = resp.text().await?;
1921 serde_json::from_str(&content).map_err(Error::from)
1922 } else {
1923 let content = resp.text().await?;
1924 let entity: Option<GetSubscriptionsError> = serde_json::from_str(&content).ok();
1925 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1926 }
1927}
1928
1929pub async fn get_user_badge(configuration: &configuration::Configuration, params: GetUserBadgeParams) -> Result<models::GetUserBadge200Response, Error<GetUserBadgeError>> {
1930
1931 let uri_str = format!("{}/api/v1/user-badges/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
1932 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1933
1934 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1935 if let Some(ref user_agent) = configuration.user_agent {
1936 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1937 }
1938 if let Some(ref apikey) = configuration.api_key {
1939 let key = apikey.key.clone();
1940 let value = match apikey.prefix {
1941 Some(ref prefix) => format!("{} {}", prefix, key),
1942 None => key,
1943 };
1944 req_builder = req_builder.header("x-api-key", value);
1945 };
1946
1947 let req = req_builder.build()?;
1948 let resp = configuration.client.execute(req).await?;
1949
1950 let status = resp.status();
1951
1952 if !status.is_client_error() && !status.is_server_error() {
1953 let content = resp.text().await?;
1954 serde_json::from_str(&content).map_err(Error::from)
1955 } else {
1956 let content = resp.text().await?;
1957 let entity: Option<GetUserBadgeError> = serde_json::from_str(&content).ok();
1958 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1959 }
1960}
1961
1962pub async fn get_user_badge_progress_by_id(configuration: &configuration::Configuration, params: GetUserBadgeProgressByIdParams) -> Result<models::GetUserBadgeProgressById200Response, Error<GetUserBadgeProgressByIdError>> {
1963
1964 let uri_str = format!("{}/api/v1/user-badge-progress/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
1965 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1966
1967 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
1968 if let Some(ref user_agent) = configuration.user_agent {
1969 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1970 }
1971 if let Some(ref apikey) = configuration.api_key {
1972 let key = apikey.key.clone();
1973 let value = match apikey.prefix {
1974 Some(ref prefix) => format!("{} {}", prefix, key),
1975 None => key,
1976 };
1977 req_builder = req_builder.header("x-api-key", value);
1978 };
1979
1980 let req = req_builder.build()?;
1981 let resp = configuration.client.execute(req).await?;
1982
1983 let status = resp.status();
1984
1985 if !status.is_client_error() && !status.is_server_error() {
1986 let content = resp.text().await?;
1987 serde_json::from_str(&content).map_err(Error::from)
1988 } else {
1989 let content = resp.text().await?;
1990 let entity: Option<GetUserBadgeProgressByIdError> = serde_json::from_str(&content).ok();
1991 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1992 }
1993}
1994
1995pub async fn get_user_badge_progress_by_user_id(configuration: &configuration::Configuration, params: GetUserBadgeProgressByUserIdParams) -> Result<models::GetUserBadgeProgressById200Response, Error<GetUserBadgeProgressByUserIdError>> {
1996
1997 let uri_str = format!("{}/api/v1/user-badge-progress/user/{userId}", configuration.base_path, userId=crate::client::apis::urlencode(params.user_id));
1998 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1999
2000 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
2001 if let Some(ref user_agent) = configuration.user_agent {
2002 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2003 }
2004 if let Some(ref apikey) = configuration.api_key {
2005 let key = apikey.key.clone();
2006 let value = match apikey.prefix {
2007 Some(ref prefix) => format!("{} {}", prefix, key),
2008 None => key,
2009 };
2010 req_builder = req_builder.header("x-api-key", value);
2011 };
2012
2013 let req = req_builder.build()?;
2014 let resp = configuration.client.execute(req).await?;
2015
2016 let status = resp.status();
2017
2018 if !status.is_client_error() && !status.is_server_error() {
2019 let content = resp.text().await?;
2020 serde_json::from_str(&content).map_err(Error::from)
2021 } else {
2022 let content = resp.text().await?;
2023 let entity: Option<GetUserBadgeProgressByUserIdError> = serde_json::from_str(&content).ok();
2024 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2025 }
2026}
2027
2028pub async fn get_user_badge_progress_list(configuration: &configuration::Configuration, params: GetUserBadgeProgressListParams) -> Result<models::GetUserBadgeProgressList200Response, Error<GetUserBadgeProgressListError>> {
2029
2030 let uri_str = format!("{}/api/v1/user-badge-progress", configuration.base_path);
2031 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2032
2033 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
2034 if let Some(ref param_value) = params.user_id {
2035 req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
2036 }
2037 if let Some(ref param_value) = params.limit {
2038 req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
2039 }
2040 if let Some(ref param_value) = params.skip {
2041 req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
2042 }
2043 if let Some(ref user_agent) = configuration.user_agent {
2044 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2045 }
2046 if let Some(ref apikey) = configuration.api_key {
2047 let key = apikey.key.clone();
2048 let value = match apikey.prefix {
2049 Some(ref prefix) => format!("{} {}", prefix, key),
2050 None => key,
2051 };
2052 req_builder = req_builder.header("x-api-key", value);
2053 };
2054
2055 let req = req_builder.build()?;
2056 let resp = configuration.client.execute(req).await?;
2057
2058 let status = resp.status();
2059
2060 if !status.is_client_error() && !status.is_server_error() {
2061 let content = resp.text().await?;
2062 serde_json::from_str(&content).map_err(Error::from)
2063 } else {
2064 let content = resp.text().await?;
2065 let entity: Option<GetUserBadgeProgressListError> = serde_json::from_str(&content).ok();
2066 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2067 }
2068}
2069
2070pub async fn get_user_badges(configuration: &configuration::Configuration, params: GetUserBadgesParams) -> Result<models::GetUserBadges200Response, Error<GetUserBadgesError>> {
2071
2072 let uri_str = format!("{}/api/v1/user-badges", configuration.base_path);
2073 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2074
2075 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
2076 if let Some(ref param_value) = params.user_id {
2077 req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
2078 }
2079 if let Some(ref param_value) = params.badge_id {
2080 req_builder = req_builder.query(&[("badgeId", ¶m_value.to_string())]);
2081 }
2082 if let Some(ref param_value) = params.r#type {
2083 req_builder = req_builder.query(&[("type", ¶m_value.to_string())]);
2084 }
2085 if let Some(ref param_value) = params.displayed_on_comments {
2086 req_builder = req_builder.query(&[("displayedOnComments", ¶m_value.to_string())]);
2087 }
2088 if let Some(ref param_value) = params.limit {
2089 req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
2090 }
2091 if let Some(ref param_value) = params.skip {
2092 req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
2093 }
2094 if let Some(ref user_agent) = configuration.user_agent {
2095 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2096 }
2097 if let Some(ref apikey) = configuration.api_key {
2098 let key = apikey.key.clone();
2099 let value = match apikey.prefix {
2100 Some(ref prefix) => format!("{} {}", prefix, key),
2101 None => key,
2102 };
2103 req_builder = req_builder.header("x-api-key", value);
2104 };
2105
2106 let req = req_builder.build()?;
2107 let resp = configuration.client.execute(req).await?;
2108
2109 let status = resp.status();
2110
2111 if !status.is_client_error() && !status.is_server_error() {
2112 let content = resp.text().await?;
2113 serde_json::from_str(&content).map_err(Error::from)
2114 } else {
2115 let content = resp.text().await?;
2116 let entity: Option<GetUserBadgesError> = serde_json::from_str(&content).ok();
2117 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2118 }
2119}
2120
2121pub async fn patch_domain_config(configuration: &configuration::Configuration, params: PatchDomainConfigParams) -> Result<models::GetDomainConfig200Response, Error<PatchDomainConfigError>> {
2122
2123 let uri_str = format!("{}/api/v1/domain-configs/{domainToUpdate}", configuration.base_path, domainToUpdate=crate::client::apis::urlencode(params.domain_to_update));
2124 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2125
2126 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
2127 if let Some(ref user_agent) = configuration.user_agent {
2128 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2129 }
2130 if let Some(ref apikey) = configuration.api_key {
2131 let key = apikey.key.clone();
2132 let value = match apikey.prefix {
2133 Some(ref prefix) => format!("{} {}", prefix, key),
2134 None => key,
2135 };
2136 req_builder = req_builder.header("x-api-key", value);
2137 };
2138 req_builder = req_builder.json(¶ms.patch_domain_config_params);
2139
2140 let req = req_builder.build()?;
2141 let resp = configuration.client.execute(req).await?;
2142
2143 let status = resp.status();
2144
2145 if !status.is_client_error() && !status.is_server_error() {
2146 let content = resp.text().await?;
2147 serde_json::from_str(&content).map_err(Error::from)
2148 } else {
2149 let content = resp.text().await?;
2150 let entity: Option<PatchDomainConfigError> = serde_json::from_str(&content).ok();
2151 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2152 }
2153}
2154
2155pub async fn patch_page(configuration: &configuration::Configuration, params: PatchPageParams) -> Result<models::PatchPageApiResponse, Error<PatchPageError>> {
2156
2157 let uri_str = format!("{}/api/v1/pages/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
2158 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2159
2160 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
2161 if let Some(ref user_agent) = configuration.user_agent {
2162 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2163 }
2164 if let Some(ref apikey) = configuration.api_key {
2165 let key = apikey.key.clone();
2166 let value = match apikey.prefix {
2167 Some(ref prefix) => format!("{} {}", prefix, key),
2168 None => key,
2169 };
2170 req_builder = req_builder.header("x-api-key", value);
2171 };
2172 req_builder = req_builder.json(¶ms.update_api_page_data);
2173
2174 let req = req_builder.build()?;
2175 let resp = configuration.client.execute(req).await?;
2176
2177 let status = resp.status();
2178
2179 if !status.is_client_error() && !status.is_server_error() {
2180 let content = resp.text().await?;
2181 serde_json::from_str(&content).map_err(Error::from)
2182 } else {
2183 let content = resp.text().await?;
2184 let entity: Option<PatchPageError> = serde_json::from_str(&content).ok();
2185 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2186 }
2187}
2188
2189pub async fn patch_sso_user(configuration: &configuration::Configuration, params: PatchSsoUserParams) -> Result<models::PatchSsoUserApiResponse, Error<PatchSsoUserError>> {
2190
2191 let uri_str = format!("{}/api/v1/sso-users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
2192 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2193
2194 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
2195 if let Some(ref param_value) = params.update_comments {
2196 req_builder = req_builder.query(&[("updateComments", ¶m_value.to_string())]);
2197 }
2198 if let Some(ref user_agent) = configuration.user_agent {
2199 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2200 }
2201 if let Some(ref apikey) = configuration.api_key {
2202 let key = apikey.key.clone();
2203 let value = match apikey.prefix {
2204 Some(ref prefix) => format!("{} {}", prefix, key),
2205 None => key,
2206 };
2207 req_builder = req_builder.header("x-api-key", value);
2208 };
2209 req_builder = req_builder.json(¶ms.update_apisso_user_data);
2210
2211 let req = req_builder.build()?;
2212 let resp = configuration.client.execute(req).await?;
2213
2214 let status = resp.status();
2215
2216 if !status.is_client_error() && !status.is_server_error() {
2217 let content = resp.text().await?;
2218 serde_json::from_str(&content).map_err(Error::from)
2219 } else {
2220 let content = resp.text().await?;
2221 let entity: Option<PatchSsoUserError> = serde_json::from_str(&content).ok();
2222 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2223 }
2224}
2225
2226pub async fn put_domain_config(configuration: &configuration::Configuration, params: PutDomainConfigParams) -> Result<models::GetDomainConfig200Response, Error<PutDomainConfigError>> {
2227
2228 let uri_str = format!("{}/api/v1/domain-configs/{domainToUpdate}", configuration.base_path, domainToUpdate=crate::client::apis::urlencode(params.domain_to_update));
2229 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2230
2231 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
2232 if let Some(ref user_agent) = configuration.user_agent {
2233 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2234 }
2235 if let Some(ref apikey) = configuration.api_key {
2236 let key = apikey.key.clone();
2237 let value = match apikey.prefix {
2238 Some(ref prefix) => format!("{} {}", prefix, key),
2239 None => key,
2240 };
2241 req_builder = req_builder.header("x-api-key", value);
2242 };
2243 req_builder = req_builder.json(¶ms.update_domain_config_params);
2244
2245 let req = req_builder.build()?;
2246 let resp = configuration.client.execute(req).await?;
2247
2248 let status = resp.status();
2249
2250 if !status.is_client_error() && !status.is_server_error() {
2251 let content = resp.text().await?;
2252 serde_json::from_str(&content).map_err(Error::from)
2253 } else {
2254 let content = resp.text().await?;
2255 let entity: Option<PutDomainConfigError> = serde_json::from_str(&content).ok();
2256 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2257 }
2258}
2259
2260pub async fn put_sso_user(configuration: &configuration::Configuration, params: PutSsoUserParams) -> Result<models::PutSsoUserApiResponse, Error<PutSsoUserError>> {
2261
2262 let uri_str = format!("{}/api/v1/sso-users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
2263 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2264
2265 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
2266 if let Some(ref param_value) = params.update_comments {
2267 req_builder = req_builder.query(&[("updateComments", ¶m_value.to_string())]);
2268 }
2269 if let Some(ref user_agent) = configuration.user_agent {
2270 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2271 }
2272 if let Some(ref apikey) = configuration.api_key {
2273 let key = apikey.key.clone();
2274 let value = match apikey.prefix {
2275 Some(ref prefix) => format!("{} {}", prefix, key),
2276 None => key,
2277 };
2278 req_builder = req_builder.header("x-api-key", value);
2279 };
2280 req_builder = req_builder.json(¶ms.update_apisso_user_data);
2281
2282 let req = req_builder.build()?;
2283 let resp = configuration.client.execute(req).await?;
2284
2285 let status = resp.status();
2286
2287 if !status.is_client_error() && !status.is_server_error() {
2288 let content = resp.text().await?;
2289 serde_json::from_str(&content).map_err(Error::from)
2290 } else {
2291 let content = resp.text().await?;
2292 let entity: Option<PutSsoUserError> = serde_json::from_str(&content).ok();
2293 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2294 }
2295}
2296
2297pub async fn save_comment(configuration: &configuration::Configuration, params: SaveCommentParams) -> Result<models::SaveComment200Response, Error<SaveCommentError>> {
2298
2299 let uri_str = format!("{}/api/v1/comments", configuration.base_path);
2300 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2301
2302 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
2303 if let Some(ref param_value) = params.is_live {
2304 req_builder = req_builder.query(&[("isLive", ¶m_value.to_string())]);
2305 }
2306 if let Some(ref param_value) = params.do_spam_check {
2307 req_builder = req_builder.query(&[("doSpamCheck", ¶m_value.to_string())]);
2308 }
2309 if let Some(ref param_value) = params.send_emails {
2310 req_builder = req_builder.query(&[("sendEmails", ¶m_value.to_string())]);
2311 }
2312 if let Some(ref param_value) = params.populate_notifications {
2313 req_builder = req_builder.query(&[("populateNotifications", ¶m_value.to_string())]);
2314 }
2315 if let Some(ref user_agent) = configuration.user_agent {
2316 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2317 }
2318 if let Some(ref apikey) = configuration.api_key {
2319 let key = apikey.key.clone();
2320 let value = match apikey.prefix {
2321 Some(ref prefix) => format!("{} {}", prefix, key),
2322 None => key,
2323 };
2324 req_builder = req_builder.header("x-api-key", value);
2325 };
2326 req_builder = req_builder.json(¶ms.create_comment_params);
2327
2328 let req = req_builder.build()?;
2329 let resp = configuration.client.execute(req).await?;
2330
2331 let status = resp.status();
2332
2333 if !status.is_client_error() && !status.is_server_error() {
2334 let content = resp.text().await?;
2335 serde_json::from_str(&content).map_err(Error::from)
2336 } else {
2337 let content = resp.text().await?;
2338 let entity: Option<SaveCommentError> = serde_json::from_str(&content).ok();
2339 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2340 }
2341}
2342
2343pub async fn save_comments_bulk(configuration: &configuration::Configuration, params: SaveCommentsBulkParams) -> Result<Vec<models::SaveComment200Response>, Error<SaveCommentsBulkError>> {
2344
2345 let uri_str = format!("{}/api/v1/comments/bulk", configuration.base_path);
2346 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2347
2348 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
2349 if let Some(ref param_value) = params.is_live {
2350 req_builder = req_builder.query(&[("isLive", ¶m_value.to_string())]);
2351 }
2352 if let Some(ref param_value) = params.do_spam_check {
2353 req_builder = req_builder.query(&[("doSpamCheck", ¶m_value.to_string())]);
2354 }
2355 if let Some(ref param_value) = params.send_emails {
2356 req_builder = req_builder.query(&[("sendEmails", ¶m_value.to_string())]);
2357 }
2358 if let Some(ref param_value) = params.populate_notifications {
2359 req_builder = req_builder.query(&[("populateNotifications", ¶m_value.to_string())]);
2360 }
2361 if let Some(ref user_agent) = configuration.user_agent {
2362 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2363 }
2364 if let Some(ref apikey) = configuration.api_key {
2365 let key = apikey.key.clone();
2366 let value = match apikey.prefix {
2367 Some(ref prefix) => format!("{} {}", prefix, key),
2368 None => key,
2369 };
2370 req_builder = req_builder.header("x-api-key", value);
2371 };
2372 req_builder = req_builder.json(¶ms.create_comment_params);
2373
2374 let req = req_builder.build()?;
2375 let resp = configuration.client.execute(req).await?;
2376
2377 let status = resp.status();
2378
2379 if !status.is_client_error() && !status.is_server_error() {
2380 let content = resp.text().await?;
2381 serde_json::from_str(&content).map_err(Error::from)
2382 } else {
2383 let content = resp.text().await?;
2384 let entity: Option<SaveCommentsBulkError> = serde_json::from_str(&content).ok();
2385 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2386 }
2387}
2388
2389pub async fn un_block_user_from_comment(configuration: &configuration::Configuration, params: UnBlockUserFromCommentParams) -> Result<models::UnBlockCommentPublic200Response, Error<UnBlockUserFromCommentError>> {
2390
2391 let uri_str = format!("{}/api/v1/comments/{id}/un-block", configuration.base_path, id=crate::client::apis::urlencode(params.id));
2392 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2393
2394 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
2395 if let Some(ref param_value) = params.user_id {
2396 req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
2397 }
2398 if let Some(ref param_value) = params.anon_user_id {
2399 req_builder = req_builder.query(&[("anonUserId", ¶m_value.to_string())]);
2400 }
2401 if let Some(ref user_agent) = configuration.user_agent {
2402 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2403 }
2404 if let Some(ref apikey) = configuration.api_key {
2405 let key = apikey.key.clone();
2406 let value = match apikey.prefix {
2407 Some(ref prefix) => format!("{} {}", prefix, key),
2408 None => key,
2409 };
2410 req_builder = req_builder.header("x-api-key", value);
2411 };
2412 req_builder = req_builder.json(¶ms.un_block_from_comment_params);
2413
2414 let req = req_builder.build()?;
2415 let resp = configuration.client.execute(req).await?;
2416
2417 let status = resp.status();
2418
2419 if !status.is_client_error() && !status.is_server_error() {
2420 let content = resp.text().await?;
2421 serde_json::from_str(&content).map_err(Error::from)
2422 } else {
2423 let content = resp.text().await?;
2424 let entity: Option<UnBlockUserFromCommentError> = serde_json::from_str(&content).ok();
2425 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2426 }
2427}
2428
2429pub async fn un_flag_comment(configuration: &configuration::Configuration, params: UnFlagCommentParams) -> Result<models::FlagComment200Response, Error<UnFlagCommentError>> {
2430
2431 let uri_str = format!("{}/api/v1/comments/{id}/un-flag", configuration.base_path, id=crate::client::apis::urlencode(params.id));
2432 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2433
2434 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
2435 if let Some(ref param_value) = params.user_id {
2436 req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
2437 }
2438 if let Some(ref param_value) = params.anon_user_id {
2439 req_builder = req_builder.query(&[("anonUserId", ¶m_value.to_string())]);
2440 }
2441 if let Some(ref user_agent) = configuration.user_agent {
2442 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2443 }
2444 if let Some(ref apikey) = configuration.api_key {
2445 let key = apikey.key.clone();
2446 let value = match apikey.prefix {
2447 Some(ref prefix) => format!("{} {}", prefix, key),
2448 None => key,
2449 };
2450 req_builder = req_builder.header("x-api-key", value);
2451 };
2452
2453 let req = req_builder.build()?;
2454 let resp = configuration.client.execute(req).await?;
2455
2456 let status = resp.status();
2457
2458 if !status.is_client_error() && !status.is_server_error() {
2459 let content = resp.text().await?;
2460 serde_json::from_str(&content).map_err(Error::from)
2461 } else {
2462 let content = resp.text().await?;
2463 let entity: Option<UnFlagCommentError> = serde_json::from_str(&content).ok();
2464 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2465 }
2466}
2467
2468pub async fn update_comment(configuration: &configuration::Configuration, params: UpdateCommentParams) -> Result<models::FlagCommentPublic200Response, Error<UpdateCommentError>> {
2469
2470 let uri_str = format!("{}/api/v1/comments/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
2471 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2472
2473 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
2474 if let Some(ref param_value) = params.context_user_id {
2475 req_builder = req_builder.query(&[("contextUserId", ¶m_value.to_string())]);
2476 }
2477 if let Some(ref param_value) = params.do_spam_check {
2478 req_builder = req_builder.query(&[("doSpamCheck", ¶m_value.to_string())]);
2479 }
2480 if let Some(ref param_value) = params.is_live {
2481 req_builder = req_builder.query(&[("isLive", ¶m_value.to_string())]);
2482 }
2483 if let Some(ref user_agent) = configuration.user_agent {
2484 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2485 }
2486 if let Some(ref apikey) = configuration.api_key {
2487 let key = apikey.key.clone();
2488 let value = match apikey.prefix {
2489 Some(ref prefix) => format!("{} {}", prefix, key),
2490 None => key,
2491 };
2492 req_builder = req_builder.header("x-api-key", value);
2493 };
2494 req_builder = req_builder.json(¶ms.body);
2495
2496 let req = req_builder.build()?;
2497 let resp = configuration.client.execute(req).await?;
2498
2499 let status = resp.status();
2500
2501 if !status.is_client_error() && !status.is_server_error() {
2502 let content = resp.text().await?;
2503 serde_json::from_str(&content).map_err(Error::from)
2504 } else {
2505 let content = resp.text().await?;
2506 let entity: Option<UpdateCommentError> = serde_json::from_str(&content).ok();
2507 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2508 }
2509}
2510
2511pub async fn update_feed_post(configuration: &configuration::Configuration, params: UpdateFeedPostParams) -> Result<models::FlagCommentPublic200Response, Error<UpdateFeedPostError>> {
2512
2513 let uri_str = format!("{}/api/v1/feed-posts/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
2514 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2515
2516 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
2517 if let Some(ref user_agent) = configuration.user_agent {
2518 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2519 }
2520 if let Some(ref apikey) = configuration.api_key {
2521 let key = apikey.key.clone();
2522 let value = match apikey.prefix {
2523 Some(ref prefix) => format!("{} {}", prefix, key),
2524 None => key,
2525 };
2526 req_builder = req_builder.header("x-api-key", value);
2527 };
2528 req_builder = req_builder.json(¶ms.feed_post);
2529
2530 let req = req_builder.build()?;
2531 let resp = configuration.client.execute(req).await?;
2532
2533 let status = resp.status();
2534
2535 if !status.is_client_error() && !status.is_server_error() {
2536 let content = resp.text().await?;
2537 serde_json::from_str(&content).map_err(Error::from)
2538 } else {
2539 let content = resp.text().await?;
2540 let entity: Option<UpdateFeedPostError> = serde_json::from_str(&content).ok();
2541 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2542 }
2543}
2544
2545pub async fn update_user_badge(configuration: &configuration::Configuration, params: UpdateUserBadgeParams) -> Result<models::UpdateUserBadge200Response, Error<UpdateUserBadgeError>> {
2546
2547 let uri_str = format!("{}/api/v1/user-badges/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
2548 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2549
2550 req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
2551 if let Some(ref user_agent) = configuration.user_agent {
2552 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2553 }
2554 if let Some(ref apikey) = configuration.api_key {
2555 let key = apikey.key.clone();
2556 let value = match apikey.prefix {
2557 Some(ref prefix) => format!("{} {}", prefix, key),
2558 None => key,
2559 };
2560 req_builder = req_builder.header("x-api-key", value);
2561 };
2562 req_builder = req_builder.json(¶ms.update_user_badge_params);
2563
2564 let req = req_builder.build()?;
2565 let resp = configuration.client.execute(req).await?;
2566
2567 let status = resp.status();
2568
2569 if !status.is_client_error() && !status.is_server_error() {
2570 let content = resp.text().await?;
2571 serde_json::from_str(&content).map_err(Error::from)
2572 } else {
2573 let content = resp.text().await?;
2574 let entity: Option<UpdateUserBadgeError> = serde_json::from_str(&content).ok();
2575 Err(Error::ResponseError(ResponseContent { status, content, entity }))
2576 }
2577}
2578