FastComments.com

FastComments Rust SDK


Ceci est le SDK Rust officiel pour FastComments.

SDK Rust officiel pour l'API FastComments

Dépôt

Voir sur GitHub


Installation Internal Link


cargo add fastcomments-sdk

Le SDK nécessite l'édition Rust 2021 ou une version ultérieure.

Library Contents Internal Link

Le SDK Rust de FastComments se compose de plusieurs modules :

  • Client Module - Client API généré automatiquement pour les API REST de FastComments

    • Définitions de types complètes pour tous les modèles d'API
    • Points de terminaison à la fois authentifiés (DefaultApi) et publics (PublicApi)
    • Prise en charge complète d'async/await avec tokio
    • Voir client/README.md pour la documentation détaillée de l'API
  • SSO Module - Utilitaires Single Sign-On côté serveur

    • Génération sécurisée de jetons pour l'authentification des utilisateurs
    • Prise en charge des modes SSO simple et sécurisé
    • Signature des jetons basée sur HMAC-SHA256
  • Core Types - Définitions de types partagées et utilitaires

    • Modèles de commentaires et structures de métadonnées
    • Configurations des utilisateurs et des locataires
    • Fonctions utilitaires pour les opérations courantes

Quick Start Internal Link

Utilisation de l'API publique

use fastcomments_sdk::client::apis::configuration::Configuration;
use fastcomments_sdk::client::apis::public_api;

#[tokio::main]
async fn main() {
    // Créer la configuration de l'API
    let config = Configuration::new();

    // Récupérer les commentaires d'une page
    let result = public_api::get_comments_public(
        &config,
        public_api::GetCommentsPublicParams {
            tenant_id: "your-tenant-id".to_string(),
            urlid: Some("page-url-id".to_string()),
            url: None,
            count_only: None,
            skip: None,
            limit: None,
            sort_dir: None,
            page: None,
            sso_hash: None,
            simple_sso_hash: None,
            has_no_comment: None,
            has_comment: None,
            comment_id_filter: None,
            child_ids: None,
            start_date_time: None,
            starts_with: None,
        },
    )
    .await;

    match result {
        Ok(response) => {
            println!("Found {} comments", response.comments.len());
            for comment in response.comments {
                println!("Comment: {:?}", comment);
            }
        }
        Err(e) => eprintln!("Error fetching comments: {:?}", e),
    }
}

Utilisation de l'API authentifiée

use fastcomments_sdk::client::apis::configuration::{ApiKey, Configuration};
use fastcomments_sdk::client::apis::default_api;

#[tokio::main]
async fn main() {
    // Créer la configuration avec la clé API
    let mut config = Configuration::new();
    config.api_key = Some(ApiKey {
        prefix: None,
        key: "your-api-key".to_string(),
    });

    // Récupérer les commentaires en utilisant l'API authentifiée
    let result = default_api::get_comments(
        &config,
        default_api::GetCommentsParams {
            tenant_id: "your-tenant-id".to_string(),
            skip: None,
            limit: None,
            sort_dir: None,
            urlid: Some("page-url-id".to_string()),
            url: None,
            is_spam: None,
            user_id: None,
            all_comments: None,
            for_moderation: None,
            parent_id: None,
            is_flagged: None,
            is_flagged_tag: None,
            is_by_verified: None,
            is_pinned: None,
            asc: None,
            include_imported: None,
            origin: None,
            tags: None,
        },
    )
    .await;

    match result {
        Ok(response) => {
            println!("Total comments: {}", response.count);
            for comment in response.comments {
                println!("Comment ID: {}, Text: {}", comment.id, comment.comment);
            }
        }
        Err(e) => eprintln!("Error: {:?}", e),
    }
}

Utilisation de SSO pour l'authentification

use fastcomments_sdk::sso::{
    fastcomments_sso::FastCommentsSSO,
    secure_sso_user_data::SecureSSOUserData,
};

fn main() {
    let api_key = "your-api-key".to_string();

    // Créer les données utilisateur SSO sécurisées (côté serveur uniquement !)
    let user_data = SecureSSOUserData::new(
        "user-123".to_string(),           // ID utilisateur
        "user@example.com".to_string(),   // Adresse e-mail
        "John Doe".to_string(),            // Nom d'utilisateur
        "https://example.com/avatar.jpg".to_string(), // URL de l'avatar
    );

    // Générer le token SSO
    let sso = FastCommentsSSO::new_secure(api_key, &user_data).unwrap();
    let token = sso.create_token().unwrap();

    println!("SSO Token: {}", token);
    // Transmettez ce token à votre frontend pour l'authentification
}

Common Issues Internal Link

401 Unauthorized Errors

Si vous obtenez des erreurs 401 lorsque vous utilisez l'API authentifiée :

  1. Vérifiez votre clé API : Assurez-vous d'utiliser la clé API correcte depuis votre tableau de bord FastComments
  2. Vérifiez le tenant ID : Assurez-vous que le tenant ID correspond à votre compte
  3. Format de la clé API : La clé API doit être passée dans la Configuration :
let mut config = Configuration::new();
config.api_key = Some(ApiKey {
    prefix: None,
    key: "YOUR_API_KEY".to_string(),
});

SSO Token Issues

Si les jetons SSO ne fonctionnent pas :

  1. Utilisez le mode sécurisé en production : Toujours utiliser FastCommentsSSO::new_secure() avec votre clé API pour la production
  2. Côté serveur uniquement : Générez les jetons SSO sur votre serveur, n'exposez jamais votre clé API aux clients
  3. Vérifiez les données utilisateur : Assurez-vous que tous les champs requis (id, email, username) sont fournis

Async Runtime Errors

Le SDK utilise tokio pour les opérations asynchrones. Assurez-vous de :

  1. Add tokio to your dependencies:

    [dependencies]
    tokio = { version = "1", features = ["full"] }
  2. Use the tokio runtime:

    #[tokio::main]
    async fn main() {
     // Votre code asynchrone ici
    }

Notes Internal Link


Identifiants de diffusion

Vous verrez que vous devez passer un broadcastId dans certains appels d'API. Lorsque vous recevez des événements, vous récupérerez cet ID, ce qui vous permet d'ignorer l'événement si vous prévoyez d'appliquer les modifications de manière optimiste côté client

(ce que vous souhaiterez probablement faire car cela offre la meilleure expérience). Passez un UUID ici. L'ID doit être suffisamment unique pour ne pas apparaître deux fois au cours d'une même session du navigateur.

aggregate Internal Link

Agrège les documents en les groupant (si groupBy est fourni) et en appliquant plusieurs opérations. Différentes opérations (p. ex. sum, countDistinct, avg, etc.) sont prises en charge.

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
aggregation_request models::AggregationRequest Oui
parent_tenant_id String Non
include_stats bool Non

Réponse

Retourne : AggregationResponse


get_audit_logs Internal Link

Paramètres

Name Type Required Description
tenant_id String Oui
limit f64 Non
skip f64 Non
order models::SortDir Non
after f64 Non
before f64 Non

Réponse

Retourne : GetAuditLogs200Response


block_from_comment_public Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
comment_id String Oui
public_block_from_comment_params models::PublicBlockFromCommentParams Oui
sso String Non

Réponse

Renvoie: BlockFromCommentPublic200Response


un_block_comment_public Internal Link


Paramètres

Nom Type Requis Description
tenant_id String Oui
comment_id String Oui
public_block_from_comment_params models::PublicBlockFromCommentParams Oui
sso String Non

Réponse

Retourne: UnBlockCommentPublic200Response


checked_comments_for_blocked Internal Link


Paramètres

Nom Type Requis Description
tenant_id String Oui
comment_ids String Oui
sso String Non

Réponse

Renvoie : CheckedCommentsForBlocked200Response


block_user_from_comment Internal Link

Paramètres

Name Type Requis Description
tenant_id String Oui
id String Oui
block_from_comment_params models::BlockFromCommentParams Oui
user_id String Non
anon_user_id String Non

Réponse

Retourne : BlockFromCommentPublic200Response


create_comment_public Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
url_id String Oui
broadcast_id String Oui
comment_data models::CommentData Oui
session_id String Non
sso String Non

Réponse

Renvoie: CreateCommentPublic200Response


delete_comment Internal Link


Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui
context_user_id String Non
is_live bool Non

Réponse

Retourne : DeleteComment200Response


delete_comment_public Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
comment_id String Oui
broadcast_id String Oui
edit_key String Non
sso String Non

Réponse

Renvoie : DeleteCommentPublic200Response


delete_comment_vote Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
comment_id String Oui
vote_id String Oui
url_id String Oui
broadcast_id String Oui
edit_key String Non
sso String Non

Réponse

Renvoie : DeleteCommentVote200Response


flag_comment Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui
user_id String Non
anon_user_id String Non

Réponse

Renvoie : FlagComment200Response


get_comment Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Yes
id String Yes

Réponse

Renvoie : GetComment200Response


get_comment_text Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
comment_id String Oui
edit_key String Non
sso String Non

Réponse

Retourne : GetCommentText200Response


get_comment_vote_user_names Internal Link


Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
comment_id String Oui
dir i32 Oui
sso String Non

Réponse

Retourne : GetCommentVoteUserNames200Response


get_comments Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
page i32 Non
limit i32 Non
skip i32 Non
as_tree bool Non
skip_children i32 Non
limit_children i32 Non
max_tree_depth i32 Non
url_id String Non
user_id String Non
anon_user_id String Non
context_user_id String Non
hash_tag String Non
parent_id String Non
direction models::SortDirections Non

Réponse

Renvoie: GetComments200Response


get_comments_public Internal Link

req tenantId urlId

Paramètres

Name Type Required Description
tenant_id String Oui
url_id String Oui
page i32 Non
direction models::SortDirections Non
sso String Non
skip i32 Non
skip_children i32 Non
limit i32 Non
limit_children i32 Non
count_children bool Non
fetch_page_for_comment_id String Non
include_config bool Non
count_all bool Non
includei10n bool Non
locale String Non
modules String Non
is_crawler bool Non
include_notification_count bool Non
as_tree bool Non
max_tree_depth i32 Non
use_full_translation_ids bool Non
parent_id String Non
search_text String Non
hash_tags Vec Non
user_id String Non
custom_config_str String Non
after_comment_id String Non
before_comment_id String Non

Réponse

Renvoie: GetCommentsPublic200Response

lock_comment Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
comment_id String Oui
broadcast_id String Oui
sso String Non

Réponse

Renvoie: LockComment200Response


pin_comment Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
comment_id String Oui
broadcast_id String Oui
sso String Non

Réponse

Renvoie: PinComment200Response


save_comment Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
create_comment_params models::CreateCommentParams Oui
is_live bool Non
do_spam_check bool Non
send_emails bool Non
populate_notifications bool Non

Réponse

Renvoie : SaveComment200Response


save_comments_bulk Internal Link


Paramètres

Nom Type Requis Description
tenant_id String Oui
create_comment_params Vecmodels::CreateCommentParams Oui
is_live bool Non
do_spam_check bool Non
send_emails bool Non
populate_notifications bool Non

Réponse

Retourne : Vec<models::SaveComment200Response>


set_comment_text Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
comment_id String Oui
broadcast_id String Oui
comment_text_update_request models::CommentTextUpdateRequest Oui
edit_key String Non
sso String Non

Réponse

Renvoie: SetCommentText200Response


un_block_user_from_comment Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui
un_block_from_comment_params models::UnBlockFromCommentParams Oui
user_id String Non
anon_user_id String Non

Réponse

Renvoie : UnBlockCommentPublic200Response


un_flag_comment Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui
user_id String Non
anon_user_id String Non

Réponse

Retourne: FlagComment200Response


un_lock_comment Internal Link


Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
comment_id String Oui
broadcast_id String Oui
sso String Non

Réponse

Renvoie: LockComment200Response


un_pin_comment Internal Link

Paramètres

Name Type Obligatoire Description
tenant_id String Oui
comment_id String Oui
broadcast_id String Oui
sso String Non

Réponse

Renvoie : PinComment200Response


update_comment Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui
body models::PickApiCommentPeriodUpdatableCommentFields Oui
context_user_id String Non
do_spam_check bool Non
is_live bool Non

Réponse

Renvoie: FlagCommentPublic200Response


vote_comment Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
comment_id String Oui
url_id String Oui
broadcast_id String Oui
vote_body_params models::VoteBodyParams Oui
session_id String Non
sso String Non

Réponse

Renvoie: VoteComment200Response


add_domain_config Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
add_domain_config_params models::AddDomainConfigParams Oui

Réponse

Renvoie : AddDomainConfig200Response


delete_domain_config Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
domain String Oui

Réponse

Renvoie: DeleteDomainConfig200Response


get_domain_config Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
domain String Oui

Réponse

Renvoie : GetDomainConfig200Response


get_domain_configs Internal Link


Paramètres

Nom Type Requis Description
tenant_id String Oui

Réponse

Renvoie: GetDomainConfigs200Response


patch_domain_config Internal Link


Paramètres

Nom Type Requis Description
tenant_id String Oui
domain_to_update String Oui
patch_domain_config_params models::PatchDomainConfigParams Oui

Réponse

Retourne: GetDomainConfig200Response


put_domain_config Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
domain_to_update String Oui
update_domain_config_params models::UpdateDomainConfigParams Oui

Réponse

Renvoie : GetDomainConfig200Response

create_email_template Internal Link


Paramètres

Name Type Requis Description
tenant_id String Oui
create_email_template_body models::CreateEmailTemplateBody Oui

Réponse

Retourne: CreateEmailTemplate200Response

Exemple

Exemple create_email_template
Copy Copy
1
2let params: CreateEmailTemplateParams = CreateEmailTemplateParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 create_email_template_body: models::CreateEmailTemplateBody {
5 name: "New Comment Notification".to_string(),
6 subject: "New comment on your article".to_string(),
7 html_body: "<p>A new comment was posted on <strong>{article_title}</strong>.</p>".to_string(),
8 text_body: Some("A new comment was posted on {article_title}.".to_string()),
9 from_email: Some("no-reply@acme-news.com".to_string()),
10 enabled: Some(true),
11 },
12};
13let response: CreateEmailTemplate200Response = create_email_template(&configuration, params).await?;
14

delete_email_template Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de delete_email_template
Copy Copy
1
2async fn run_delete() -> Result<FlagCommentPublic200Response, Error> {
3 let params: DeleteEmailTemplateParams = DeleteEmailTemplateParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "welcome-email-template".to_string(),
6 };
7 let response: FlagCommentPublic200Response = delete_email_template(&configuration, params).await?;
8 Ok(response)
9}
10

delete_email_template_render_error Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui
error_id String Oui

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de delete_email_template_render_error
Copy Copy
1
2async fn delete_email_template_render_error_example() -> Result<FlagCommentPublic200Response, Error> {
3 let params: DeleteEmailTemplateRenderErrorParams = DeleteEmailTemplateRenderErrorParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "marketing/newsletter/welcome-email".to_string(),
6 error_id: "render-err-2026-01-12-01".to_string(),
7 };
8 let response: FlagCommentPublic200Response = delete_email_template_render_error(configuration, params).await?;
9 Ok(response)
10}
11

get_email_template Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui

Réponse

Renvoie : GetEmailTemplate200Response

Exemple

get_email_template Exemple
Copy Copy
1
2async fn fetch_template() -> Result<GetEmailTemplate200Response, Error> {
3 let params: GetEmailTemplateParams = GetEmailTemplateParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "welcome-email-template".to_string(),
6 };
7 let template: GetEmailTemplate200Response = get_email_template(&configuration, params).await?;
8 Ok(template)
9}
10

get_email_template_definitions Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui

Réponse

Renvoie: GetEmailTemplateDefinitions200Response

Exemple

Exemple de get_email_template_definitions
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let config: configuration::Configuration = configuration::Configuration::default();
4 let params: GetEmailTemplateDefinitionsParams = GetEmailTemplateDefinitionsParams {
5 tenant_id: "acme-corp-tenant".to_string(),
6 locale: Some("en-US".to_string()),
7 include_inactive: Some(false),
8 };
9 let resp: GetEmailTemplateDefinitions200Response = get_email_template_definitions(&config, params).await?;
10 let _definitions = resp;
11 Ok(())
12}
13

get_email_template_render_errors Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui
skip f64 Non

Réponse

Renvoie : GetEmailTemplateRenderErrors200Response

Exemple

Exemple de get_email_template_render_errors
Copy Copy
1
2async fn example_call() -> Result<(), Error> {
3 let params: GetEmailTemplateRenderErrorsParams = GetEmailTemplateRenderErrorsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "welcome-email-template".to_string(),
6 skip: Some(10.0),
7 };
8 let _response: GetEmailTemplateRenderErrors200Response =
9 get_email_template_render_errors(&configuration, params).await?;
10 Ok(())
11}
12

get_email_templates Internal Link

Paramètres

Name Type Required Description
tenant_id String Oui
skip f64 Non

Réponse

Renvoie: GetEmailTemplates200Response

Exemple

Exemple de get_email_templates
Copy Copy
1
2async fn fetch_email_templates() -> Result<GetEmailTemplates200Response, Error> {
3 let params: GetEmailTemplatesParams = GetEmailTemplatesParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 skip: Some(20.0),
6 };
7 let templates: GetEmailTemplates200Response = get_email_templates(&configuration, params).await?;
8 Ok(templates)
9}
10

render_email_template Internal Link

Paramètres

Name Type Required Description
tenant_id String Yes
render_email_template_body models::RenderEmailTemplateBody Yes
locale String No

Réponse

Renvoie: RenderEmailTemplate200Response

Exemple

Exemple de render_email_template
Copy Copy
1
2let params: RenderEmailTemplateParams = RenderEmailTemplateParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 render_email_template_body: models::RenderEmailTemplateBody {
5 template_id: "comment-notification".to_string(),
6 subject: Some("New comment on your article".to_string()),
7 placeholders: std::collections::HashMap::from([
8 ("article_title".to_string(), "Rust Gains Momentum in 2026".to_string()),
9 ("comment_author".to_string(), "Jane Doe".to_string()),
10 ("comment_snippet".to_string(), "Great insights — thanks for sharing!".to_string()),
11 ]),
12 },
13 locale: Some("en-US".to_string()),
14};
15let rendered: RenderEmailTemplate200Response = render_email_template(&configuration, params).await?;
16

update_email_template Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui
update_email_template_body models::UpdateEmailTemplateBody Oui

Réponse

Retourne: FlagCommentPublic200Response

Exemple

Exemple de update_email_template
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: UpdateEmailTemplateParams = UpdateEmailTemplateParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "welcome-template-001".to_string(),
6 update_email_template_body: models::UpdateEmailTemplateBody {
7 name: Some("Welcome Template".to_string()),
8 subject: Some("Welcome to Acme News".to_string()),
9 body_html: Some("<p>Hi , welcome to Acme News!</p>".to_string()),
10 from_address: Some("no-reply@acme-news.com".to_string()),
11 reply_to: Some("support@acme-news.com".to_string()),
12 enabled: Some(true),
13 language: Some("en-US".to_string()),
14 custom_config: Some(models::CustomConfigParameters {
15 tracking_pixel_url: Some("https://acme-news.com/pixel".to_string()),
16 }),
17 },
18 };
19
20 let response: FlagCommentPublic200Response = update_email_template(&configuration, params).await?;
21 let _ = response;
22 Ok(())
23}
24

get_event_log Internal Link

req tenantId urlId userIdWS

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
url_id String Oui
user_id_ws String Oui
start_time i64 Oui
end_time i64 Oui

Réponse

Retourne: GetEventLog200Response

get_global_event_log Internal Link

req tenantId urlId userIdWS

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
url_id String Oui
user_id_ws String Oui
start_time i64 Oui
end_time i64 Oui

Réponse

Retourne: GetEventLog200Response

create_feed_post Internal Link

Paramètres

Name Type Requis Description
tenant_id String Oui
create_feed_post_params models::CreateFeedPostParams Oui
broadcast_id String Non
is_live bool Non
do_spam_check bool Non
skip_dup_check bool Non

Réponse

Renvoie : CreateFeedPost200Response


create_feed_post_public Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
create_feed_post_params models::CreateFeedPostParams Oui
broadcast_id String Non
sso String Non

Réponse

Retourne: CreateFeedPostPublic200Response

delete_feed_post_public Internal Link


Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
post_id String Oui
broadcast_id String Non
sso String Non

Réponse

Renvoie: DeleteFeedPostPublic200Response


get_feed_posts Internal Link

req tenantId afterId

Paramètres

Nom Type Requis Description
tenant_id String Oui
after_id String Non
limit i32 Non
tags Vec Non

Réponse

Renvoie : GetFeedPosts200Response


get_feed_posts_public Internal Link


req tenantId afterId

Paramètres

Nom Type Requis Description
tenant_id String Oui
after_id String Non
limit i32 Non
tags Vec Non
sso String Non
is_crawler bool Non
include_user_info bool Non

Réponse

Renvoie : GetFeedPostsPublic200Response


get_feed_posts_stats Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
post_ids Vec Oui
sso String Non

Réponse

Renvoie: GetFeedPostsStats200Response


get_user_reacts_public Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
post_ids Vec Non
sso String Non

Réponse

Renvoie : GetUserReactsPublic200Response


react_feed_post_public Internal Link


Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
post_id String Oui
react_body_params models::ReactBodyParams Oui
is_undo bool Non
broadcast_id String Non
sso String Non

Réponse

Renvoie : ReactFeedPostPublic200Response


update_feed_post Internal Link


Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui
feed_post models::FeedPost Oui

Réponse

Renvoie: FlagCommentPublic200Response


update_feed_post_public Internal Link


Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
post_id String Oui
update_feed_post_params models::UpdateFeedPostParams Oui
broadcast_id String Non
sso String Non

Réponse

Retourne : CreateFeedPostPublic200Response


flag_comment_public Internal Link


Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
comment_id String Oui
is_flagged bool Oui
sso String Non

Réponse

Renvoie: FlagCommentPublic200Response


add_hash_tag Internal Link


Paramètres

Name Type Required Description
tenant_id String Non
create_hash_tag_body models::CreateHashTagBody Non

Réponse

Renvoie: AddHashTag200Response

Exemple

Exemple add_hash_tag
Copy Copy
1
2async fn run_add_hash_tag(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params: AddHashTagParams = AddHashTagParams {
4 tenant_id: Some("acme-corp-tenant".to_string()),
5 create_hash_tag_body: Some(models::CreateHashTagBody {
6 tag: "breaking-news".to_string(),
7 label: Some("Breaking News".to_string()),
8 visible: Some(true),
9 }),
10 };
11
12 let created: AddHashTag200Response = add_hash_tag(configuration, params).await?;
13 println!("{:#?}", created);
14 Ok(())
15}
16

add_hash_tags_bulk Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Non
bulk_create_hash_tags_body models::BulkCreateHashTagsBody Non

Réponse

Renvoie : AddHashTagsBulk200Response

Exemple

Exemple add_hash_tags_bulk
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: AddHashTagsBulkParams = AddHashTagsBulkParams {
4 tenant_id: Some("acme-corp-tenant".to_string()),
5 bulk_create_hash_tags_body: Some(models::BulkCreateHashTagsBody {
6 tags: vec![
7 models::BulkCreateHashTagsBodyTagsInner {
8 name: "news/article".to_string(),
9 path: "news/article".to_string(),
10 description: Some("Article tag for front page".to_string()),
11 enabled: Some(true),
12 },
13 ],
14 }),
15 };
16
17 let response: AddHashTagsBulk200Response = add_hash_tags_bulk(&configuration, params).await?;
18 Ok(())
19}
20

delete_hash_tag Internal Link

Paramètres

Nom Type Requis Description
tag String Yes
tenant_id String No
delete_hash_tag_request models::DeleteHashTagRequest No

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de delete_hash_tag
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: DeleteHashTagParams = DeleteHashTagParams {
4 tag: "news/politics".to_string(),
5 tenant_id: Some("acme-corp-tenant".to_string()),
6 delete_hash_tag_request: Some(models::DeleteHashTagRequest::default()),
7 };
8 let response: FlagCommentPublic200Response = delete_hash_tag(&configuration, params).await?;
9 Ok(())
10}
11

get_hash_tags Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
page f64 Non

Réponse

Renvoie: GetHashTags200Response

Exemple

get_hash_tags Exemple
Copy Copy
1
2async fn example_get_hash_tags() -> Result<GetHashTags200Response, Error> {
3 let params: GetHashTagsParams = GetHashTagsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 page: Some(1.0_f64),
6 };
7 let response: GetHashTags200Response = get_hash_tags(&configuration, params).await?;
8 Ok(response)
9}
10

patch_hash_tag Internal Link

Paramètres

Nom Type Requis Description
tag String Oui
tenant_id String Non
update_hash_tag_body models::UpdateHashTagBody Non

Réponse

Renvoie : PatchHashTag200Response

Exemple

Exemple patch_hash_tag
Copy Copy
1
2async fn run_patch_hash_tag() -> Result<PatchHashTag200Response, Error> {
3 let params: PatchHashTagParams = PatchHashTagParams {
4 tag: "breaking-news".to_string(),
5 tenant_id: Some("acme-corp-tenant".to_string()),
6 update_hash_tag_body: Some(models::UpdateHashTagBody {
7 name: "Breaking News".to_string(),
8 description: "Posts about breaking news and urgent updates".to_string(),
9 synonyms: vec!["breaking".to_string(), "urgent".to_string()],
10 is_active: true,
11 }),
12 };
13 let response: PatchHashTag200Response = patch_hash_tag(&configuration, params).await?;
14 Ok(response)
15}
16

create_moderator Internal Link

Paramètres

Name Type Requis Description
tenant_id String Oui
create_moderator_body models::CreateModeratorBody Oui

Réponse

Retourne : CreateModerator200Response

Exemple

Exemple de create_moderator
Copy Copy
1
2async fn run_create_moderator() -> Result<(), Error> {
3 let params: CreateModeratorParams = CreateModeratorParams {
4 tenant_id: "acme-corp-tenant".to_owned(),
5 create_moderator_body: models::CreateModeratorBody {
6 email: "jane.doe@acme.com".to_owned(),
7 display_name: "Jane Doe".to_owned(),
8 role: Some("moderator".to_owned()),
9 active: Some(true),
10 notes: Some("Handles product and support forums".to_owned()),
11 permissions: Some(vec!["approve_comment".to_owned(), "delete_comment".to_owned()]),
12 },
13 };
14
15 let _response: CreateModerator200Response = create_moderator(&configuration, params).await?;
16 Ok(())
17}
18

delete_moderator Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui
send_email String Non

Réponse

Retourne : FlagCommentPublic200Response

Exemple

Exemple de delete_moderator
Copy Copy
1
2async fn run(configuration: &configuration::Configuration) -> Result<FlagCommentPublic200Response, Error> {
3 let params: DeleteModeratorParams = DeleteModeratorParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "moderator-1234".to_string(),
6 send_email: Some("true".to_string()),
7 };
8 let response: FlagCommentPublic200Response = delete_moderator(configuration, params).await?;
9 Ok(response)
10}
11

get_moderator Internal Link


Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui

Réponse

Renvoie: GetModerator200Response

Exemple

Exemple de get_moderator
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params: GetModeratorParams = GetModeratorParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "moderator-42".to_string(),
6 include: Some(vec!["roles".to_string(), "recent_comments".to_string()]),
7 };
8 let moderator: GetModerator200Response = get_moderator(&configuration, params).await?;
9 println!("{:#?}", moderator);
10 Ok(())
11}
12

get_moderators Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
skip f64 Non

Réponse

Renvoie : GetModerators200Response

Exemple

Exemple get_moderators
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: GetModeratorsParams = GetModeratorsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 skip: Some(10.0),
6 };
7 let moderators: GetModerators200Response = get_moderators(&configuration, params).await?;
8 let _moderators = moderators;
9 Ok(())
10}
11

send_invite Internal Link

Paramètres

Name Type Required Description
tenant_id String Yes
id String Yes
from_name String Yes

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple send_invite
Copy Copy
1
2let params: SendInviteParams = SendInviteParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 id: "articles/2026/01/ai-news-12345".to_string(),
5 from_name: "Acme Newsroom".to_string(),
6 reply_to: Some("editorial@acme.com".to_string()),
7 message: Some("You have been invited to moderate comments on this article.".to_string()),
8};
9
10let invite_response: FlagCommentPublic200Response = send_invite(&configuration, params).await?;
11

update_moderator Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui
update_moderator_body models::UpdateModeratorBody Oui

Réponse

Renvoie: FlagCommentPublic200Response

Exemple

Exemple update_moderator
Copy Copy
1
2let params: UpdateModeratorParams = UpdateModeratorParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 id: "moderator-12345".to_string(),
5 update_moderator_body: models::UpdateModeratorBody {
6 username: "jane.doe".to_string(),
7 display_name: Some("Jane Doe".to_string()),
8 email: Some("jane.doe@acme.com".to_string()),
9 is_active: Some(true),
10 permissions: Some(vec!["moderate_comments".to_string(), "view_reports".to_string()]),
11 },
12};
13let response: FlagCommentPublic200Response = update_moderator(&configuration, params).await?;
14

delete_notification_count Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui

Réponse

Retourne : FlagCommentPublic200Response

Exemple

Exemple de delete_notification_count
Copy Copy
1
2async fn run_delete_notification_count(configuration: &configuration::Configuration) -> Result<FlagCommentPublic200Response, Error> {
3 let params: DeleteNotificationCountParams = DeleteNotificationCountParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "notification-9f8b7a6".to_string(),
6 };
7 let response: FlagCommentPublic200Response = delete_notification_count(configuration, params).await?;
8 Ok(response)
9}
10

get_cached_notification_count Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui

Réponse

Renvoie : GetCachedNotificationCount200Response

Exemple

Exemple de get_cached_notification_count
Copy Copy
1
2async fn run_get_cached_notification_count() -> Result<(), Error> {
3 let params: GetCachedNotificationCountParams = GetCachedNotificationCountParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article-12345".to_string(),
6 };
7 let preferred_channel: Option<String> = Some("email".to_string());
8 let response: GetCachedNotificationCount200Response =
9 get_cached_notification_count(&configuration, params).await?;
10 Ok(())
11}
12

get_notification_count Internal Link

Paramètres

Name Type Requis Description
tenant_id String Oui
user_id String Non
url_id String Non
from_comment_id String Non
viewed bool Non

Réponse

Retourne : GetNotificationCount200Response

Exemple

Exemple de get_notification_count
Copy Copy
1
2async fn example_get_notification_count() -> Result<GetNotificationCount200Response, Error> {
3 let params: GetNotificationCountParams = GetNotificationCountParams {
4 tenant_id: String::from("acme-corp-tenant"),
5 user_id: Some(String::from("user-12345")),
6 url_id: Some(String::from("news/article/2026/product-launch")),
7 from_comment_id: Some(String::from("cmt-000987")),
8 viewed: Some(false),
9 };
10 let response: GetNotificationCount200Response = get_notification_count(&configuration, params).await?;
11 Ok(response)
12}
13

get_notifications Internal Link

Paramètres

Name Type Required Description
tenant_id String Oui
user_id String Non
url_id String Non
from_comment_id String Non
viewed bool Non
skip f64 Non

Réponse

Retourne : GetNotifications200Response

Exemple

Exemple de get_notifications
Copy Copy
1
2async fn fetch_notifications() -> Result<(), Error> {
3 let params: GetNotificationsParams = GetNotificationsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 user_id: Some("user-1234".to_string()),
6 url_id: Some("news/politics/article-2026-01-12".to_string()),
7 from_comment_id: Some("cmt-98765".to_string()),
8 viewed: Some(false),
9 skip: Some(0.0),
10 };
11 let notifications: GetNotifications200Response = get_notifications(&configuration, params).await?;
12 let _ = notifications;
13 Ok(())
14}
15

update_notification Internal Link

Paramètres

Name Type Obligatoire Description
tenant_id String Oui
id String Oui
update_notification_body models::UpdateNotificationBody Oui
user_id String Non

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de update_notification
Copy Copy
1
2pub async fn run_update_notification(configuration: &configuration::Configuration) -> Result<FlagCommentPublic200Response, Error> {
3 let params: UpdateNotificationParams = UpdateNotificationParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "notification-67890".to_string(),
6 update_notification_body: models::UpdateNotificationBody {
7 title: Some("Flag Review Complete".to_string()),
8 message: Some("A moderator reviewed the flagged comment and marked it resolved.".to_string()),
9 resolved: Some(true),
10 channels: Some(vec!["email".to_string(), "in_app".to_string()]),
11 },
12 user_id: Some("moderator-007".to_string()),
13 };
14 let response: FlagCommentPublic200Response = update_notification(configuration, params).await?;
15 Ok(response)
16}
17

add_page Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
create_api_page_data models::CreateApiPageData Oui

Réponse

Renvoie: AddPageApiResponse

delete_page Internal Link


Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui

Réponse

Renvoie : DeletePageApiResponse


get_page_by_urlid Internal Link


Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
url_id String Oui

Réponse

Retourne: GetPageByUrlidApiResponse


get_pages Internal Link


Paramètres

Nom Type Obligatoire Description
tenant_id String Oui

Réponse

Renvoie: GetPagesApiResponse


patch_page Internal Link


Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui
update_api_page_data models::UpdateApiPageData Oui

Réponse

Retourne : PatchPageApiResponse


delete_pending_webhook_event Internal Link

Paramètres

Name Type Requis Description
tenant_id String Oui
id String Oui

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de delete_pending_webhook_event
Copy Copy
1
2async fn run() -> Result<FlagCommentPublic200Response, Error> {
3 let event_id_opt: Option<String> = Some("webhook-event/news-article-2026-01-10-1234".to_string());
4 let event_id: String = event_id_opt.unwrap();
5 let params: DeletePendingWebhookEventParams = DeletePendingWebhookEventParams {
6 tenant_id: "acme-corp-tenant".to_string(),
7 id: event_id,
8 };
9 let response: FlagCommentPublic200Response = delete_pending_webhook_event(&configuration, params).await?;
10 Ok(response)
11}
12

get_pending_webhook_event_count Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
comment_id String Non
external_id String Non
event_type String Non
domain String Non
attempt_count_gt f64 Non

Réponse

Renvoie : GetPendingWebhookEventCount200Response

Exemple

Exemple de get_pending_webhook_event_count
Copy Copy
1
2async fn example() -> Result<GetPendingWebhookEventCount200Response, Error> {
3 let params: GetPendingWebhookEventCountParams = GetPendingWebhookEventCountParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: Some("cmt-12345".to_string()),
6 external_id: Some("news/article-98765".to_string()),
7 event_type: Some("comment.created".to_string()),
8 domain: Some("news.example.com".to_string()),
9 attempt_count_gt: Some(2.0),
10 };
11 let response: GetPendingWebhookEventCount200Response =
12 get_pending_webhook_event_count(&configuration, params).await?;
13 Ok(response)
14}
15

get_pending_webhook_events Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
comment_id String Non
external_id String Non
event_type String Non
domain String Non
attempt_count_gt f64 Non
skip f64 Non

Réponse

Renvoie : GetPendingWebhookEvents200Response

Exemple

Exemple get_pending_webhook_events
Copy Copy
1
2let params: GetPendingWebhookEventsParams = GetPendingWebhookEventsParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 comment_id: Some("cmt-12345".to_string()),
5 external_id: Some("article-98765".to_string()),
6 event_type: Some("comment.create".to_string()),
7 domain: Some("news.example.com".to_string()),
8 attempt_count_gt: Some(1.0),
9 skip: Some(0.0),
10};
11
12let pending: GetPendingWebhookEvents200Response = get_pending_webhook_events(&configuration, params).await?;
13

create_question_config Internal Link


Paramètres

Name Type Requis Description
tenant_id String Oui
create_question_config_body models::CreateQuestionConfigBody Oui

Réponse

Renvoie : CreateQuestionConfig200Response

Exemple

Exemple de create_question_config
Copy Copy
1
2let params: CreateQuestionConfigParams = CreateQuestionConfigParams {
3 tenant_id: String::from("acme-corp-tenant"),
4 create_question_config_body: models::CreateQuestionConfigBody {
5 key: String::from("article-usefulness"),
6 label: Some(String::from("Was this article useful?")),
7 description: Some(String::from("Help us improve by rating this article.")),
8 required: Some(true),
9 rendering_type: Some(models::QuestionRenderingType::MultipleChoice),
10 custom_options: Some(vec![
11 models::QuestionConfigCustomOptionsInner { value: String::from("1"), label: Some(String::from("Not useful")) },
12 models::QuestionConfigCustomOptionsInner { value: String::from("3"), label: Some(String::from("Somewhat useful")) },
13 models::QuestionConfigCustomOptionsInner { value: String::from("5"), label: Some(String::from("Very useful")) },
14 ]),
15 enabled: Some(true),
16 },
17};
18let response: CreateQuestionConfig200Response = create_question_config(configuration, params).await?;
19

delete_question_config Internal Link

Paramètres

Name Type Requis Description
tenant_id String Oui
id String Oui

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

delete_question_config Exemple
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: DeleteQuestionConfigParams = DeleteQuestionConfigParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article-comments-config-2025".to_string(),
6 force: Some(true),
7 };
8 let response: FlagCommentPublic200Response = delete_question_config(&configuration, params).await?;
9 Ok(())
10}
11

get_question_config Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui

Réponse

Renvoie : GetQuestionConfig200Response

Exemple

Exemple de get_question_config
Copy Copy
1
2async fn fetch_question_config() -> Result<(), Error> {
3 let tenant_env: Option<&str> = Some("prod");
4 let tenant_id: String = match tenant_env {
5 Some(env) => format!("acme-corp-tenant-{}", env),
6 None => "acme-corp-tenant".to_string(),
7 };
8 let params: GetQuestionConfigParams = GetQuestionConfigParams {
9 tenant_id,
10 id: "news/article/2026/01/12-politics".to_string(),
11 };
12 let response: GetQuestionConfig200Response = get_question_config(&configuration, params).await?;
13 let _status: ApiStatus = response.0;
14 Ok(())
15}
16

get_question_configs Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
skip f64 Non

Réponse

Renvoie: GetQuestionConfigs200Response

Exemple

Exemple de get_question_configs
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: GetQuestionConfigsParams = GetQuestionConfigsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 skip: Some(10.0),
6 };
7 let response: GetQuestionConfigs200Response = get_question_configs(&configuration, params).await?;
8 let _cfgs: GetQuestionConfigs200Response = response;
9 Ok(())
10}
11

update_question_config Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui
update_question_config_body models::UpdateQuestionConfigBody Oui

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de update_question_config
Copy Copy
1
2async fn run_update() -> Result<(), Error> {
3 let params: UpdateQuestionConfigParams = UpdateQuestionConfigParams {
4 tenant_id: String::from("acme-corp-tenant"),
5 id: String::from("news/article-2026-01-12"),
6 update_question_config_body: models::UpdateQuestionConfigBody {
7 question_text: String::from("Did you find this reporting accurate?"),
8 required: Some(true),
9 rendering_type: Some(models::QuestionRenderingType::Inline),
10 options: Some(vec![
11 models::QuestionConfigCustomOptionsInner { id: String::from("opt-yes"), label: String::from("Yes"), value: String::from("yes") },
12 models::QuestionConfigCustomOptionsInner { id: String::from("opt-no"), label: String::from("No"), value: String::from("no") },
13 ]),
14 when_save: Some(models::QuestionWhenSave::OnSubmit),
15 },
16 };
17 let response: FlagCommentPublic200Response = update_question_config(&configuration, params).await?;
18 Ok(())
19}
20

create_question_result Internal Link


Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
create_question_result_body models::CreateQuestionResultBody Oui

Réponse

Retourne: CreateQuestionResult200Response

Exemple

Exemple de create_question_result
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: CreateQuestionResultParams = CreateQuestionResultParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 create_question_result_body: models::CreateQuestionResultBody {
6 question_id: "feedback-article-2026".to_string(),
7 comment_id: Some("cmt-2026-001".to_string()),
8 user_id: Some("reader-007".to_string()),
9 answer: "yes".to_string(),
10 score: Some(4),
11 metadata: Some(std::collections::HashMap::from([(
12 "path".to_string(),
13 "news/politics/2026-election".to_string(),
14 )])),
15 anonymous: Some(false),
16 submitted_at: Some("2026-01-12T09:15:00Z".to_string()),
17 },
18 };
19
20 let created: CreateQuestionResult200Response = create_question_result(&configuration, params).await?;
21 Ok(())
22}
23

delete_question_result Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui

Réponse

Renvoie: FlagCommentPublic200Response

Exemple

Exemple de delete_question_result
Copy Copy
1
2async fn run_delete() -> Result<(), Error> {
3 let params: DeleteQuestionResultParams = DeleteQuestionResultParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article/12345/question/67890".to_string(),
6 dry_run: Some(false),
7 request_id: Some("req-20260112-7a3b".to_string()),
8 };
9 let response: FlagCommentPublic200Response = delete_question_result(&configuration, params).await?;
10 Ok(())
11}
12

get_question_result Internal Link

Paramètres

Name Type Requis Description
tenant_id String Oui
id String Oui

Réponse

Renvoie: GetQuestionResult200Response

Exemple

Exemple get_question_result
Copy Copy
1
2async fn run() -> Result<GetQuestionResult200Response, Error> {
3 let include_metadata: Option<bool> = Some(true);
4 let params: GetQuestionResultParams = GetQuestionResultParams {
5 tenant_id: "acme-corp-tenant".to_string(),
6 id: "news/article/2026/12345".to_string(),
7 };
8 let response: GetQuestionResult200Response = get_question_result(&configuration, params).await?;
9 Ok(response)
10}
11

get_question_results Internal Link

Paramètres

Name Type Requis Description
tenant_id String Oui
url_id String Non
user_id String Non
start_date String Non
question_id String Non
question_ids String Non
skip f64 Non

Réponse

Renvoie : GetQuestionResults200Response

Exemple

Exemple pour get_question_results
Copy Copy
1
2async fn example_get_question_results() -> Result<(), Error> {
3 let params = GetQuestionResultsParams {
4 tenant_id: String::from("acme-corp-tenant"),
5 url_id: Some(String::from("news/article/2026/01/12/breaking")),
6 user_id: Some(String::from("user-98765")),
7 start_date: Some(String::from("2025-12-01")),
8 question_id: Some(String::from("q-42")),
9 question_ids: Some(String::from("q-42,q-43")),
10 skip: Some(10.0),
11 };
12 let results: GetQuestionResults200Response = get_question_results(&configuration, params).await?;
13 Ok(())
14}
15

update_question_result Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui
update_question_result_body models::UpdateQuestionResultBody Oui

Réponse

Renvoie: FlagCommentPublic200Response

Exemple

Exemple de update_question_result
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let body: models::UpdateQuestionResultBody = models::UpdateQuestionResultBody {
4 question_id: "q-12345".to_string(),
5 result: true,
6 comment: Some("Marked by moderator after review".to_string()),
7 };
8
9 let params: UpdateQuestionResultParams = UpdateQuestionResultParams {
10 tenant_id: "acme-corp-tenant".to_string(),
11 id: "news/article/98765".to_string(),
12 update_question_result_body: body,
13 };
14
15 let response: FlagCommentPublic200Response = update_question_result(&configuration, params).await?;
16 println!("{:#?}", response);
17 Ok(())
18}
19

aggregate_question_results Internal Link

Paramètres

Name Type Required Description
tenant_id String Oui
question_id String Non
question_ids Vec Non
url_id String Non
time_bucket models::AggregateTimeBucket Non
start_date String Non
force_recalculate bool Non

Réponse

Renvoie: AggregateQuestionResults200Response


bulk_aggregate_question_results Internal Link

Paramètres

Name Type Obligatoire Description
tenant_id String Oui
bulk_aggregate_question_results_request models::BulkAggregateQuestionResultsRequest Oui
force_recalculate bool Non

Réponse

Renvoie : BulkAggregateQuestionResults200Response


combine_comments_with_question_results Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
question_id String Non
question_ids Vec Non
url_id String Non
start_date String Non
force_recalculate bool Non
min_value f64 Non
max_value f64 Non
limit f64 Non

Réponse

Renvoie : CombineCommentsWithQuestionResults200Response


add_sso_user Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
create_apisso_user_data models::CreateApissoUserData Oui

Réponse

Renvoie: AddSsoUserApiResponse

delete_sso_user Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui
delete_comments bool Non
comment_delete_mode String Non

Réponse

Renvoie: DeleteSsoUserApiResponse


get_sso_user_by_email Internal Link


Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
email String Oui

Réponse

Renvoie : GetSsoUserByEmailApiResponse


get_sso_user_by_id Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui

Réponse

Renvoie: GetSsoUserByIdApiResponse


get_sso_users Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
skip i32 Non

Réponse

Renvoie : GetSsoUsers200Response


patch_sso_user Internal Link


Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui
update_apisso_user_data models::UpdateApissoUserData Oui
update_comments bool Non

Réponse

Renvoie : PatchSsoUserApiResponse


put_sso_user Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui
update_apisso_user_data models::UpdateApissoUserData Oui
update_comments bool Non

Réponse

Renvoie: PutSsoUserApiResponse


create_subscription Internal Link

Paramètres

Name Type Required Description
tenant_id String Oui
create_api_user_subscription_data models::CreateApiUserSubscriptionData Oui

Réponse

Renvoie: CreateSubscriptionApiResponse


delete_subscription Internal Link

Paramètres

Name Type Requis Description
tenant_id String Oui
id String Oui
user_id String Non

Réponse

Retourne: DeleteSubscriptionApiResponse


get_subscriptions Internal Link


Paramètres

Nom Type Requis Description
tenant_id String Oui
user_id String Non

Réponse

Renvoie: GetSubscriptionsApiResponse


get_tenant_daily_usages Internal Link


Paramètres

Name Type Requis Description
tenant_id String Oui
year_number f64 Non
month_number f64 Non
day_number f64 Non
skip f64 Non

Réponse

Renvoie : GetTenantDailyUsages200Response

Exemple

Exemple de get_tenant_daily_usages
Copy Copy
1
2async fn example() -> Result<GetTenantDailyUsages200Response, Error> {
3 let params: GetTenantDailyUsagesParams = GetTenantDailyUsagesParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 year_number: Some(2024.0),
6 month_number: Some(9.0),
7 day_number: Some(15.0),
8 skip: Some(0.0),
9 };
10 let response: GetTenantDailyUsages200Response = get_tenant_daily_usages(&configuration, params).await?;
11 Ok(response)
12}
13

create_tenant_package Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
create_tenant_package_body models::CreateTenantPackageBody Oui

Réponse

Renvoie : CreateTenantPackage200Response

Exemple

Exemple de create_tenant_package
Copy Copy
1
2async fn run_create_package() -> Result<(), Error> {
3 let params: CreateTenantPackageParams = CreateTenantPackageParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 create_tenant_package_body: models::CreateTenantPackageBody {
6 name: "Acme News Package".to_string(),
7 description: Some("Moderated comments for Acme News articles".to_string()),
8 plan: Some("standard".to_string()),
9 allow_gifs: Some(true),
10 gif_rating: Some(GifRating::GeneralAudience),
11 image_content_profanity_level: Some(ImageContentProfanityLevel::Moderate),
12 sso_security_level: Some(SsoSecurityLevel::Strict),
13 custom_config: Some(CustomConfigParameters {
14 max_comment_length: Some(1000),
15 require_moderation: Some(true),
16 }),
17 },
18 };
19 let response: CreateTenantPackage200Response = create_tenant_package(&configuration, params).await?;
20 let _package: TenantPackage = response.0;
21 Ok(())
22}
23

delete_tenant_package Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui

Réponse

Retourne: FlagCommentPublic200Response

Exemple

Exemple de delete_tenant_package
Copy Copy
1
2let params: DeleteTenantPackageParams = DeleteTenantPackageParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 id: "pkg-news-comments-2025-01".to_string(),
5 cascade: Some(true),
6};
7let response: FlagCommentPublic200Response = delete_tenant_package(&configuration, params).await?;
8

get_tenant_package Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui

Réponse

Renvoie : GetTenantPackage200Response

Exemple

Exemple de get_tenant_package
Copy Copy
1
2async fn example_get_tenant_package(configuration: &configuration::Configuration) -> Result<GetTenantPackage200Response, Error> {
3 let params: GetTenantPackageParams = GetTenantPackageParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "premium-plan".to_string(),
6 include_details: Some(true),
7 };
8 let package: GetTenantPackage200Response = get_tenant_package(configuration, params).await?;
9 Ok(package)
10}
11

get_tenant_packages Internal Link

Paramètres

Name Type Required Description
tenant_id String Oui
skip f64 Non

Réponse

Retourne : GetTenantPackages200Response

Exemple

Exemple de get_tenant_packages
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: GetTenantPackagesParams = GetTenantPackagesParams {
4 tenant_id: String::from("acme-corp-tenant"),
5 skip: Some(20.0),
6 };
7 let _packages: GetTenantPackages200Response = get_tenant_packages(&configuration, params).await?;
8 Ok(())
9}
10

replace_tenant_package Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui
replace_tenant_package_body models::ReplaceTenantPackageBody Oui

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de replace_tenant_package
Copy Copy
1
2async fn run_replace_package() -> Result<FlagCommentPublic200Response, Error> {
3 let params: ReplaceTenantPackageParams = ReplaceTenantPackageParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "package-basic-2026".to_string(),
6 replace_tenant_package_body: models::ReplaceTenantPackageBody {
7 name: "Moderation Basic".to_string(),
8 description: Some("Standard moderation package for news sites".to_string()),
9 enabled: Some(true),
10 plan: Some("standard".to_string()),
11 custom_config_parameters: Some(models::CustomConfigParameters {
12 max_comment_length: Some(1000),
13 allow_images: Some(true),
14 }),
15 vote_style: Some(models::VoteStyle::Thumbs),
16 },
17 };
18 let response = replace_tenant_package(&configuration, params).await?;
19 Ok(response)
20}
21

update_tenant_package Internal Link

Paramètres

Name Type Requis Description
tenant_id String Oui
id String Oui
update_tenant_package_body models::UpdateTenantPackageBody Oui

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de update_tenant_package
Copy Copy
1
2async fn example_update_tenant_package() -> Result<FlagCommentPublic200Response, Error> {
3 let params: UpdateTenantPackageParams = UpdateTenantPackageParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "pro-plan-2026".to_string(),
6 update_tenant_package_body: models::UpdateTenantPackageBody {
7 name: Some("Pro Plan".to_string()),
8 description: Some("Priority support, custom branding, and advanced moderation tools".to_string()),
9 enabled: Some(true),
10 monthly_price_cents: Some(1999),
11 features: Some(vec![
12 "priority_support".to_string(),
13 "custom_branding".to_string(),
14 "advanced_moderation".to_string(),
15 ]),
16 },
17 };
18
19 let response: FlagCommentPublic200Response = update_tenant_package(&configuration, params).await?;
20 Ok(response)
21}
22

create_tenant_user Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
create_tenant_user_body models::CreateTenantUserBody Oui

Réponse

Renvoie: CreateTenantUser200Response

Exemple

Exemple de create_tenant_user
Copy Copy
1
2let create_tenant_user_body: models::CreateTenantUserBody = models::CreateTenantUserBody {
3 email: "jane.doe@acme.com".to_string(),
4 display_name: Some("Jane Doe".to_string()),
5 role: Some("moderator".to_string()),
6 external_id: Some("acme-12345".to_string()),
7 subscribed_to_digest: Some(false),
8};
9let params: CreateTenantUserParams = CreateTenantUserParams {
10 tenant_id: "acme-corp-tenant".to_string(),
11 create_tenant_user_body,
12};
13let response: CreateTenantUser200Response = create_tenant_user(&configuration, params).await?;
14

delete_tenant_user Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui
delete_comments String Non
comment_delete_mode String Non

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de delete_tenant_user
Copy Copy
1
2async fn run() -> Result<FlagCommentPublic200Response, Error> {
3 let params: DeleteTenantUserParams = DeleteTenantUserParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "user-12345".to_string(),
6 delete_comments: Some("true".to_string()),
7 comment_delete_mode: Some("cascade".to_string()),
8 };
9 let resp: FlagCommentPublic200Response = delete_tenant_user(&configuration, params).await?;
10 Ok(resp)
11}
12

get_tenant_user Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui

Réponse

Renvoie : GetTenantUser200Response

Exemple

Exemple de get_tenant_user
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: GetTenantUserParams = GetTenantUserParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "user-7a3f2b".to_string(),
6 };
7 let include_related: Option<String> = Some("roles,preferences".to_string());
8 let response: GetTenantUser200Response = get_tenant_user(&configuration, params).await?;
9 Ok(())
10}
11

get_tenant_users Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
skip f64 Non

Réponse

Renvoie : GetTenantUsers200Response

Exemple

Exemple de get_tenant_users
Copy Copy
1
2async fn fetch_tenant_users() -> Result<GetTenantUsers200Response, Error> {
3 let params: GetTenantUsersParams = GetTenantUsersParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 skip: Some(10.0),
6 };
7 let response: GetTenantUsers200Response = get_tenant_users(&configuration, params).await?;
8 Ok(response)
9}
10

replace_tenant_user Internal Link

Paramètres

Name Type Obligatoire Description
tenant_id String Oui
id String Oui
replace_tenant_user_body models::ReplaceTenantUserBody Oui
update_comments String Non

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de replace_tenant_user
Copy Copy
1
2let cfg: &configuration::Configuration = &configuration;
3let replace_tenant_user_body: models::ReplaceTenantUserBody = models::ReplaceTenantUserBody {
4 external_id: Some("acct-834".to_string()),
5 email: Some("jane.doe@acme-news.com".to_string()),
6 display_name: Some("Jane Doe".to_string()),
7 role: Some("moderator".to_string()),
8};
9let params: ReplaceTenantUserParams = ReplaceTenantUserParams {
10 tenant_id: "acme-corp-tenant".to_string(),
11 id: "user-834".to_string(),
12 replace_tenant_user_body,
13 update_comments: Some("true".to_string()),
14};
15let resp: FlagCommentPublic200Response = replace_tenant_user(cfg, params).await?;
16

Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui
redirect_url String Non

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple de send_login_link
Copy Copy
1
2async fn example_send_login_link() -> Result<FlagCommentPublic200Response, Error> {
3 let params: SendLoginLinkParams = SendLoginLinkParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "jane.doe@acme.com".to_string(),
6 redirect_url: Some("https://acme.example.com/dashboard".to_string()),
7 };
8 let response: FlagCommentPublic200Response = send_login_link(&configuration, params).await?;
9 Ok(response)
10}
11

update_tenant_user Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui
update_tenant_user_body models::UpdateTenantUserBody Oui
update_comments String Non

Réponse

Retourne : FlagCommentPublic200Response

Exemple

Exemple de update_tenant_user
Copy Copy
1
2async fn update_user_example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params: UpdateTenantUserParams = UpdateTenantUserParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "user-78b2".to_string(),
6 update_tenant_user_body: models::UpdateTenantUserBody {
7 username: "jdoe".to_string(),
8 display_name: "John Doe".to_string(),
9 email: "john.doe@acme.com".to_string(),
10 roles: vec!["moderator".to_string()],
11 suspended: false,
12 },
13 update_comments: Some("Promoted to moderator for community moderation".to_string()),
14 };
15 let response: FlagCommentPublic200Response = update_tenant_user(configuration, params).await?;
16 println!("updated user response status: {:?}", response);
17 Ok(())
18}
19

create_tenant Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
create_tenant_body models::CreateTenantBody Oui

Réponse

Renvoie: CreateTenant200Response

Exemple

Exemple de create_tenant
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: CreateTenantParams = CreateTenantParams {
4 tenant_id: "acme-news-tenant".to_string(),
5 create_tenant_body: models::CreateTenantBody {
6 name: "Acme News".to_string(),
7 domain: Some("news.acme.com".to_string()),
8 api_domain_configuration: Some(models::ApiDomainConfiguration {
9 domain: "api.news.acme.com".to_string(),
10 enforce_https: true,
11 }),
12 billing_info: Some(models::BillingInfo {
13 contact_email: "billing@acme.com".to_string(),
14 plan_id: "pro_monthly".to_string(),
15 }),
16 imported_site_type: Some(models::ImportedSiteType::Articles),
17 ..Default::default()
18 },
19 };
20
21 let created: CreateTenant200Response = create_tenant(&configuration, params).await?;
22 Ok(())
23}
24

delete_tenant Internal Link

Parameters

Nom Type Requis Description
tenant_id String Oui
id String Oui
sure String Non

Réponse

Retourne : FlagCommentPublic200Response

Exemple

Exemple de delete_tenant
Copy Copy
1
2async fn example_delete_tenant() -> Result<FlagCommentPublic200Response, Error> {
3 let params: DeleteTenantParams = DeleteTenantParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article-12345".to_string(),
6 sure: Some("confirm".to_string()),
7 };
8 let response: FlagCommentPublic200Response = delete_tenant(&configuration, params).await?;
9 Ok(response)
10}
11

get_tenant Internal Link

Paramètres

Name Type Required Description
tenant_id String Oui
id String Oui

Réponse

Renvoie: GetTenant200Response

Exemple

Exemple de get_tenant
Copy Copy
1
2async fn run_get_tenant() -> Result<(), Error> {
3 let params: GetTenantParams = GetTenantParams {
4 tenant_id: String::from("acme-corp-tenant"),
5 id: String::from("news/article"),
6 };
7 let include_metadata: Option<bool> = Some(true);
8 let tenant_response: GetTenant200Response = get_tenant(&configuration, params).await?;
9 Ok(())
10}
11

get_tenants Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
meta String Non
skip f64 Non

Réponse

Renvoie : GetTenants200Response

Exemple

Exemple de get_tenants
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: GetTenantsParams = GetTenantsParams {
4 tenant_id: String::from("acme-corp-tenant"),
5 meta: Some(String::from("include=domains,settings")),
6 skip: Some(10.0),
7 };
8 let response: GetTenants200Response = get_tenants(&configuration, params).await?;
9 Ok(())
10}
11

update_tenant Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui
update_tenant_body models::UpdateTenantBody Oui

Réponse

Renvoie : FlagCommentPublic200Response

Exemple

Exemple pour update_tenant
Copy Copy
1
2async fn run_update_tenant() -> Result<FlagCommentPublic200Response, Error> {
3 let params: UpdateTenantParams = UpdateTenantParams {
4 tenant_id: "acme-corp-tenant".to_owned(),
5 id: "site-42".to_owned(),
6 update_tenant_body: models::UpdateTenantBody {
7 name: Some("Acme Corporation".to_string()),
8 default_site: Some("news/article".to_string()),
9 allowed_origins: Some(vec![
10 "https://www.acme.com".to_string(),
11 "https://blog.acme.com".to_string(),
12 ]),
13 invite_only: Some(false),
14 api_domain_configuration: Some(ApiDomainConfiguration {
15 domain: "comments.acme.com".to_string(),
16 secure: Some(true),
17 ..Default::default()
18 }),
19 ..Default::default()
20 },
21 };
22 let response: FlagCommentPublic200Response = update_tenant(&configuration, params).await?;
23 Ok(response)
24}
25

upload_image Internal Link

Téléverser et redimensionner une image

Paramètres

Nom Type Requis Description
tenant_id String Oui
file std::path::PathBuf Oui
size_preset models::SizePreset Non
url_id String Non

Réponse

Renvoie: UploadImageResponse


get_user_badge_progress_by_id Internal Link


Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui

Réponse

Retourne : GetUserBadgeProgressById200Response


get_user_badge_progress_by_user_id Internal Link


Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
user_id String Oui

Réponse

Renvoie : GetUserBadgeProgressById200Response


get_user_badge_progress_list Internal Link


Paramètres

Nom Type Requis Description
tenant_id String Oui
user_id String Non
limit f64 Non
skip f64 Non

Réponse

Renvoie : GetUserBadgeProgressList200Response


create_user_badge Internal Link

Paramètres

Name Type Requis Description
tenant_id String Oui
create_user_badge_params models::CreateUserBadgeParams Oui

Réponse

Retourne: CreateUserBadge200Response


delete_user_badge Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui

Réponse

Renvoie: UpdateUserBadge200Response


get_user_badge Internal Link


Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
id String Oui

Réponse

Renvoie : GetUserBadge200Response


get_user_badges Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
user_id String Non
badge_id String Non
displayed_on_comments bool Non
limit f64 Non
skip f64 Non

Réponse

Renvoie: GetUserBadges200Response


update_user_badge Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
id String Oui
update_user_badge_params models::UpdateUserBadgeParams Oui

Réponse

Renvoie : UpdateUserBadge200Response


get_user_notification_count Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
sso String Non

Réponse

Retourne : GetUserNotificationCount200Response


get_user_notifications Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
page_size i32 Non
after_id String Non
include_context bool Non
after_created_at i64 Non
unread_only bool Non
dm_only bool Non
no_dm bool Non
include_translations bool Non
sso String Non

Réponse

Renvoie: GetUserNotifications200Response


reset_user_notification_count Internal Link

Paramètres

Nom Type Requis Description
tenant_id String Oui
sso String Non

Réponse

Renvoie: ResetUserNotifications200Response

reset_user_notifications Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
after_id String Non
after_created_at i64 Non
unread_only bool Non
dm_only bool Non
no_dm bool Non
sso String Non

Réponse

Renvoie : ResetUserNotifications200Response


update_user_notification_comment_subscription_status Internal Link


Activer ou désactiver les notifications pour un commentaire spécifique.

Paramètres

Name Type Required Description
tenant_id String Oui
notification_id String Oui
opted_in_or_out String Oui
comment_id String Oui
sso String Non

Réponse

Renvoie: UpdateUserNotificationStatus200Response


update_user_notification_page_subscription_status Internal Link

Activer ou désactiver les notifications pour une page. Lorsque les utilisateurs sont abonnés à une page, des notifications sont créées pour les nouveaux commentaires racine, et aussi

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
url_id String Oui
url String Oui
page_title String Oui
subscribed_or_unsubscribed String Oui
sso String Non

Réponse

Renvoie : UpdateUserNotificationStatus200Response


update_user_notification_status Internal Link


Paramètres

Nom Type Requis Description
tenant_id String Oui
notification_id String Oui
new_status String Oui
sso String Non

Réponse

Retourne: UpdateUserNotificationStatus200Response


get_user_presence_statuses Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
url_id_ws String Oui
user_ids String Oui

Réponse

Renvoie : GetUserPresenceStatuses200Response


search_users Internal Link

Paramètres

Name Type Requis Description
tenant_id String Oui
url_id String Oui
username_starts_with String Oui
mention_group_ids Vec Non
sso String Non

Réponse

Renvoie: SearchUsers200Response

get_user Internal Link

Paramètres

Name Type Required Description
tenant_id String Oui
id String Oui

Réponse

Renvoie: GetUser200Response

Exemple

Exemple de get_user
Copy Copy
1
2async fn run_get_user() -> Result<(), Error> {
3 let maybe_id: Option<String> = Some("user-6412".to_owned());
4 let params: GetUserParams = GetUserParams {
5 tenant_id: "acme-corp-tenant".to_owned(),
6 id: maybe_id.unwrap(),
7 };
8 let user_response: GetUser200Response = get_user(&configuration, params).await?;
9 println!("{:#?}", user_response);
10 Ok(())
11}
12

create_vote Internal Link

Paramètres

Name Type Required Description
tenant_id String Oui
comment_id String Oui
direction String Oui
user_id String Non
anon_user_id String Non

Réponse

Renvoie: VoteComment200Response

Exemple

Exemple de create_vote
Copy Copy
1
2async fn run_vote() -> Result<VoteComment200Response, Error> {
3 let params: CreateVoteParams = CreateVoteParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "news/2026/01/12/local-election-12345".to_string(),
6 direction: "up".to_string(),
7 user_id: Some("user_9876".to_string()),
8 anon_user_id: None,
9 };
10 let response: VoteComment200Response = create_vote(&configuration, params).await?;
11 Ok(response)
12}
13

delete_vote Internal Link

Paramètres

Name Type Required Description
tenant_id String Oui
id String Oui
edit_key String Non

Réponse

Renvoie : DeleteCommentVote200Response

Exemple

Exemple de delete_vote
Copy Copy
1
2async fn run_delete_vote() -> Result<(), Error> {
3 let params: DeleteVoteParams = DeleteVoteParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article/67890/comment/12345".to_string(),
6 edit_key: Some("user-editkey-7f3b".to_string()),
7 };
8 let response: DeleteCommentVote200Response = delete_vote(&configuration, params).await?;
9 Ok(())
10}
11

get_votes Internal Link

Paramètres

Name Type Required Description
tenant_id String Oui
url_id String Oui

Réponse

Retourne : GetVotes200Response

Exemple

Exemple de get_votes
Copy Copy
1
2async fn fetch_votes_example() -> Result<(), Error> {
3 let params: GetVotesParams = GetVotesParams {
4 tenant_id: String::from("acme-corp-tenant"),
5 url_id: String::from("news/article/2026-01-12/housing-market"),
6 };
7 let votes: GetVotes200Response = get_votes(&configuration, params).await?;
8 let _ = votes;
9 Ok(())
10}
11

get_votes_for_user Internal Link

Paramètres

Nom Type Obligatoire Description
tenant_id String Oui
url_id String Oui
user_id String Non
anon_user_id String Non

Réponse

Renvoie : GetVotesForUser200Response

Exemple

Exemple de get_votes_for_user
Copy Copy
1
2async fn fetch_votes() -> Result<GetVotesForUser200Response, Error> {
3 let params = GetVotesForUserParams {
4 tenant_id: String::from("acme-corp-tenant"),
5 url_id: String::from("news/2026/01/12/breaking-tech"),
6 user_id: Some(String::from("user-78a3")),
7 anon_user_id: Some(String::from("anon-4f2b")),
8 };
9 let response: GetVotesForUser200Response = get_votes_for_user(&configuration, params).await?;
10 Ok(response)
11}
12


Besoin d'aide ?

Si vous rencontrez des problèmes ou avez des questions concernant le Rust SDK, veuillez :

Contribuer

Les contributions sont les bienvenues ! Veuillez visiter le dépôt GitHub pour les consignes de contribution.