use reqwest;
use serde::{Deserialize, Serialize, de::Error as _};
use crate::client::{apis::ResponseContent, models};
use super::{Error, configuration, ContentType};
#[derive(Clone, Debug)]
pub struct AddDomainConfigParams {
pub tenant_id: String,
pub add_domain_config_params: models::AddDomainConfigParams
}
#[derive(Clone, Debug)]
pub struct AddHashTagParams {
pub tenant_id: String,
pub create_hash_tag_body: Option<models::CreateHashTagBody>
}
#[derive(Clone, Debug)]
pub struct AddHashTagsBulkParams {
pub tenant_id: String,
pub bulk_create_hash_tags_body: Option<models::BulkCreateHashTagsBody>
}
#[derive(Clone, Debug)]
pub struct AddPageParams {
pub tenant_id: String,
pub create_api_page_data: models::CreateApiPageData
}
#[derive(Clone, Debug)]
pub struct AddSsoUserParams {
pub tenant_id: String,
pub create_apisso_user_data: models::CreateApissoUserData
}
#[derive(Clone, Debug)]
pub struct AggregateParams {
pub tenant_id: String,
pub aggregation_request: models::AggregationRequest,
pub parent_tenant_id: Option<String>,
pub include_stats: Option<bool>
}
#[derive(Clone, Debug)]
pub struct AggregateQuestionResultsParams {
pub tenant_id: String,
pub question_id: Option<String>,
pub question_ids: Option<Vec<String>>,
pub url_id: Option<String>,
pub time_bucket: Option<models::AggregateTimeBucket>,
pub start_date: Option<chrono::DateTime<chrono::FixedOffset>>,
pub force_recalculate: Option<bool>
}
#[derive(Clone, Debug)]
pub struct BlockUserFromCommentParams {
pub tenant_id: String,
pub id: String,
pub block_from_comment_params: models::BlockFromCommentParams,
pub user_id: Option<String>,
pub anon_user_id: Option<String>
}
#[derive(Clone, Debug)]
pub struct BulkAggregateQuestionResultsParams {
pub tenant_id: String,
pub bulk_aggregate_question_results_request: models::BulkAggregateQuestionResultsRequest,
pub force_recalculate: Option<bool>
}
#[derive(Clone, Debug)]
pub struct ChangeTicketStateParams {
pub tenant_id: String,
pub user_id: String,
pub id: String,
pub change_ticket_state_body: models::ChangeTicketStateBody
}
#[derive(Clone, Debug)]
pub struct CombineCommentsWithQuestionResultsParams {
pub tenant_id: String,
pub question_id: Option<String>,
pub question_ids: Option<Vec<String>>,
pub url_id: Option<String>,
pub start_date: Option<chrono::DateTime<chrono::FixedOffset>>,
pub force_recalculate: Option<bool>,
pub min_value: Option<f64>,
pub max_value: Option<f64>,
pub limit: Option<f64>
}
#[derive(Clone, Debug)]
pub struct CreateEmailTemplateParams {
pub tenant_id: String,
pub create_email_template_body: models::CreateEmailTemplateBody
}
#[derive(Clone, Debug)]
pub struct CreateFeedPostParams {
pub tenant_id: String,
pub create_feed_post_params: models::CreateFeedPostParams,
pub broadcast_id: Option<String>,
pub is_live: Option<bool>,
pub do_spam_check: Option<bool>,
pub skip_dup_check: Option<bool>
}
#[derive(Clone, Debug)]
pub struct CreateModeratorParams {
pub tenant_id: String,
pub create_moderator_body: models::CreateModeratorBody
}
#[derive(Clone, Debug)]
pub struct CreateQuestionConfigParams {
pub tenant_id: String,
pub create_question_config_body: models::CreateQuestionConfigBody
}
#[derive(Clone, Debug)]
pub struct CreateQuestionResultParams {
pub tenant_id: String,
pub create_question_result_body: models::CreateQuestionResultBody
}
#[derive(Clone, Debug)]
pub struct CreateSubscriptionParams {
pub tenant_id: String,
pub create_api_user_subscription_data: models::CreateApiUserSubscriptionData
}
#[derive(Clone, Debug)]
pub struct CreateTenantParams {
pub tenant_id: String,
pub create_tenant_body: models::CreateTenantBody
}
#[derive(Clone, Debug)]
pub struct CreateTenantPackageParams {
pub tenant_id: String,
pub create_tenant_package_body: models::CreateTenantPackageBody
}
#[derive(Clone, Debug)]
pub struct CreateTenantUserParams {
pub tenant_id: String,
pub create_tenant_user_body: models::CreateTenantUserBody
}
#[derive(Clone, Debug)]
pub struct CreateTicketParams {
pub tenant_id: String,
pub user_id: String,
pub create_ticket_body: models::CreateTicketBody
}
#[derive(Clone, Debug)]
pub struct CreateUserBadgeParams {
pub tenant_id: String,
pub create_user_badge_params: models::CreateUserBadgeParams
}
#[derive(Clone, Debug)]
pub struct CreateVoteParams {
pub tenant_id: String,
pub comment_id: String,
pub direction: String,
pub user_id: Option<String>,
pub anon_user_id: Option<String>
}
#[derive(Clone, Debug)]
pub struct DeleteCommentParams {
pub tenant_id: String,
pub id: String,
pub context_user_id: Option<String>,
pub is_live: Option<bool>
}
#[derive(Clone, Debug)]
pub struct DeleteDomainConfigParams {
pub tenant_id: String,
pub domain: String
}
#[derive(Clone, Debug)]
pub struct DeleteEmailTemplateParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct DeleteEmailTemplateRenderErrorParams {
pub tenant_id: String,
pub id: String,
pub error_id: String
}
#[derive(Clone, Debug)]
pub struct DeleteHashTagParams {
pub tenant_id: String,
pub tag: String,
pub delete_hash_tag_request_body: Option<models::DeleteHashTagRequestBody>
}
#[derive(Clone, Debug)]
pub struct DeleteModeratorParams {
pub tenant_id: String,
pub id: String,
pub send_email: Option<String>
}
#[derive(Clone, Debug)]
pub struct DeleteNotificationCountParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct DeletePageParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct DeletePendingWebhookEventParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct DeleteQuestionConfigParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct DeleteQuestionResultParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct DeleteSsoUserParams {
pub tenant_id: String,
pub id: String,
pub delete_comments: Option<bool>,
pub comment_delete_mode: Option<String>
}
#[derive(Clone, Debug)]
pub struct DeleteSubscriptionParams {
pub tenant_id: String,
pub id: String,
pub user_id: Option<String>
}
#[derive(Clone, Debug)]
pub struct DeleteTenantParams {
pub tenant_id: String,
pub id: String,
pub sure: Option<String>
}
#[derive(Clone, Debug)]
pub struct DeleteTenantPackageParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct DeleteTenantUserParams {
pub tenant_id: String,
pub id: String,
pub delete_comments: Option<String>,
pub comment_delete_mode: Option<String>
}
#[derive(Clone, Debug)]
pub struct DeleteUserBadgeParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct DeleteVoteParams {
pub tenant_id: String,
pub id: String,
pub edit_key: Option<String>
}
#[derive(Clone, Debug)]
pub struct FlagCommentParams {
pub tenant_id: String,
pub id: String,
pub user_id: Option<String>,
pub anon_user_id: Option<String>
}
#[derive(Clone, Debug)]
pub struct GetAuditLogsParams {
pub tenant_id: String,
pub limit: Option<f64>,
pub skip: Option<f64>,
pub order: Option<models::SortDir>,
pub after: Option<f64>,
pub before: Option<f64>
}
#[derive(Clone, Debug)]
pub struct GetCachedNotificationCountParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct GetCommentParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct GetCommentsParams {
pub tenant_id: String,
pub page: Option<i32>,
pub limit: Option<i32>,
pub skip: Option<i32>,
pub as_tree: Option<bool>,
pub skip_children: Option<i32>,
pub limit_children: Option<i32>,
pub max_tree_depth: Option<i32>,
pub url_id: Option<String>,
pub user_id: Option<String>,
pub anon_user_id: Option<String>,
pub context_user_id: Option<String>,
pub hash_tag: Option<String>,
pub parent_id: Option<String>,
pub direction: Option<models::SortDirections>,
pub from_date: Option<i64>,
pub to_date: Option<i64>
}
#[derive(Clone, Debug)]
pub struct GetDomainConfigParams {
pub tenant_id: String,
pub domain: String
}
#[derive(Clone, Debug)]
pub struct GetDomainConfigsParams {
pub tenant_id: String
}
#[derive(Clone, Debug)]
pub struct GetEmailTemplateParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct GetEmailTemplateDefinitionsParams {
pub tenant_id: String
}
#[derive(Clone, Debug)]
pub struct GetEmailTemplateRenderErrorsParams {
pub tenant_id: String,
pub id: String,
pub skip: Option<f64>
}
#[derive(Clone, Debug)]
pub struct GetEmailTemplatesParams {
pub tenant_id: String,
pub skip: Option<f64>
}
#[derive(Clone, Debug)]
pub struct GetFeedPostsParams {
pub tenant_id: String,
pub after_id: Option<String>,
pub limit: Option<i32>,
pub tags: Option<Vec<String>>
}
#[derive(Clone, Debug)]
pub struct GetHashTagsParams {
pub tenant_id: String,
pub page: Option<f64>
}
#[derive(Clone, Debug)]
pub struct GetModeratorParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct GetModeratorsParams {
pub tenant_id: String,
pub skip: Option<f64>
}
#[derive(Clone, Debug)]
pub struct GetNotificationCountParams {
pub tenant_id: String,
pub user_id: Option<String>,
pub url_id: Option<String>,
pub from_comment_id: Option<String>,
pub viewed: Option<bool>,
pub r#type: Option<String>
}
#[derive(Clone, Debug)]
pub struct GetNotificationsParams {
pub tenant_id: String,
pub user_id: Option<String>,
pub url_id: Option<String>,
pub from_comment_id: Option<String>,
pub viewed: Option<bool>,
pub r#type: Option<String>,
pub skip: Option<f64>
}
#[derive(Clone, Debug)]
pub struct GetPageByUrlidParams {
pub tenant_id: String,
pub url_id: String
}
#[derive(Clone, Debug)]
pub struct GetPagesParams {
pub tenant_id: String
}
#[derive(Clone, Debug)]
pub struct GetPendingWebhookEventCountParams {
pub tenant_id: String,
pub comment_id: Option<String>,
pub external_id: Option<String>,
pub event_type: Option<String>,
pub r#type: Option<String>,
pub domain: Option<String>,
pub attempt_count_gt: Option<f64>
}
#[derive(Clone, Debug)]
pub struct GetPendingWebhookEventsParams {
pub tenant_id: String,
pub comment_id: Option<String>,
pub external_id: Option<String>,
pub event_type: Option<String>,
pub r#type: Option<String>,
pub domain: Option<String>,
pub attempt_count_gt: Option<f64>,
pub skip: Option<f64>
}
#[derive(Clone, Debug)]
pub struct GetQuestionConfigParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct GetQuestionConfigsParams {
pub tenant_id: String,
pub skip: Option<f64>
}
#[derive(Clone, Debug)]
pub struct GetQuestionResultParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct GetQuestionResultsParams {
pub tenant_id: String,
pub url_id: Option<String>,
pub user_id: Option<String>,
pub start_date: Option<String>,
pub question_id: Option<String>,
pub question_ids: Option<String>,
pub skip: Option<f64>
}
#[derive(Clone, Debug)]
pub struct GetSsoUserByEmailParams {
pub tenant_id: String,
pub email: String
}
#[derive(Clone, Debug)]
pub struct GetSsoUserByIdParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct GetSsoUsersParams {
pub tenant_id: String,
pub skip: Option<i32>
}
#[derive(Clone, Debug)]
pub struct GetSubscriptionsParams {
pub tenant_id: String,
pub user_id: Option<String>
}
#[derive(Clone, Debug)]
pub struct GetTenantParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct GetTenantDailyUsagesParams {
pub tenant_id: String,
pub year_number: Option<f64>,
pub month_number: Option<f64>,
pub day_number: Option<f64>,
pub skip: Option<f64>
}
#[derive(Clone, Debug)]
pub struct GetTenantPackageParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct GetTenantPackagesParams {
pub tenant_id: String,
pub skip: Option<f64>
}
#[derive(Clone, Debug)]
pub struct GetTenantUserParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct GetTenantUsersParams {
pub tenant_id: String,
pub skip: Option<f64>
}
#[derive(Clone, Debug)]
pub struct GetTenantsParams {
pub tenant_id: String,
pub meta: Option<String>,
pub skip: Option<f64>
}
#[derive(Clone, Debug)]
pub struct GetTicketParams {
pub tenant_id: String,
pub id: String,
pub user_id: Option<String>
}
#[derive(Clone, Debug)]
pub struct GetTicketsParams {
pub tenant_id: String,
pub user_id: Option<String>,
pub state: Option<f64>,
pub skip: Option<f64>,
pub limit: Option<f64>
}
#[derive(Clone, Debug)]
pub struct GetUserParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct GetUserBadgeParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct GetUserBadgeProgressByIdParams {
pub tenant_id: String,
pub id: String
}
#[derive(Clone, Debug)]
pub struct GetUserBadgeProgressByUserIdParams {
pub tenant_id: String,
pub user_id: String
}
#[derive(Clone, Debug)]
pub struct GetUserBadgeProgressListParams {
pub tenant_id: String,
pub user_id: Option<String>,
pub limit: Option<f64>,
pub skip: Option<f64>
}
#[derive(Clone, Debug)]
pub struct GetUserBadgesParams {
pub tenant_id: String,
pub user_id: Option<String>,
pub badge_id: Option<String>,
pub r#type: Option<f64>,
pub displayed_on_comments: Option<bool>,
pub limit: Option<f64>,
pub skip: Option<f64>
}
#[derive(Clone, Debug)]
pub struct GetVotesParams {
pub tenant_id: String,
pub url_id: String
}
#[derive(Clone, Debug)]
pub struct GetVotesForUserParams {
pub tenant_id: String,
pub url_id: String,
pub user_id: Option<String>,
pub anon_user_id: Option<String>
}
#[derive(Clone, Debug)]
pub struct PatchDomainConfigParams {
pub tenant_id: String,
pub domain_to_update: String,
pub patch_domain_config_params: models::PatchDomainConfigParams
}
#[derive(Clone, Debug)]
pub struct PatchHashTagParams {
pub tenant_id: String,
pub tag: String,
pub update_hash_tag_body: Option<models::UpdateHashTagBody>
}
#[derive(Clone, Debug)]
pub struct PatchPageParams {
pub tenant_id: String,
pub id: String,
pub update_api_page_data: models::UpdateApiPageData
}
#[derive(Clone, Debug)]
pub struct PatchSsoUserParams {
pub tenant_id: String,
pub id: String,
pub update_apisso_user_data: models::UpdateApissoUserData,
pub update_comments: Option<bool>
}
#[derive(Clone, Debug)]
pub struct PutDomainConfigParams {
pub tenant_id: String,
pub domain_to_update: String,
pub update_domain_config_params: models::UpdateDomainConfigParams
}
#[derive(Clone, Debug)]
pub struct PutSsoUserParams {
pub tenant_id: String,
pub id: String,
pub update_apisso_user_data: models::UpdateApissoUserData,
pub update_comments: Option<bool>
}
#[derive(Clone, Debug)]
pub struct RenderEmailTemplateParams {
pub tenant_id: String,
pub render_email_template_body: models::RenderEmailTemplateBody,
pub locale: Option<String>
}
#[derive(Clone, Debug)]
pub struct ReplaceTenantPackageParams {
pub tenant_id: String,
pub id: String,
pub replace_tenant_package_body: models::ReplaceTenantPackageBody
}
#[derive(Clone, Debug)]
pub struct ReplaceTenantUserParams {
pub tenant_id: String,
pub id: String,
pub replace_tenant_user_body: models::ReplaceTenantUserBody,
pub update_comments: Option<String>
}
#[derive(Clone, Debug)]
pub struct SaveCommentParams {
pub tenant_id: String,
pub create_comment_params: models::CreateCommentParams,
pub is_live: Option<bool>,
pub do_spam_check: Option<bool>,
pub send_emails: Option<bool>,
pub populate_notifications: Option<bool>
}
#[derive(Clone, Debug)]
pub struct SaveCommentsBulkParams {
pub tenant_id: String,
pub create_comment_params: Vec<models::CreateCommentParams>,
pub is_live: Option<bool>,
pub do_spam_check: Option<bool>,
pub send_emails: Option<bool>,
pub populate_notifications: Option<bool>
}
#[derive(Clone, Debug)]
pub struct SendInviteParams {
pub tenant_id: String,
pub id: String,
pub from_name: String
}
#[derive(Clone, Debug)]
pub struct SendLoginLinkParams {
pub tenant_id: String,
pub id: String,
pub redirect_url: Option<String>
}
#[derive(Clone, Debug)]
pub struct UnBlockUserFromCommentParams {
pub tenant_id: String,
pub id: String,
pub un_block_from_comment_params: models::UnBlockFromCommentParams,
pub user_id: Option<String>,
pub anon_user_id: Option<String>
}
#[derive(Clone, Debug)]
pub struct UnFlagCommentParams {
pub tenant_id: String,
pub id: String,
pub user_id: Option<String>,
pub anon_user_id: Option<String>
}
#[derive(Clone, Debug)]
pub struct UpdateCommentParams {
pub tenant_id: String,
pub id: String,
pub updatable_comment_params: models::UpdatableCommentParams,
pub context_user_id: Option<String>,
pub do_spam_check: Option<bool>,
pub is_live: Option<bool>
}
#[derive(Clone, Debug)]
pub struct UpdateEmailTemplateParams {
pub tenant_id: String,
pub id: String,
pub update_email_template_body: models::UpdateEmailTemplateBody
}
#[derive(Clone, Debug)]
pub struct UpdateFeedPostParams {
pub tenant_id: String,
pub id: String,
pub feed_post: models::FeedPost
}
#[derive(Clone, Debug)]
pub struct UpdateModeratorParams {
pub tenant_id: String,
pub id: String,
pub update_moderator_body: models::UpdateModeratorBody
}
#[derive(Clone, Debug)]
pub struct UpdateNotificationParams {
pub tenant_id: String,
pub id: String,
pub update_notification_body: models::UpdateNotificationBody,
pub user_id: Option<String>
}
#[derive(Clone, Debug)]
pub struct UpdateQuestionConfigParams {
pub tenant_id: String,
pub id: String,
pub update_question_config_body: models::UpdateQuestionConfigBody
}
#[derive(Clone, Debug)]
pub struct UpdateQuestionResultParams {
pub tenant_id: String,
pub id: String,
pub update_question_result_body: models::UpdateQuestionResultBody
}
#[derive(Clone, Debug)]
pub struct UpdateSubscriptionParams {
pub tenant_id: String,
pub id: String,
pub update_api_user_subscription_data: models::UpdateApiUserSubscriptionData,
pub user_id: Option<String>
}
#[derive(Clone, Debug)]
pub struct UpdateTenantParams {
pub tenant_id: String,
pub id: String,
pub update_tenant_body: models::UpdateTenantBody
}
#[derive(Clone, Debug)]
pub struct UpdateTenantPackageParams {
pub tenant_id: String,
pub id: String,
pub update_tenant_package_body: models::UpdateTenantPackageBody
}
#[derive(Clone, Debug)]
pub struct UpdateTenantUserParams {
pub tenant_id: String,
pub id: String,
pub update_tenant_user_body: models::UpdateTenantUserBody,
pub update_comments: Option<String>
}
#[derive(Clone, Debug)]
pub struct UpdateUserBadgeParams {
pub tenant_id: String,
pub id: String,
pub update_user_badge_params: models::UpdateUserBadgeParams
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AddDomainConfigError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AddHashTagError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AddHashTagsBulkError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AddPageError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AddSsoUserError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AggregateError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AggregateQuestionResultsError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum BlockUserFromCommentError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum BulkAggregateQuestionResultsError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ChangeTicketStateError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CombineCommentsWithQuestionResultsError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateEmailTemplateError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateFeedPostError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateModeratorError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateQuestionConfigError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateQuestionResultError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateSubscriptionError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateTenantError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateTenantPackageError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateTenantUserError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateTicketError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateUserBadgeError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateVoteError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteCommentError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteDomainConfigError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteEmailTemplateError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteEmailTemplateRenderErrorError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteHashTagError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteModeratorError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteNotificationCountError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeletePageError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeletePendingWebhookEventError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteQuestionConfigError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteQuestionResultError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteSsoUserError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteSubscriptionError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteTenantError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteTenantPackageError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteTenantUserError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteUserBadgeError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteVoteError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum FlagCommentError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetAuditLogsError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetCachedNotificationCountError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetCommentError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetCommentsError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetDomainConfigError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetDomainConfigsError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetEmailTemplateError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetEmailTemplateDefinitionsError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetEmailTemplateRenderErrorsError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetEmailTemplatesError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetFeedPostsError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetHashTagsError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetModeratorError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetModeratorsError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetNotificationCountError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetNotificationsError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetPageByUrlidError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetPagesError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetPendingWebhookEventCountError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetPendingWebhookEventsError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetQuestionConfigError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetQuestionConfigsError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetQuestionResultError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetQuestionResultsError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetSsoUserByEmailError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetSsoUserByIdError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetSsoUsersError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetSubscriptionsError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTenantError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTenantDailyUsagesError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTenantPackageError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTenantPackagesError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTenantUserError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTenantUsersError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTenantsError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTicketError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTicketsError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetUserError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetUserBadgeError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetUserBadgeProgressByIdError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetUserBadgeProgressByUserIdError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetUserBadgeProgressListError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetUserBadgesError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetVotesError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetVotesForUserError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PatchDomainConfigError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PatchHashTagError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PatchPageError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PatchSsoUserError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PutDomainConfigError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PutSsoUserError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum RenderEmailTemplateError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ReplaceTenantPackageError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ReplaceTenantUserError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SaveCommentError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SaveCommentsBulkError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SendInviteError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SendLoginLinkError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UnBlockUserFromCommentError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UnFlagCommentError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateCommentError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateEmailTemplateError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateFeedPostError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateModeratorError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateNotificationError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateQuestionConfigError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateQuestionResultError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateSubscriptionError {
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateTenantError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateTenantPackageError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateTenantUserError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateUserBadgeError {
DefaultResponse(models::ApiError),
UnknownValue(serde_json::Value),
}
pub async fn add_domain_config(configuration: &configuration::Configuration, params: AddDomainConfigParams) -> Result<models::AddDomainConfigResponse, Error<AddDomainConfigError>> {
let uri_str = format!("{}/api/v1/domain-configs", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.add_domain_config_params);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AddDomainConfigResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AddDomainConfigResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AddDomainConfigError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn add_hash_tag(configuration: &configuration::Configuration, params: AddHashTagParams) -> Result<models::CreateHashTagResponse, Error<AddHashTagError>> {
let uri_str = format!("{}/api/v1/hash-tags", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.create_hash_tag_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateHashTagResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateHashTagResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AddHashTagError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn add_hash_tags_bulk(configuration: &configuration::Configuration, params: AddHashTagsBulkParams) -> Result<models::BulkCreateHashTagsResponse, Error<AddHashTagsBulkError>> {
let uri_str = format!("{}/api/v1/hash-tags/bulk", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.bulk_create_hash_tags_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BulkCreateHashTagsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BulkCreateHashTagsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AddHashTagsBulkError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn add_page(configuration: &configuration::Configuration, params: AddPageParams) -> Result<models::AddPageApiResponse, Error<AddPageError>> {
let uri_str = format!("{}/api/v1/pages", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.create_api_page_data);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AddPageApiResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AddPageApiResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AddPageError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn add_sso_user(configuration: &configuration::Configuration, params: AddSsoUserParams) -> Result<models::AddSsoUserApiResponse, Error<AddSsoUserError>> {
let uri_str = format!("{}/api/v1/sso-users", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.create_apisso_user_data);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AddSsoUserApiResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AddSsoUserApiResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AddSsoUserError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn aggregate(configuration: &configuration::Configuration, params: AggregateParams) -> Result<models::AggregateResponse, Error<AggregateError>> {
let uri_str = format!("{}/api/v1/aggregate", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.parent_tenant_id {
req_builder = req_builder.query(&[("parentTenantId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.include_stats {
req_builder = req_builder.query(&[("includeStats", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.aggregation_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AggregateResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AggregateResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AggregateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn aggregate_question_results(configuration: &configuration::Configuration, params: AggregateQuestionResultsParams) -> Result<models::AggregateQuestionResultsResponse, Error<AggregateQuestionResultsError>> {
let uri_str = format!("{}/api/v1/question-results-aggregation", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.question_id {
req_builder = req_builder.query(&[("questionId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.question_ids {
req_builder = match "multi" {
"multi" => req_builder.query(¶m_value.into_iter().map(|p| ("questionIds".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
_ => req_builder.query(&[("questionIds", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
};
}
if let Some(ref param_value) = params.url_id {
req_builder = req_builder.query(&[("urlId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.time_bucket {
req_builder = req_builder.query(&[("timeBucket", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.start_date {
req_builder = req_builder.query(&[("startDate", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.force_recalculate {
req_builder = req_builder.query(&[("forceRecalculate", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AggregateQuestionResultsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AggregateQuestionResultsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<AggregateQuestionResultsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn block_user_from_comment(configuration: &configuration::Configuration, params: BlockUserFromCommentParams) -> Result<models::BlockSuccess, Error<BlockUserFromCommentError>> {
let uri_str = format!("{}/api/v1/comments/{id}/block", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.anon_user_id {
req_builder = req_builder.query(&[("anonUserId", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.block_from_comment_params);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BlockSuccess`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BlockSuccess`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<BlockUserFromCommentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn bulk_aggregate_question_results(configuration: &configuration::Configuration, params: BulkAggregateQuestionResultsParams) -> Result<models::BulkAggregateQuestionResultsResponse, Error<BulkAggregateQuestionResultsError>> {
let uri_str = format!("{}/api/v1/question-results-aggregation/bulk", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.force_recalculate {
req_builder = req_builder.query(&[("forceRecalculate", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.bulk_aggregate_question_results_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BulkAggregateQuestionResultsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BulkAggregateQuestionResultsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<BulkAggregateQuestionResultsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn change_ticket_state(configuration: &configuration::Configuration, params: ChangeTicketStateParams) -> Result<models::ChangeTicketStateResponse, Error<ChangeTicketStateError>> {
let uri_str = format!("{}/api/v1/tickets/{id}/state", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
req_builder = req_builder.query(&[("userId", ¶ms.user_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.change_ticket_state_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ChangeTicketStateResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ChangeTicketStateResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ChangeTicketStateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn combine_comments_with_question_results(configuration: &configuration::Configuration, params: CombineCommentsWithQuestionResultsParams) -> Result<models::CombineQuestionResultsWithCommentsResponse, Error<CombineCommentsWithQuestionResultsError>> {
let uri_str = format!("{}/api/v1/question-results-aggregation/combine/comments", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.question_id {
req_builder = req_builder.query(&[("questionId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.question_ids {
req_builder = match "multi" {
"multi" => req_builder.query(¶m_value.into_iter().map(|p| ("questionIds".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
_ => req_builder.query(&[("questionIds", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
};
}
if let Some(ref param_value) = params.url_id {
req_builder = req_builder.query(&[("urlId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.start_date {
req_builder = req_builder.query(&[("startDate", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.force_recalculate {
req_builder = req_builder.query(&[("forceRecalculate", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.min_value {
req_builder = req_builder.query(&[("minValue", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.max_value {
req_builder = req_builder.query(&[("maxValue", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CombineQuestionResultsWithCommentsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CombineQuestionResultsWithCommentsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CombineCommentsWithQuestionResultsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn create_email_template(configuration: &configuration::Configuration, params: CreateEmailTemplateParams) -> Result<models::CreateEmailTemplateResponse, Error<CreateEmailTemplateError>> {
let uri_str = format!("{}/api/v1/email-templates", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.create_email_template_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateEmailTemplateResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateEmailTemplateResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateEmailTemplateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn create_feed_post(configuration: &configuration::Configuration, params: CreateFeedPostParams) -> Result<models::CreateFeedPostsResponse, Error<CreateFeedPostError>> {
let uri_str = format!("{}/api/v1/feed-posts", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.broadcast_id {
req_builder = req_builder.query(&[("broadcastId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.is_live {
req_builder = req_builder.query(&[("isLive", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.do_spam_check {
req_builder = req_builder.query(&[("doSpamCheck", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.skip_dup_check {
req_builder = req_builder.query(&[("skipDupCheck", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.create_feed_post_params);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateFeedPostsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateFeedPostsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateFeedPostError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn create_moderator(configuration: &configuration::Configuration, params: CreateModeratorParams) -> Result<models::CreateModeratorResponse, Error<CreateModeratorError>> {
let uri_str = format!("{}/api/v1/moderators", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.create_moderator_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateModeratorResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateModeratorResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateModeratorError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn create_question_config(configuration: &configuration::Configuration, params: CreateQuestionConfigParams) -> Result<models::CreateQuestionConfigResponse, Error<CreateQuestionConfigError>> {
let uri_str = format!("{}/api/v1/question-configs", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.create_question_config_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateQuestionConfigResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateQuestionConfigResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateQuestionConfigError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn create_question_result(configuration: &configuration::Configuration, params: CreateQuestionResultParams) -> Result<models::CreateQuestionResultResponse, Error<CreateQuestionResultError>> {
let uri_str = format!("{}/api/v1/question-results", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.create_question_result_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateQuestionResultResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateQuestionResultResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateQuestionResultError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn create_subscription(configuration: &configuration::Configuration, params: CreateSubscriptionParams) -> Result<models::CreateSubscriptionApiResponse, Error<CreateSubscriptionError>> {
let uri_str = format!("{}/api/v1/subscriptions", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.create_api_user_subscription_data);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateSubscriptionApiResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateSubscriptionApiResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateSubscriptionError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn create_tenant(configuration: &configuration::Configuration, params: CreateTenantParams) -> Result<models::CreateTenantResponse, Error<CreateTenantError>> {
let uri_str = format!("{}/api/v1/tenants", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.create_tenant_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateTenantResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateTenantResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateTenantError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn create_tenant_package(configuration: &configuration::Configuration, params: CreateTenantPackageParams) -> Result<models::CreateTenantPackageResponse, Error<CreateTenantPackageError>> {
let uri_str = format!("{}/api/v1/tenant-packages", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.create_tenant_package_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateTenantPackageResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateTenantPackageResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateTenantPackageError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn create_tenant_user(configuration: &configuration::Configuration, params: CreateTenantUserParams) -> Result<models::CreateTenantUserResponse, Error<CreateTenantUserError>> {
let uri_str = format!("{}/api/v1/tenant-users", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.create_tenant_user_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateTenantUserResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateTenantUserResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateTenantUserError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn create_ticket(configuration: &configuration::Configuration, params: CreateTicketParams) -> Result<models::CreateTicketResponse, Error<CreateTicketError>> {
let uri_str = format!("{}/api/v1/tickets", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
req_builder = req_builder.query(&[("userId", ¶ms.user_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.create_ticket_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CreateTicketResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CreateTicketResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateTicketError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn create_user_badge(configuration: &configuration::Configuration, params: CreateUserBadgeParams) -> Result<models::ApiCreateUserBadgeResponse, Error<CreateUserBadgeError>> {
let uri_str = format!("{}/api/v1/user-badges", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.create_user_badge_params);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiCreateUserBadgeResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiCreateUserBadgeResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateUserBadgeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn create_vote(configuration: &configuration::Configuration, params: CreateVoteParams) -> Result<models::VoteResponse, Error<CreateVoteError>> {
let uri_str = format!("{}/api/v1/votes", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
req_builder = req_builder.query(&[("commentId", ¶ms.comment_id.to_string())]);
req_builder = req_builder.query(&[("direction", ¶ms.direction.to_string())]);
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.anon_user_id {
req_builder = req_builder.query(&[("anonUserId", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VoteResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::VoteResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<CreateVoteError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_comment(configuration: &configuration::Configuration, params: DeleteCommentParams) -> Result<models::DeleteCommentResult, Error<DeleteCommentError>> {
let uri_str = format!("{}/api/v1/comments/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.context_user_id {
req_builder = req_builder.query(&[("contextUserId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.is_live {
req_builder = req_builder.query(&[("isLive", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeleteCommentResult`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DeleteCommentResult`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteCommentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_domain_config(configuration: &configuration::Configuration, params: DeleteDomainConfigParams) -> Result<models::DeleteDomainConfigResponse, Error<DeleteDomainConfigError>> {
let uri_str = format!("{}/api/v1/domain-configs/{domain}", configuration.base_path, domain=crate::client::apis::urlencode(params.domain));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeleteDomainConfigResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DeleteDomainConfigResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteDomainConfigError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_email_template(configuration: &configuration::Configuration, params: DeleteEmailTemplateParams) -> Result<models::ApiEmptyResponse, Error<DeleteEmailTemplateError>> {
let uri_str = format!("{}/api/v1/email-templates/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteEmailTemplateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_email_template_render_error(configuration: &configuration::Configuration, params: DeleteEmailTemplateRenderErrorParams) -> Result<models::ApiEmptyResponse, Error<DeleteEmailTemplateRenderErrorError>> {
let uri_str = format!("{}/api/v1/email-templates/{id}/render-errors/{errorId}", configuration.base_path, id=crate::client::apis::urlencode(params.id), errorId=crate::client::apis::urlencode(params.error_id));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteEmailTemplateRenderErrorError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_hash_tag(configuration: &configuration::Configuration, params: DeleteHashTagParams) -> Result<models::ApiEmptyResponse, Error<DeleteHashTagError>> {
let uri_str = format!("{}/api/v1/hash-tags/{tag}", configuration.base_path, tag=crate::client::apis::urlencode(params.tag));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.delete_hash_tag_request_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteHashTagError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_moderator(configuration: &configuration::Configuration, params: DeleteModeratorParams) -> Result<models::ApiEmptyResponse, Error<DeleteModeratorError>> {
let uri_str = format!("{}/api/v1/moderators/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.send_email {
req_builder = req_builder.query(&[("sendEmail", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteModeratorError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_notification_count(configuration: &configuration::Configuration, params: DeleteNotificationCountParams) -> Result<models::ApiEmptyResponse, Error<DeleteNotificationCountError>> {
let uri_str = format!("{}/api/v1/notification-count/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteNotificationCountError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_page(configuration: &configuration::Configuration, params: DeletePageParams) -> Result<models::DeletePageApiResponse, Error<DeletePageError>> {
let uri_str = format!("{}/api/v1/pages/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeletePageApiResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DeletePageApiResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeletePageError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_pending_webhook_event(configuration: &configuration::Configuration, params: DeletePendingWebhookEventParams) -> Result<models::ApiEmptyResponse, Error<DeletePendingWebhookEventError>> {
let uri_str = format!("{}/api/v1/pending-webhook-events/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeletePendingWebhookEventError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_question_config(configuration: &configuration::Configuration, params: DeleteQuestionConfigParams) -> Result<models::ApiEmptyResponse, Error<DeleteQuestionConfigError>> {
let uri_str = format!("{}/api/v1/question-configs/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteQuestionConfigError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_question_result(configuration: &configuration::Configuration, params: DeleteQuestionResultParams) -> Result<models::ApiEmptyResponse, Error<DeleteQuestionResultError>> {
let uri_str = format!("{}/api/v1/question-results/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteQuestionResultError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_sso_user(configuration: &configuration::Configuration, params: DeleteSsoUserParams) -> Result<models::DeleteSsoUserApiResponse, Error<DeleteSsoUserError>> {
let uri_str = format!("{}/api/v1/sso-users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.delete_comments {
req_builder = req_builder.query(&[("deleteComments", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.comment_delete_mode {
req_builder = req_builder.query(&[("commentDeleteMode", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeleteSsoUserApiResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DeleteSsoUserApiResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteSsoUserError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_subscription(configuration: &configuration::Configuration, params: DeleteSubscriptionParams) -> Result<models::DeleteSubscriptionApiResponse, Error<DeleteSubscriptionError>> {
let uri_str = format!("{}/api/v1/subscriptions/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeleteSubscriptionApiResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DeleteSubscriptionApiResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteSubscriptionError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_tenant(configuration: &configuration::Configuration, params: DeleteTenantParams) -> Result<models::ApiEmptyResponse, Error<DeleteTenantError>> {
let uri_str = format!("{}/api/v1/tenants/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.sure {
req_builder = req_builder.query(&[("sure", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteTenantError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_tenant_package(configuration: &configuration::Configuration, params: DeleteTenantPackageParams) -> Result<models::ApiEmptyResponse, Error<DeleteTenantPackageError>> {
let uri_str = format!("{}/api/v1/tenant-packages/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteTenantPackageError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_tenant_user(configuration: &configuration::Configuration, params: DeleteTenantUserParams) -> Result<models::ApiEmptyResponse, Error<DeleteTenantUserError>> {
let uri_str = format!("{}/api/v1/tenant-users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.delete_comments {
req_builder = req_builder.query(&[("deleteComments", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.comment_delete_mode {
req_builder = req_builder.query(&[("commentDeleteMode", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteTenantUserError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_user_badge(configuration: &configuration::Configuration, params: DeleteUserBadgeParams) -> Result<models::ApiEmptySuccessResponse, Error<DeleteUserBadgeError>> {
let uri_str = format!("{}/api/v1/user-badges/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptySuccessResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptySuccessResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteUserBadgeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn delete_vote(configuration: &configuration::Configuration, params: DeleteVoteParams) -> Result<models::VoteDeleteResponse, Error<DeleteVoteError>> {
let uri_str = format!("{}/api/v1/votes/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.edit_key {
req_builder = req_builder.query(&[("editKey", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::VoteDeleteResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::VoteDeleteResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<DeleteVoteError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn flag_comment(configuration: &configuration::Configuration, params: FlagCommentParams) -> Result<models::FlagCommentResponse, Error<FlagCommentError>> {
let uri_str = format!("{}/api/v1/comments/{id}/flag", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.anon_user_id {
req_builder = req_builder.query(&[("anonUserId", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FlagCommentResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FlagCommentResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<FlagCommentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_audit_logs(configuration: &configuration::Configuration, params: GetAuditLogsParams) -> Result<models::GetAuditLogsResponse, Error<GetAuditLogsError>> {
let uri_str = format!("{}/api/v1/audit-logs", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.skip {
req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.order {
req_builder = req_builder.query(&[("order", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.after {
req_builder = req_builder.query(&[("after", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.before {
req_builder = req_builder.query(&[("before", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetAuditLogsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetAuditLogsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetAuditLogsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_cached_notification_count(configuration: &configuration::Configuration, params: GetCachedNotificationCountParams) -> Result<models::GetCachedNotificationCountResponse, Error<GetCachedNotificationCountError>> {
let uri_str = format!("{}/api/v1/notification-count/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetCachedNotificationCountResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetCachedNotificationCountResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetCachedNotificationCountError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_comment(configuration: &configuration::Configuration, params: GetCommentParams) -> Result<models::ApiGetCommentResponse, Error<GetCommentError>> {
let uri_str = format!("{}/api/v1/comments/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiGetCommentResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiGetCommentResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetCommentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_comments(configuration: &configuration::Configuration, params: GetCommentsParams) -> Result<models::ApiGetCommentsResponse, Error<GetCommentsError>> {
let uri_str = format!("{}/api/v1/comments", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.skip {
req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.as_tree {
req_builder = req_builder.query(&[("asTree", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.skip_children {
req_builder = req_builder.query(&[("skipChildren", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.limit_children {
req_builder = req_builder.query(&[("limitChildren", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.max_tree_depth {
req_builder = req_builder.query(&[("maxTreeDepth", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.url_id {
req_builder = req_builder.query(&[("urlId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.anon_user_id {
req_builder = req_builder.query(&[("anonUserId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.context_user_id {
req_builder = req_builder.query(&[("contextUserId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.hash_tag {
req_builder = req_builder.query(&[("hashTag", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.parent_id {
req_builder = req_builder.query(&[("parentId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.direction {
req_builder = req_builder.query(&[("direction", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.from_date {
req_builder = req_builder.query(&[("fromDate", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.to_date {
req_builder = req_builder.query(&[("toDate", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiGetCommentsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiGetCommentsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetCommentsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_domain_config(configuration: &configuration::Configuration, params: GetDomainConfigParams) -> Result<models::GetDomainConfigResponse, Error<GetDomainConfigError>> {
let uri_str = format!("{}/api/v1/domain-configs/{domain}", configuration.base_path, domain=crate::client::apis::urlencode(params.domain));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetDomainConfigResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetDomainConfigResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetDomainConfigError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_domain_configs(configuration: &configuration::Configuration, params: GetDomainConfigsParams) -> Result<models::GetDomainConfigsResponse, Error<GetDomainConfigsError>> {
let uri_str = format!("{}/api/v1/domain-configs", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetDomainConfigsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetDomainConfigsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetDomainConfigsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_email_template(configuration: &configuration::Configuration, params: GetEmailTemplateParams) -> Result<models::GetEmailTemplateResponse, Error<GetEmailTemplateError>> {
let uri_str = format!("{}/api/v1/email-templates/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEmailTemplateResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetEmailTemplateResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetEmailTemplateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_email_template_definitions(configuration: &configuration::Configuration, params: GetEmailTemplateDefinitionsParams) -> Result<models::GetEmailTemplateDefinitionsResponse, Error<GetEmailTemplateDefinitionsError>> {
let uri_str = format!("{}/api/v1/email-templates/definitions", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEmailTemplateDefinitionsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetEmailTemplateDefinitionsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetEmailTemplateDefinitionsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_email_template_render_errors(configuration: &configuration::Configuration, params: GetEmailTemplateRenderErrorsParams) -> Result<models::GetEmailTemplateRenderErrorsResponse, Error<GetEmailTemplateRenderErrorsError>> {
let uri_str = format!("{}/api/v1/email-templates/{id}/render-errors", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.skip {
req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEmailTemplateRenderErrorsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetEmailTemplateRenderErrorsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetEmailTemplateRenderErrorsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_email_templates(configuration: &configuration::Configuration, params: GetEmailTemplatesParams) -> Result<models::GetEmailTemplatesResponse, Error<GetEmailTemplatesError>> {
let uri_str = format!("{}/api/v1/email-templates", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.skip {
req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetEmailTemplatesResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetEmailTemplatesResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetEmailTemplatesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_feed_posts(configuration: &configuration::Configuration, params: GetFeedPostsParams) -> Result<models::GetFeedPostsResponse, Error<GetFeedPostsError>> {
let uri_str = format!("{}/api/v1/feed-posts", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.after_id {
req_builder = req_builder.query(&[("afterId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.tags {
req_builder = match "multi" {
"multi" => req_builder.query(¶m_value.into_iter().map(|p| ("tags".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
_ => req_builder.query(&[("tags", ¶m_value.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
};
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetFeedPostsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetFeedPostsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetFeedPostsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_hash_tags(configuration: &configuration::Configuration, params: GetHashTagsParams) -> Result<models::GetHashTagsResponse, Error<GetHashTagsError>> {
let uri_str = format!("{}/api/v1/hash-tags", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetHashTagsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetHashTagsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetHashTagsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_moderator(configuration: &configuration::Configuration, params: GetModeratorParams) -> Result<models::GetModeratorResponse, Error<GetModeratorError>> {
let uri_str = format!("{}/api/v1/moderators/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetModeratorResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetModeratorResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetModeratorError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_moderators(configuration: &configuration::Configuration, params: GetModeratorsParams) -> Result<models::GetModeratorsResponse, Error<GetModeratorsError>> {
let uri_str = format!("{}/api/v1/moderators", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.skip {
req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetModeratorsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetModeratorsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetModeratorsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_notification_count(configuration: &configuration::Configuration, params: GetNotificationCountParams) -> Result<models::GetNotificationCountResponse, Error<GetNotificationCountError>> {
let uri_str = format!("{}/api/v1/notifications/count", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.url_id {
req_builder = req_builder.query(&[("urlId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.from_comment_id {
req_builder = req_builder.query(&[("fromCommentId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.viewed {
req_builder = req_builder.query(&[("viewed", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.r#type {
req_builder = req_builder.query(&[("type", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetNotificationCountResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetNotificationCountResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetNotificationCountError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_notifications(configuration: &configuration::Configuration, params: GetNotificationsParams) -> Result<models::GetNotificationsResponse, Error<GetNotificationsError>> {
let uri_str = format!("{}/api/v1/notifications", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.url_id {
req_builder = req_builder.query(&[("urlId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.from_comment_id {
req_builder = req_builder.query(&[("fromCommentId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.viewed {
req_builder = req_builder.query(&[("viewed", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.r#type {
req_builder = req_builder.query(&[("type", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.skip {
req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetNotificationsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetNotificationsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetNotificationsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_page_by_urlid(configuration: &configuration::Configuration, params: GetPageByUrlidParams) -> Result<models::GetPageByUrlidApiResponse, Error<GetPageByUrlidError>> {
let uri_str = format!("{}/api/v1/pages/by-url-id", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
req_builder = req_builder.query(&[("urlId", ¶ms.url_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetPageByUrlidApiResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetPageByUrlidApiResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetPageByUrlidError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_pages(configuration: &configuration::Configuration, params: GetPagesParams) -> Result<models::GetPagesApiResponse, Error<GetPagesError>> {
let uri_str = format!("{}/api/v1/pages", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetPagesApiResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetPagesApiResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetPagesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_pending_webhook_event_count(configuration: &configuration::Configuration, params: GetPendingWebhookEventCountParams) -> Result<models::GetPendingWebhookEventCountResponse, Error<GetPendingWebhookEventCountError>> {
let uri_str = format!("{}/api/v1/pending-webhook-events/count", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.comment_id {
req_builder = req_builder.query(&[("commentId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.external_id {
req_builder = req_builder.query(&[("externalId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.event_type {
req_builder = req_builder.query(&[("eventType", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.r#type {
req_builder = req_builder.query(&[("type", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.domain {
req_builder = req_builder.query(&[("domain", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.attempt_count_gt {
req_builder = req_builder.query(&[("attemptCountGT", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetPendingWebhookEventCountResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetPendingWebhookEventCountResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetPendingWebhookEventCountError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_pending_webhook_events(configuration: &configuration::Configuration, params: GetPendingWebhookEventsParams) -> Result<models::GetPendingWebhookEventsResponse, Error<GetPendingWebhookEventsError>> {
let uri_str = format!("{}/api/v1/pending-webhook-events", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.comment_id {
req_builder = req_builder.query(&[("commentId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.external_id {
req_builder = req_builder.query(&[("externalId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.event_type {
req_builder = req_builder.query(&[("eventType", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.r#type {
req_builder = req_builder.query(&[("type", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.domain {
req_builder = req_builder.query(&[("domain", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.attempt_count_gt {
req_builder = req_builder.query(&[("attemptCountGT", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.skip {
req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetPendingWebhookEventsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetPendingWebhookEventsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetPendingWebhookEventsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_question_config(configuration: &configuration::Configuration, params: GetQuestionConfigParams) -> Result<models::GetQuestionConfigResponse, Error<GetQuestionConfigError>> {
let uri_str = format!("{}/api/v1/question-configs/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetQuestionConfigResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetQuestionConfigResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetQuestionConfigError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_question_configs(configuration: &configuration::Configuration, params: GetQuestionConfigsParams) -> Result<models::GetQuestionConfigsResponse, Error<GetQuestionConfigsError>> {
let uri_str = format!("{}/api/v1/question-configs", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.skip {
req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetQuestionConfigsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetQuestionConfigsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetQuestionConfigsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_question_result(configuration: &configuration::Configuration, params: GetQuestionResultParams) -> Result<models::GetQuestionResultResponse, Error<GetQuestionResultError>> {
let uri_str = format!("{}/api/v1/question-results/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetQuestionResultResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetQuestionResultResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetQuestionResultError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_question_results(configuration: &configuration::Configuration, params: GetQuestionResultsParams) -> Result<models::GetQuestionResultsResponse, Error<GetQuestionResultsError>> {
let uri_str = format!("{}/api/v1/question-results", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.url_id {
req_builder = req_builder.query(&[("urlId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.start_date {
req_builder = req_builder.query(&[("startDate", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.question_id {
req_builder = req_builder.query(&[("questionId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.question_ids {
req_builder = req_builder.query(&[("questionIds", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.skip {
req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetQuestionResultsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetQuestionResultsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetQuestionResultsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_sso_user_by_email(configuration: &configuration::Configuration, params: GetSsoUserByEmailParams) -> Result<models::GetSsoUserByEmailApiResponse, Error<GetSsoUserByEmailError>> {
let uri_str = format!("{}/api/v1/sso-users/by-email/{email}", configuration.base_path, email=crate::client::apis::urlencode(params.email));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetSsoUserByEmailApiResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetSsoUserByEmailApiResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetSsoUserByEmailError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_sso_user_by_id(configuration: &configuration::Configuration, params: GetSsoUserByIdParams) -> Result<models::GetSsoUserByIdApiResponse, Error<GetSsoUserByIdError>> {
let uri_str = format!("{}/api/v1/sso-users/by-id/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetSsoUserByIdApiResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetSsoUserByIdApiResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetSsoUserByIdError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_sso_users(configuration: &configuration::Configuration, params: GetSsoUsersParams) -> Result<models::GetSsoUsersResponse, Error<GetSsoUsersError>> {
let uri_str = format!("{}/api/v1/sso-users", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.skip {
req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetSsoUsersResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetSsoUsersResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetSsoUsersError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_subscriptions(configuration: &configuration::Configuration, params: GetSubscriptionsParams) -> Result<models::GetSubscriptionsApiResponse, Error<GetSubscriptionsError>> {
let uri_str = format!("{}/api/v1/subscriptions", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetSubscriptionsApiResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetSubscriptionsApiResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetSubscriptionsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_tenant(configuration: &configuration::Configuration, params: GetTenantParams) -> Result<models::GetTenantResponse, Error<GetTenantError>> {
let uri_str = format!("{}/api/v1/tenants/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTenantResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetTenantResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetTenantError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_tenant_daily_usages(configuration: &configuration::Configuration, params: GetTenantDailyUsagesParams) -> Result<models::GetTenantDailyUsagesResponse, Error<GetTenantDailyUsagesError>> {
let uri_str = format!("{}/api/v1/tenant-daily-usage", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.year_number {
req_builder = req_builder.query(&[("yearNumber", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.month_number {
req_builder = req_builder.query(&[("monthNumber", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.day_number {
req_builder = req_builder.query(&[("dayNumber", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.skip {
req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTenantDailyUsagesResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetTenantDailyUsagesResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetTenantDailyUsagesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_tenant_package(configuration: &configuration::Configuration, params: GetTenantPackageParams) -> Result<models::GetTenantPackageResponse, Error<GetTenantPackageError>> {
let uri_str = format!("{}/api/v1/tenant-packages/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTenantPackageResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetTenantPackageResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetTenantPackageError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_tenant_packages(configuration: &configuration::Configuration, params: GetTenantPackagesParams) -> Result<models::GetTenantPackagesResponse, Error<GetTenantPackagesError>> {
let uri_str = format!("{}/api/v1/tenant-packages", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.skip {
req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTenantPackagesResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetTenantPackagesResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetTenantPackagesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_tenant_user(configuration: &configuration::Configuration, params: GetTenantUserParams) -> Result<models::GetTenantUserResponse, Error<GetTenantUserError>> {
let uri_str = format!("{}/api/v1/tenant-users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTenantUserResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetTenantUserResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetTenantUserError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_tenant_users(configuration: &configuration::Configuration, params: GetTenantUsersParams) -> Result<models::GetTenantUsersResponse, Error<GetTenantUsersError>> {
let uri_str = format!("{}/api/v1/tenant-users", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.skip {
req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTenantUsersResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetTenantUsersResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetTenantUsersError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_tenants(configuration: &configuration::Configuration, params: GetTenantsParams) -> Result<models::GetTenantsResponse, Error<GetTenantsError>> {
let uri_str = format!("{}/api/v1/tenants", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.meta {
req_builder = req_builder.query(&[("meta", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.skip {
req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTenantsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetTenantsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetTenantsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_ticket(configuration: &configuration::Configuration, params: GetTicketParams) -> Result<models::GetTicketResponse, Error<GetTicketError>> {
let uri_str = format!("{}/api/v1/tickets/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTicketResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetTicketResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetTicketError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_tickets(configuration: &configuration::Configuration, params: GetTicketsParams) -> Result<models::GetTicketsResponse, Error<GetTicketsError>> {
let uri_str = format!("{}/api/v1/tickets", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.state {
req_builder = req_builder.query(&[("state", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.skip {
req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetTicketsResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetTicketsResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetTicketsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_user(configuration: &configuration::Configuration, params: GetUserParams) -> Result<models::GetUserResponse, Error<GetUserError>> {
let uri_str = format!("{}/api/v1/users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetUserResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetUserResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetUserError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_user_badge(configuration: &configuration::Configuration, params: GetUserBadgeParams) -> Result<models::ApiGetUserBadgeResponse, Error<GetUserBadgeError>> {
let uri_str = format!("{}/api/v1/user-badges/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiGetUserBadgeResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiGetUserBadgeResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetUserBadgeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_user_badge_progress_by_id(configuration: &configuration::Configuration, params: GetUserBadgeProgressByIdParams) -> Result<models::ApiGetUserBadgeProgressResponse, Error<GetUserBadgeProgressByIdError>> {
let uri_str = format!("{}/api/v1/user-badge-progress/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiGetUserBadgeProgressResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiGetUserBadgeProgressResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetUserBadgeProgressByIdError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_user_badge_progress_by_user_id(configuration: &configuration::Configuration, params: GetUserBadgeProgressByUserIdParams) -> Result<models::ApiGetUserBadgeProgressResponse, Error<GetUserBadgeProgressByUserIdError>> {
let uri_str = format!("{}/api/v1/user-badge-progress/user/{userId}", configuration.base_path, userId=crate::client::apis::urlencode(params.user_id));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiGetUserBadgeProgressResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiGetUserBadgeProgressResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetUserBadgeProgressByUserIdError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_user_badge_progress_list(configuration: &configuration::Configuration, params: GetUserBadgeProgressListParams) -> Result<models::ApiGetUserBadgeProgressListResponse, Error<GetUserBadgeProgressListError>> {
let uri_str = format!("{}/api/v1/user-badge-progress", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.skip {
req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiGetUserBadgeProgressListResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiGetUserBadgeProgressListResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetUserBadgeProgressListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_user_badges(configuration: &configuration::Configuration, params: GetUserBadgesParams) -> Result<models::ApiGetUserBadgesResponse, Error<GetUserBadgesError>> {
let uri_str = format!("{}/api/v1/user-badges", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.badge_id {
req_builder = req_builder.query(&[("badgeId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.r#type {
req_builder = req_builder.query(&[("type", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.displayed_on_comments {
req_builder = req_builder.query(&[("displayedOnComments", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.limit {
req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.skip {
req_builder = req_builder.query(&[("skip", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiGetUserBadgesResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiGetUserBadgesResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetUserBadgesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_votes(configuration: &configuration::Configuration, params: GetVotesParams) -> Result<models::GetVotesResponse, Error<GetVotesError>> {
let uri_str = format!("{}/api/v1/votes", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
req_builder = req_builder.query(&[("urlId", ¶ms.url_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetVotesResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetVotesResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetVotesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn get_votes_for_user(configuration: &configuration::Configuration, params: GetVotesForUserParams) -> Result<models::GetVotesForUserResponse, Error<GetVotesForUserError>> {
let uri_str = format!("{}/api/v1/votes/for-user", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
req_builder = req_builder.query(&[("urlId", ¶ms.url_id.to_string())]);
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.anon_user_id {
req_builder = req_builder.query(&[("anonUserId", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetVotesForUserResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetVotesForUserResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<GetVotesForUserError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn patch_domain_config(configuration: &configuration::Configuration, params: PatchDomainConfigParams) -> Result<models::PatchDomainConfigResponse, Error<PatchDomainConfigError>> {
let uri_str = format!("{}/api/v1/domain-configs/{domainToUpdate}", configuration.base_path, domainToUpdate=crate::client::apis::urlencode(params.domain_to_update));
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.patch_domain_config_params);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PatchDomainConfigResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PatchDomainConfigResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PatchDomainConfigError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn patch_hash_tag(configuration: &configuration::Configuration, params: PatchHashTagParams) -> Result<models::UpdateHashTagResponse, Error<PatchHashTagError>> {
let uri_str = format!("{}/api/v1/hash-tags/{tag}", configuration.base_path, tag=crate::client::apis::urlencode(params.tag));
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.update_hash_tag_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UpdateHashTagResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UpdateHashTagResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PatchHashTagError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn patch_page(configuration: &configuration::Configuration, params: PatchPageParams) -> Result<models::PatchPageApiResponse, Error<PatchPageError>> {
let uri_str = format!("{}/api/v1/pages/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.update_api_page_data);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PatchPageApiResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PatchPageApiResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PatchPageError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn patch_sso_user(configuration: &configuration::Configuration, params: PatchSsoUserParams) -> Result<models::PatchSsoUserApiResponse, Error<PatchSsoUserError>> {
let uri_str = format!("{}/api/v1/sso-users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.update_comments {
req_builder = req_builder.query(&[("updateComments", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.update_apisso_user_data);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PatchSsoUserApiResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PatchSsoUserApiResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PatchSsoUserError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn put_domain_config(configuration: &configuration::Configuration, params: PutDomainConfigParams) -> Result<models::PutDomainConfigResponse, Error<PutDomainConfigError>> {
let uri_str = format!("{}/api/v1/domain-configs/{domainToUpdate}", configuration.base_path, domainToUpdate=crate::client::apis::urlencode(params.domain_to_update));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.update_domain_config_params);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PutDomainConfigResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PutDomainConfigResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PutDomainConfigError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn put_sso_user(configuration: &configuration::Configuration, params: PutSsoUserParams) -> Result<models::PutSsoUserApiResponse, Error<PutSsoUserError>> {
let uri_str = format!("{}/api/v1/sso-users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.update_comments {
req_builder = req_builder.query(&[("updateComments", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.update_apisso_user_data);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PutSsoUserApiResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PutSsoUserApiResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PutSsoUserError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn render_email_template(configuration: &configuration::Configuration, params: RenderEmailTemplateParams) -> Result<models::RenderEmailTemplateResponse, Error<RenderEmailTemplateError>> {
let uri_str = format!("{}/api/v1/email-templates/render", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.locale {
req_builder = req_builder.query(&[("locale", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.render_email_template_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RenderEmailTemplateResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RenderEmailTemplateResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<RenderEmailTemplateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn replace_tenant_package(configuration: &configuration::Configuration, params: ReplaceTenantPackageParams) -> Result<models::ApiEmptyResponse, Error<ReplaceTenantPackageError>> {
let uri_str = format!("{}/api/v1/tenant-packages/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.replace_tenant_package_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ReplaceTenantPackageError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn replace_tenant_user(configuration: &configuration::Configuration, params: ReplaceTenantUserParams) -> Result<models::ApiEmptyResponse, Error<ReplaceTenantUserError>> {
let uri_str = format!("{}/api/v1/tenant-users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.update_comments {
req_builder = req_builder.query(&[("updateComments", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.replace_tenant_user_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ReplaceTenantUserError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn save_comment(configuration: &configuration::Configuration, params: SaveCommentParams) -> Result<models::ApiSaveCommentResponse, Error<SaveCommentError>> {
let uri_str = format!("{}/api/v1/comments", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.is_live {
req_builder = req_builder.query(&[("isLive", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.do_spam_check {
req_builder = req_builder.query(&[("doSpamCheck", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.send_emails {
req_builder = req_builder.query(&[("sendEmails", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.populate_notifications {
req_builder = req_builder.query(&[("populateNotifications", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.create_comment_params);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiSaveCommentResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiSaveCommentResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<SaveCommentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn save_comments_bulk(configuration: &configuration::Configuration, params: SaveCommentsBulkParams) -> Result<Vec<models::SaveCommentsBulkResponse>, Error<SaveCommentsBulkError>> {
let uri_str = format!("{}/api/v1/comments/bulk", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.is_live {
req_builder = req_builder.query(&[("isLive", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.do_spam_check {
req_builder = req_builder.query(&[("doSpamCheck", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.send_emails {
req_builder = req_builder.query(&[("sendEmails", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.populate_notifications {
req_builder = req_builder.query(&[("populateNotifications", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.create_comment_params);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::SaveCommentsBulkResponse>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::SaveCommentsBulkResponse>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<SaveCommentsBulkError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn send_invite(configuration: &configuration::Configuration, params: SendInviteParams) -> Result<models::ApiEmptyResponse, Error<SendInviteError>> {
let uri_str = format!("{}/api/v1/moderators/{id}/send-invite", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
req_builder = req_builder.query(&[("fromName", ¶ms.from_name.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<SendInviteError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn send_login_link(configuration: &configuration::Configuration, params: SendLoginLinkParams) -> Result<models::ApiEmptyResponse, Error<SendLoginLinkError>> {
let uri_str = format!("{}/api/v1/tenant-users/{id}/send-login-link", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.redirect_url {
req_builder = req_builder.query(&[("redirectURL", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<SendLoginLinkError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn un_block_user_from_comment(configuration: &configuration::Configuration, params: UnBlockUserFromCommentParams) -> Result<models::UnblockSuccess, Error<UnBlockUserFromCommentError>> {
let uri_str = format!("{}/api/v1/comments/{id}/un-block", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.anon_user_id {
req_builder = req_builder.query(&[("anonUserId", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.un_block_from_comment_params);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UnblockSuccess`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UnblockSuccess`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UnBlockUserFromCommentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn un_flag_comment(configuration: &configuration::Configuration, params: UnFlagCommentParams) -> Result<models::FlagCommentResponse, Error<UnFlagCommentError>> {
let uri_str = format!("{}/api/v1/comments/{id}/un-flag", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.anon_user_id {
req_builder = req_builder.query(&[("anonUserId", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FlagCommentResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FlagCommentResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UnFlagCommentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn update_comment(configuration: &configuration::Configuration, params: UpdateCommentParams) -> Result<models::ApiEmptyResponse, Error<UpdateCommentError>> {
let uri_str = format!("{}/api/v1/comments/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.context_user_id {
req_builder = req_builder.query(&[("contextUserId", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.do_spam_check {
req_builder = req_builder.query(&[("doSpamCheck", ¶m_value.to_string())]);
}
if let Some(ref param_value) = params.is_live {
req_builder = req_builder.query(&[("isLive", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.updatable_comment_params);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateCommentError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn update_email_template(configuration: &configuration::Configuration, params: UpdateEmailTemplateParams) -> Result<models::ApiEmptyResponse, Error<UpdateEmailTemplateError>> {
let uri_str = format!("{}/api/v1/email-templates/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.update_email_template_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateEmailTemplateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn update_feed_post(configuration: &configuration::Configuration, params: UpdateFeedPostParams) -> Result<models::ApiEmptyResponse, Error<UpdateFeedPostError>> {
let uri_str = format!("{}/api/v1/feed-posts/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.feed_post);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateFeedPostError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn update_moderator(configuration: &configuration::Configuration, params: UpdateModeratorParams) -> Result<models::ApiEmptyResponse, Error<UpdateModeratorError>> {
let uri_str = format!("{}/api/v1/moderators/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.update_moderator_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateModeratorError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn update_notification(configuration: &configuration::Configuration, params: UpdateNotificationParams) -> Result<models::ApiEmptyResponse, Error<UpdateNotificationError>> {
let uri_str = format!("{}/api/v1/notifications/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.update_notification_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateNotificationError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn update_question_config(configuration: &configuration::Configuration, params: UpdateQuestionConfigParams) -> Result<models::ApiEmptyResponse, Error<UpdateQuestionConfigError>> {
let uri_str = format!("{}/api/v1/question-configs/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.update_question_config_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateQuestionConfigError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn update_question_result(configuration: &configuration::Configuration, params: UpdateQuestionResultParams) -> Result<models::ApiEmptyResponse, Error<UpdateQuestionResultError>> {
let uri_str = format!("{}/api/v1/question-results/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.update_question_result_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateQuestionResultError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn update_subscription(configuration: &configuration::Configuration, params: UpdateSubscriptionParams) -> Result<models::UpdateSubscriptionApiResponse, Error<UpdateSubscriptionError>> {
let uri_str = format!("{}/api/v1/subscriptions/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.user_id {
req_builder = req_builder.query(&[("userId", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.update_api_user_subscription_data);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UpdateSubscriptionApiResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UpdateSubscriptionApiResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateSubscriptionError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn update_tenant(configuration: &configuration::Configuration, params: UpdateTenantParams) -> Result<models::ApiEmptyResponse, Error<UpdateTenantError>> {
let uri_str = format!("{}/api/v1/tenants/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.update_tenant_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateTenantError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn update_tenant_package(configuration: &configuration::Configuration, params: UpdateTenantPackageParams) -> Result<models::ApiEmptyResponse, Error<UpdateTenantPackageError>> {
let uri_str = format!("{}/api/v1/tenant-packages/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.update_tenant_package_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateTenantPackageError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn update_tenant_user(configuration: &configuration::Configuration, params: UpdateTenantUserParams) -> Result<models::ApiEmptyResponse, Error<UpdateTenantUserError>> {
let uri_str = format!("{}/api/v1/tenant-users/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref param_value) = params.update_comments {
req_builder = req_builder.query(&[("updateComments", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.update_tenant_user_body);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptyResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptyResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateTenantUserError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}
pub async fn update_user_badge(configuration: &configuration::Configuration, params: UpdateUserBadgeParams) -> Result<models::ApiEmptySuccessResponse, Error<UpdateUserBadgeError>> {
let uri_str = format!("{}/api/v1/user-badges/{id}", configuration.base_path, id=crate::client::apis::urlencode(params.id));
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
req_builder = req_builder.query(&[("tenantId", ¶ms.tenant_id.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("x-api-key", value);
};
req_builder = req_builder.json(¶ms.update_user_badge_params);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ApiEmptySuccessResponse`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ApiEmptySuccessResponse`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<UpdateUserBadgeError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { status, content, entity }))
}
}