FastComments.com

SDK Rust de FastComments


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.

Contenu de la bibliothèque Internal Link

Le SDK FastComments Rust se compose de plusieurs modules :

  • Client Module – Client API pour les API REST de FastComments

    • Définitions de type complètes pour tous les modèles d'API
    • Trois clients API couvrant toutes les méthodes FastComments :
      • default_api (DefaultApi) – méthodes authentifiées par clé d'API pour une utilisation côté serveur
      • public_api (PublicApi) – méthodes publiques, sans clé d'API, sécuritaires à appeler depuis les navigateurs et les applications mobiles
      • moderation_api (ModerationApi) – une suite étendue d'API de modération en direct et rapides. Chaque méthode de Modération accepte un paramètre sso et peut s'authentifier via SSO ou un cookie de session FastComments.com.
    • Prise en charge complète de async/await avec tokio
    • Voir client/README.md pour la documentation détaillée de l'API
  • SSO Module – Utilitaires de 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 de jetons basée sur HMAC‑SHA256
  • Core Types – Définitions de type partagées et utilitaires

    • Modèles de commentaires et structures de métadonnées
    • Configurations d'utilisateur et de locataire
    • Fonctions d'assistance pour les opérations courantes

Démarrage rapide 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ée la configuration de l'API
    let config = Configuration::new();

    // Récupère les commentaires pour 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ée 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ère 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),
    }
}

API de modération

Les méthodes de modération alimentent le tableau de bord du modérateur. Elles utilisent une Configuration avec clé API tout comme l'API authentifiée, et chaque méthode accepte un jeton sso optionnel afin que l'appel puisse être effectué au nom d'un modérateur authentifié via SSO.

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

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

    // Compte les commentaires en attente dans la file de modération
    let result = moderation_api::get_count(
        &config,
        moderation_api::GetCountParams {
            text_search: None,
            by_ip_from_comment: None,
            filter: None,
            search_filters: None,
            demo: None,
            sso: None, // passe un jeton SSO pour agir au nom d'un modérateur authentifié via SSO
        },
    )
    .await;

    match result {
        Ok(response) => println!("Comments to moderate: {}", response.count),
        Err(e) => eprintln!("Error: {:?}", e),
    }
}

Utilisation du 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ée les données utilisateur SSO sécurisées (côté serveur seulement !)
    let user_data = SecureSSOUserData::new(
        "user-123".to_string(),           // ID de l'utilisateur
        "user@example.com".to_string(),   // Courriel
        "John Doe".to_string(),            // Nom d'utilisateur
        "https://example.com/avatar.jpg".to_string(), // URL de l'avatar
    );

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

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

Problèmes courants Internal Link

401 Unauthorized Errors

If you're getting 401 errors when using the authenticated API:

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

SSO Token Issues

If SSO tokens aren't working:

  1. Utilisez le mode sécurisé en production : Utilisez toujours FastCommentsSSO::new_secure() avec votre clé API en 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

The SDK uses tokio for async operations. Make sure to:

  1. Add tokio to your dependencies:
[dependencies]
tokio = { version = "1", features = ["full"] }
  1. Use the tokio runtime:
#[tokio::main]
async fn main() {
    // Votre code asynchrone ici
}

Remarques Internal Link

IDs de diffusion

Vous verrez qu'il faut passer un broadcastId dans certains appels d'API. Quand vous recevrez des événements, vous obtiendrez ce même ID en retour, ce qui vous permet d'ignorer l'événement si vous prévoyez d'appliquer les changements de façon optimiste côté client (ce que vous voudrez 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 lors d'une session de navigateur.

aggregate Internal Link

Aggregates documents by grouping them (if groupBy is provided) and applying multiple operations.
Different operations (e.g. sum, countDistinct, avg, etc.) are supported.

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
aggregation_requestmodels::AggregationRequestOui
parent_tenant_idStringNon
include_statsboolNon

Réponse

Renvoie : AggregateResponse

Exemple

Exemple d'agrégation
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let config = configuration::Configuration::default();
4 let aggregation_request = models::AggregationRequest::default();
5 let params = AggregateParams {
6 tenant_id: "acme-corp-tenant".to_string(),
7 aggregation_request,
8 parent_tenant_id: Some("global-tenant".to_string()),
9 include_stats: Some(true),
10 };
11 let _response = aggregate(&config, params).await?;
12 Ok(())
13}
14

get_api_comments Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
pagef64No
countf64No
text_searchStringNo
by_ip_from_commentStringNo
filtersStringNo
search_filtersStringNo
sortsStringNo
demoboolNo
ssoStringNo

Réponse

Renvoie : ModerationApiGetCommentsResponse

Exemple

Exemple get_api_comments
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = GetApiCommentsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 page: Some(1.0),
6 count: Some(20.0),
7 text_search: Some("rust".to_string()),
8 by_ip_from_comment: None,
9 filters: Some("status:approved".to_string()),
10 search_filters: Some("author:john".to_string()),
11 sorts: Some("date:desc".to_string()),
12 demo: Some(false),
13 sso: None,
14 };
15 let _response = get_api_comments(&configuration, params).await?;
16 Ok(())
17}
18

get_api_export_status Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
batch_job_idStringNon
ssoStringNon

Réponse

Retourne : ModerationExportStatusResponse

Exemple

Exemple de get_api_export_status
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = GetApiExportStatusParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 batch_job_id: Some("batch-2023-09-01".to_string()),
6 sso: Some("sso-token-xyz".to_string()),
7 };
8 let _status = get_api_export_status(&configuration, params).await?;
9 Ok(())
10}
11

get_api_ids Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
text_searchStringNon
by_ip_from_commentStringNon
filtersStringNon
search_filtersStringNon
after_idStringNon
demoboolNon
ssoStringNon

Réponse

Renvoie : ModerationApiGetCommentIdsResponse

Exemple

Exemple get_api_ids
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetApiIdsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 text_search: Some("breaking news".to_string()),
6 by_ip_from_comment: None,
7 filters: Some("status:approved".to_string()),
8 search_filters: None,
9 after_id: None,
10 demo: Some(false),
11 sso: Some("sso-token".to_string()),
12 };
13 let _response = get_api_ids(&config, params).await?;
14 Ok(())
15}
16

post_api_export Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
text_searchStringNon
by_ip_from_commentStringNon
filtersStringNon
search_filtersStringNon
sortsStringNon
ssoStringNon

Réponse

Renvoie : ModerationExportResponse

Exemple

post_api_export Exemple
Copy Copy
1
2async fn export_moderation() -> Result<(), Error> {
3 let params = PostApiExportParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 text_search: Some("news/article".to_string()),
6 by_ip_from_comment: Some("203.0.113.42".to_string()),
7 filters: Some("status:pending".to_string()),
8 search_filters: Some("created_at>2023-01-01".to_string()),
9 sorts: Some("created_at_desc".to_string()),
10 sso: None,
11 };
12 let _response = post_api_export(&configuration, params).await?;
13 Ok(())
14}
15

get_audit_logs Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
limitf64No
skipf64No
ordermodels::SortDirNo
afterf64No
beforef64No

Réponse

Renvoie : GetAuditLogsResponse

Exemple

Exemple get_audit_logs
Copy Copy
1
2async fn fetch_audit_logs(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetAuditLogsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 limit: Some(100.0),
6 skip: Some(0.0),
7 order: Some(models::SortDir::Desc),
8 after: Some(1622505600.0),
9 before: None,
10 };
11 let _response: GetAuditLogsResponse = get_audit_logs(config, params).await?;
12 Ok(())
13}
14

block_from_comment_public Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
public_block_from_comment_paramsmodels::PublicBlockFromCommentParamsOui
ssoStringNon

Réponse

Renvoie : BlockSuccess

Exemple

Exemple block_from_comment_public
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = BlockFromCommentPublicParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "cmt-98765".to_string(),
6 public_block_from_comment_params: models::PublicBlockFromCommentParams::default(),
7 sso: Some("sso-token-xyz".to_string()),
8 };
9 let _result: BlockSuccess = block_from_comment_public(&configuration, params).await?;
10 Ok(())
11}
12

un_block_comment_public Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
public_block_from_comment_paramsmodels::PublicBlockFromCommentParamsOui
ssoStringNon

Réponse

Renvoie : UnblockSuccess

Exemple

un_block_comment_public Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = UnBlockCommentPublicParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "comment-12345".to_string(),
6 public_block_from_comment_params: models::PublicBlockFromCommentParams::default(),
7 sso: Some("user-sso-token".to_string()),
8 };
9 let _result: UnblockSuccess = un_block_comment_public(configuration, params).await?;
10 Ok(())
11}
12

checked_comments_for_blocked Internal Link


Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idsStringOui
ssoStringNon

Réponse

Renvoie : CheckBlockedCommentsResponse

Exemple

checked_comments_for_blocked Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = CheckedCommentsForBlockedParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_ids: "cmt-001,cmt-002".to_string(),
6 sso: Some("user@example.com".to_string()),
7 };
8 let _response: CheckBlockedCommentsResponse = checked_comments_for_blocked(&config, params).await?;
9 Ok(())
10}
11

block_user_from_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
block_from_comment_paramsmodels::BlockFromCommentParamsOui
user_idStringNon
anon_user_idStringNon

Réponse

Returns: BlockSuccess

Exemple

block_user_from_comment Exemple
Copy Copy
1
2async fn example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = BlockUserFromCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "comment-9876".to_string(),
6 block_from_comment_params: models::BlockFromCommentParams {
7 reason: "spam".to_string(),
8 },
9 user_id: Some("user-42".to_string()),
10 anon_user_id: None,
11 };
12 let _result: BlockSuccess = block_user_from_comment(configuration, params).await?;
13 Ok(())
14}
15

create_comment_public Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
url_idStringYes
broadcast_idStringYes
comment_datamodels::CommentDataYes
session_idStringNo
ssoStringNo

Réponse

Retourne: SaveCommentsResponseWithPresence

Exemple

Exemple create_comment_public
Copy Copy
1
2let params = CreateCommentPublicParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 url_id: "news/article-123".to_string(),
5 broadcast_id: "broadcast-2023-09-01".to_string(),
6 comment_data: models::CommentData {
7 text: "Great read!".to_string(),
8 },
9 session_id: Some("session-abc123".to_string()),
10 sso: Some("sso-token-xyz".to_string()),
11};
12let response = create_comment_public(&configuration, params).await?;
13

delete_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
context_user_idStringNon
is_liveboolNon

Réponse

Renvoie : DeleteCommentResult

Exemple

Exemple delete_comment
Copy Copy
1
2async fn main() -> Result<(), Error> {
3 let params = DeleteCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "comment-12345".to_string(),
6 context_user_id: Some("user-6789".to_string()),
7 is_live: Some(true),
8 };
9 let _result = delete_comment(&configuration, params).await?;
10 Ok(())
11}
12

delete_comment_public Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
comment_idStringYes
broadcast_idStringYes
edit_keyStringNo
ssoStringNo

Réponse

Renvoie : PublicApiDeleteCommentResponse

Exemple

Exemple delete_comment_public
Copy Copy
1
2async fn run_delete() -> Result<(), Error> {
3 let params = DeleteCommentPublicParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "cmt-12345".to_string(),
6 broadcast_id: "news/article-6789".to_string(),
7 edit_key: Some("edit-abc123".to_string()),
8 sso: Some("sso-token-xyz".to_string()),
9 };
10 let response = delete_comment_public(&configuration, params).await?;
11 let _deleted: PublicApiDeleteCommentResponse = response;
12 Ok(())
13}
14

delete_comment_vote Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
vote_idStringOui
url_idStringOui
broadcast_idStringOui
edit_keyStringNon
ssoStringNon

Réponse

Renvoie : VoteDeleteResponse

Exemple

Exemple delete_comment_vote
Copy Copy
1
2#[tokio::main]
3async fn main() -> Result<(), Error> {
4 let params = DeleteCommentVoteParams {
5 tenant_id: "acme-corp-tenant".to_string(),
6 comment_id: "comment-12345".to_string(),
7 vote_id: "vote-67890".to_string(),
8 url_id: "news/article".to_string(),
9 broadcast_id: "broadcast-abc".to_string(),
10 edit_key: Some("edit-key-xyz".to_string()),
11 sso: Some("sso-token-123".to_string()),
12 };
13 let _response: VoteDeleteResponse = delete_comment_vote(&configuration, params).await?;
14 Ok(())
15}
16

flag_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
user_idStringNon
anon_user_idStringNon

Réponse

Renvoie : FlagCommentResponse

Exemple

flag_comment Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = FlagCommentParams {
4 tenant_id: "acme-corp".to_string(),
5 id: "comment-9876".to_string(),
6 user_id: Some("user-42".to_string()),
7 anon_user_id: None,
8 };
9 let _response = flag_comment(&configuration, params).await?;
10 Ok(())
11}
12

get_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui

Réponse

Retourne : ApiGetCommentResponse

Exemple

Exemple get_comment
Copy Copy
1
2async fn fetch_comment() -> Result<(), Error> {
3 let params = GetCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "comment-12345".to_string(),
6 include_deleted: Some(false),
7 };
8
9 let _response: ApiGetCommentResponse = get_comment(&configuration, params).await?;
10 Ok(())
11}
12

get_comment_text Internal Link

Paramètres

NameTypeRequiredDescription
tenant_idStringYes
comment_idStringYes
edit_keyStringNo
ssoStringNo

Réponse

Retourne : PublicApiGetCommentTextResponse

Exemple

Exemple get_comment_text
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetCommentTextParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "comment-12345".to_string(),
6 edit_key: Some("edit-key-abc".to_string()),
7 sso: Some("sso-token-xyz".to_string()),
8 };
9 let _response = get_comment_text(&configuration, params).await?;
10 Ok(())
11}
12

get_comment_vote_user_names Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
comment_idStringYes
diri32Yes
ssoStringNo

Réponse

Renvoie : GetCommentVoteUserNamesSuccessResponse

Exemple

Exemple get_comment_vote_user_names
Copy Copy
1
2async fn demo(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetCommentVoteUserNamesParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "news/article-123".to_string(),
6 dir: 1,
7 sso: Some("user-sso-id".to_string()),
8 };
9 let _response: GetCommentVoteUserNamesSuccessResponse =
10 get_comment_vote_user_names(config, params).await?;
11 Ok(())
12}
13

get_comments Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
pagei32Non
limiti32Non
skipi32Non
as_treeboolNon
skip_childreni32Non
limit_childreni32Non
max_tree_depthi32Non
url_idStringNon
user_idStringNon
anon_user_idStringNon
context_user_idStringNon
hash_tagStringNon
parent_idStringNon
directionmodels::SortDirectionsNon
from_datei64Non
to_datei64Non

Réponse

Renvoie : ApiGetCommentsResponse

Exemple

Exemple get_comments
Copy Copy
1
2async fn fetch_comments() -> Result<(), Error> {
3 let params = GetCommentsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 page: Some(1),
6 limit: Some(20),
7 skip: Some(0),
8 as_tree: Some(true),
9 skip_children: Some(5),
10 limit_children: Some(10),
11 max_tree_depth: Some(3),
12 url_id: Some("news/article".to_string()),
13 user_id: Some("user-123".to_string()),
14 anon_user_id: Some("anon-456".to_string()),
15 context_user_id: Some("ctx-789".to_string()),
16 hash_tag: Some("rust".to_string()),
17 parent_id: Some("parent-001".to_string()),
18 direction: Some(models::SortDirections::Desc),
19 from_date: Some(1_640_995_200),
20 to_date: Some(1_641_081_600),
21 };
22 let _response = get_comments(&config, params).await?;
23 Ok(())
24}
25

get_comments_public Internal Link

req tenantId urlId

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
url_idStringOui
pagei32Non
directionmodels::SortDirectionsNon
ssoStringNon
skipi32Non
skip_childreni32Non
limiti32Non
limit_childreni32Non
count_childrenboolNon
fetch_page_for_comment_idStringNon
include_configboolNon
count_allboolNon
includei10nboolNon
localeStringNon
modulesStringNon
is_crawlerboolNon
include_notification_countboolNon
as_treeboolNon
max_tree_depthi32Non
use_full_translation_idsboolNon
parent_idStringNon
search_textStringNon
hash_tagsVecNon
user_idStringNon
custom_config_strStringNon
after_comment_idStringNon
before_comment_idStringNon

Réponse

Retourne : GetCommentsResponseWithPresencePublicComment

Exemple

Exemple get_comments_public
Copy Copy
1
2async fn fetch_comments() -> Result<(), Error> {
3 let params = GetCommentsPublicParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/article".to_string(),
6 page: Some(1),
7 direction: Some(models::SortDirections::Desc),
8 limit: Some(20),
9 includei10n: Some(true),
10 locale: Some("en-US".to_string()),
11 as_tree: Some(true),
12 max_tree_depth: Some(3),
13 hash_tags: Some(vec!["rust".to_string(), "programming".to_string()]),
14 ..Default::default()
15 };
16 let _response = get_comments_public(&configuration, params).await?;
17 Ok(())
18}
19

lock_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
comment_idStringYes
broadcast_idStringYes
ssoStringNo

Réponse

Renvoie : ApiEmptyResponse

Exemple

lock_comment Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = LockCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "cmt-9876".to_string(),
6 broadcast_id: "news/article".to_string(),
7 sso: Some("user-sso-token".to_string()),
8 };
9 let _resp = lock_comment(&configuration, params).await?;
10 Ok(())
11}
12

pin_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
broadcast_idStringOui
ssoStringNon

Réponse

Retourne : ChangeCommentPinStatusResponse

Exemple

pin_comment Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = PinCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "comment-12345".to_string(),
6 broadcast_id: "news/article".to_string(),
7 sso: Some("sso-token-xyz".to_string()),
8 };
9 let _response = pin_comment(&configuration, params).await?;
10 Ok(())
11}
12

save_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
create_comment_paramsmodels::CreateCommentParamsYes
is_liveboolNo
do_spam_checkboolNo
send_emailsboolNo
populate_notificationsboolNo

Réponse

Renvoie : ApiSaveCommentResponse

Exemple

Exemple de save_comment
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = SaveCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 create_comment_params: models::CreateCommentParams {
6 body: "Great insights on the latest tech trends.".to_string(),
7 user_id: "user-789".to_string(),
8 ..Default::default()
9 },
10 is_live: Some(true),
11 do_spam_check: Some(true),
12 send_emails: Some(false),
13 populate_notifications: Some(true),
14 };
15 let _response = save_comment(&configuration, params).await?;
16 Ok(())
17}
18

save_comments_bulk Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
create_comment_paramsVecmodels::CreateCommentParamsYes
is_liveboolNo
do_spam_checkboolNo
send_emailsboolNo
populate_notificationsboolNo

Réponse

Returns: Vec<models::SaveCommentsBulkResponse>

Exemple

save_comments_bulk Exemple
Copy Copy
1
2#[tokio::main]
3async fn main() -> Result<(), Box<dyn std::error::Error>> {
4 let params: SaveCommentsBulkParams = SaveCommentsBulkParams {
5 tenant_id: "acme-corp-tenant".to_string(),
6 create_comment_params: vec![
7 models::CreateCommentParams::default(),
8 models::CreateCommentParams::default(),
9 ],
10 is_live: Some(true),
11 do_spam_check: Some(false),
12 send_emails: Some(true),
13 populate_notifications: Some(false),
14 };
15 let _responses: Vec<models::SaveCommentsBulkResponse> = save_comments_bulk(&configuration, params).await?;
16 Ok(())
17}
18

set_comment_text Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
comment_idStringYes
broadcast_idStringYes
comment_text_update_requestmodels::CommentTextUpdateRequestYes
edit_keyStringNo
ssoStringNo

Réponse

Renvoie : PublicApiSetCommentTextResponse

Exemple

Exemple set_comment_text
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let comment_text_update_request = models::CommentTextUpdateRequest {
4 text: "Edited comment text after moderation".to_string(),
5 ..Default::default()
6 };
7 let params = SetCommentTextParams {
8 tenant_id: "acme-corp-tenant".to_string(),
9 comment_id: "cmt-98765".to_string(),
10 broadcast_id: "news/article".to_string(),
11 comment_text_update_request,
12 edit_key: Some("edit-key-2024".to_string()),
13 sso: Some("sso-token-789".to_string()),
14 };
15 let _response = set_comment_text(&configuration, params).await?;
16 Ok(())
17}
18

un_block_user_from_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
un_block_from_comment_paramsmodels::UnBlockFromCommentParamsOui
user_idStringNon
anon_user_idStringNon

Réponse

Retourne : UnblockSuccess

Exemple

un_block_user_from_comment Exemple
Copy Copy
1
2async fn example(config: &configuration::Configuration) -> Result<UnblockSuccess, Error> {
3 let params = UnBlockUserFromCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "comment-12345".to_string(),
6 un_block_from_comment_params: models::UnBlockFromCommentParams::default(),
7 user_id: Some("user-67890".to_string()),
8 anon_user_id: Some("anon-abcde".to_string()),
9 };
10 let result = un_block_user_from_comment(config, params).await?;
11 Ok(result)
12}
13

un_flag_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
idStringYes
user_idStringNo
anon_user_idStringNo

Réponse

Retourne : FlagCommentResponse

Exemple

un_flag_comment Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = UnFlagCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "comment-12345".to_string(),
6 user_id: Some("user-67890".to_string()),
7 anon_user_id: None,
8 };
9 let _response = un_flag_comment(&configuration, params).await?;
10 Ok(())
11}
12

un_lock_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
broadcast_idStringOui
ssoStringNon

Réponse

Returns: ApiEmptyResponse

Exemple

un_lock_comment Exemple
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = UnLockCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "cmt-456".to_string(),
6 broadcast_id: "news/article-123".to_string(),
7 sso: Some("user-sso-token".to_string()),
8 };
9 let _response = un_lock_comment(&configuration, params).await?;
10 Ok(())
11}
12

un_pin_comment Internal Link


Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
broadcast_idStringOui
ssoStringNon

Réponse

Renvoie : ChangeCommentPinStatusResponse

Exemple

un_pin_comment Exemple
Copy Copy
1
2async fn unpin_example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = UnPinCommentParams {
4 tenant_id: "acme-corp".to_string(),
5 comment_id: "comment-12345".to_string(),
6 broadcast_id: "news/article-6789".to_string(),
7 sso: Some("sso-token-xyz".to_string()),
8 };
9 let _response: ChangeCommentPinStatusResponse = un_pin_comment(configuration, params).await?;
10 Ok(())
11}
12

update_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
idStringYes
updatable_comment_paramsmodels::UpdatableCommentParamsYes
context_user_idStringNo
do_spam_checkboolNo
is_liveboolNo

Réponse

Renvoie : ApiEmptyResponse

Exemple

Exemple update_comment
Copy Copy
1
2async fn run_update() -> Result<(), Error> {
3 let updatable = models::UpdatableCommentParams {
4 content: "Edited comment about the latest news article".to_string(),
5 ..Default::default()
6 };
7 let params = UpdateCommentParams {
8 tenant_id: "acme-corp-tenant".to_string(),
9 id: "comment-789".to_string(),
10 updatable_comment_params: updatable,
11 context_user_id: Some("reader-42".to_string()),
12 do_spam_check: Some(true),
13 is_live: Some(true),
14 };
15 let _ = update_comment(&configuration, params).await?;
16 Ok(())
17}
18

vote_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
url_idStringOui
broadcast_idStringOui
vote_body_paramsmodels::VoteBodyParamsOui
session_idStringNon
ssoStringNon

Réponse

Renvoie : VoteResponse

Exemple

Exemple vote_comment
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let config = configuration::Configuration::default();
4
5 let vote_body = models::VoteBodyParams {
6 vote_type: "upvote".to_string(),
7 weight: 1,
8 };
9
10 let params = VoteCommentParams {
11 tenant_id: "acme-corp-tenant".to_string(),
12 comment_id: "comment-12345".to_string(),
13 url_id: "news/article".to_string(),
14 broadcast_id: "broadcast-67890".to_string(),
15 vote_body_params: vote_body,
16 session_id: Some("session-abcde".to_string()),
17 sso: None,
18 };
19
20 let _response = vote_comment(&config, params).await?;
21 Ok(())
22}
23

get_comments_for_user Internal Link

Paramètres

NomTypeObligatoireDescription
user_idStringNon
directionmodels::SortDirectionsNon
replies_to_user_idStringNon
pagef64Non
includei10nboolNon
localeStringNon
is_crawlerboolNon

Réponse

Retourne : GetCommentsForUserResponse

Exemple

Exemple get_comments_for_user
Copy Copy
1
2async fn fetch_user_comments() -> Result<(), Error> {
3 let params = GetCommentsForUserParams {
4 user_id: Some("user-42".to_string()),
5 direction: Some(models::SortDirections::Desc),
6 replies_to_user_id: Some("reply-to-42".to_string()),
7 page: Some(1.0),
8 includei10n: Some(true),
9 locale: Some("en-US".to_string()),
10 is_crawler: Some(false),
11 };
12 let _response = get_comments_for_user(&configuration, params).await?;
13 Ok(())
14}
15

add_domain_config Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
add_domain_config_paramsmodels::AddDomainConfigParamsYes

Réponse

Renvoie : AddDomainConfigResponse

Exemple

add_domain_config Exemple
Copy Copy
1
2let params = AddDomainConfigParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 add_domain_config_params: models::AddDomainConfigParams {
5 domain: "news.example.com".to_string(),
6 config_type: "article".to_string(),
7 is_active: true,
8 description: Some("News article domain".to_string()),
9 },
10};
11
12let response = add_domain_config(&configuration, params).await?;
13

delete_domain_config Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
domainStringOui

Réponse

Renvoie : DeleteDomainConfigResponse

Exemple

Exemple delete_domain_config
Copy Copy
1
2async fn run_example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = DeleteDomainConfigParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 domain: "news/article".to_string(),
6 };
7 let _response: DeleteDomainConfigResponse = delete_domain_config(configuration, params).await?;
8 Ok(())
9}
10

get_domain_config Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
domainStringOui

Réponse

Renvoie : GetDomainConfigResponse

Exemple

Exemple get_domain_config
Copy Copy
1
2#[tokio::main]
3async fn main() -> Result<(), Error> {
4 let params = GetDomainConfigParams {
5 tenant_id: "acme-corp-tenant".to_string(),
6 domain: "news/article".to_string(),
7 locale: Some("en-US".to_string()),
8 };
9 let _response = get_domain_config(&config, params).await?;
10 Ok(())
11}
12

get_domain_configs Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui

Réponse

Retourne : GetDomainConfigsResponse

Exemple

Exemple get_domain_configs
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetDomainConfigsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 };
6 let _response = get_domain_configs(&configuration, params).await?;
7 Ok(())
8}
9

patch_domain_config Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
domain_to_updateStringOui
patch_domain_config_paramsmodels::PatchDomainConfigParamsOui

Réponse

Renvoie : PatchDomainConfigResponse

Exemple

Exemple patch_domain_config
Copy Copy
1
2async fn run_example() -> Result<(), Error> {
3 let config = configuration::Configuration::default();
4 let params = PatchDomainConfigParams {
5 tenant_id: "acme-corp-tenant".to_string(),
6 domain_to_update: "news/article".to_string(),
7 patch_domain_config_params: models::PatchDomainConfigParams {
8 enable_comments: Some(true),
9 theme: Some("dark".to_string()),
10 },
11 };
12 let _response = patch_domain_config(&config, params).await?;
13 Ok(())
14}
15

put_domain_config Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
domain_to_updateStringOui
update_domain_config_paramsmodels::UpdateDomainConfigParamsOui

Réponse

Renvoie : PutDomainConfigResponse

Exemple

put_domain_config Exemple
Copy Copy
1
2async fn update_domain(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let update_params = models::UpdateDomainConfigParams {
4 enable_comments: Some(true),
5 moderation_level: Some("strict".to_string()),
6 max_comment_length: Some(500),
7 ..Default::default()
8 };
9 let params = PutDomainConfigParams {
10 tenant_id: "acme-corp-tenant".to_string(),
11 domain_to_update: "news.example.com".to_string(),
12 update_domain_config_params: update_params,
13 };
14 let _resp: PutDomainConfigResponse = put_domain_config(configuration, params).await?;
15 Ok(())
16}
17

create_email_template Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
create_email_template_bodymodels::CreateEmailTemplateBodyOui

Réponse

Renvoie : CreateEmailTemplateResponse

Exemple

Exemple de create_email_template
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = CreateEmailTemplateParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 create_email_template_body: models::CreateEmailTemplateBody {
6 name: "welcome".to_string(),
7 subject: "Welcome to Acme".to_string(),
8 html_content: "<h1>Welcome</h1>".to_string(),
9 plain_text_content: Some("Welcome to Acme".to_string()),
10 },
11 };
12 let _response = create_email_template(&configuration, params).await?;
13 Ok(())
14}
15

delete_email_template Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui

Réponse

Renvoie: ApiEmptyResponse

Exemple

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

delete_email_template_render_error Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
error_idStringOui

Réponse

Renvoie : ApiEmptyResponse

Exemple

Exemple de delete_email_template_render_error
Copy Copy
1
2async fn example(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = DeleteEmailTemplateRenderErrorParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "welcome-email".to_string(),
6 error_id: "render-failure-123".to_string(),
7 };
8 let _ = delete_email_template_render_error(config, params).await?;
9 Ok(())
10}
11

get_email_template Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui

Réponse

Retourne : GetEmailTemplateResponse

Exemple

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

get_email_template_definitions Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui

Réponse

Retourne : GetEmailTemplateDefinitionsResponse

Exemple

Exemple get_email_template_definitions
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = GetEmailTemplateDefinitionsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 };
6 let _response = get_email_template_definitions(&configuration, params).await?;
7 Ok(())
8}
9

get_email_template_render_errors Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
skipf64Non

Réponse

Renvoie : GetEmailTemplateRenderErrorsResponse

Exemple

get_email_template_render_errors Exemple
Copy Copy
1
2async fn fetch_template_errors(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetEmailTemplateRenderErrorsParams {
4 tenant_id: "acme-corp".to_string(),
5 id: "newsletter-welcome".to_string(),
6 skip: Some(5.0),
7 };
8 let _response: GetEmailTemplateRenderErrorsResponse = get_email_template_render_errors(config, params).await?;
9 Ok(())
10}
11

get_email_templates Internal Link

Paramètres

NameTypeRequiredDescription
tenant_idStringYes
skipf64No

Réponse

Renvoie : GetEmailTemplatesResponse

Exemple

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

render_email_template Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
render_email_template_bodymodels::RenderEmailTemplateBodyOui
localeStringNon

Réponse

Renvoie : RenderEmailTemplateResponse

Exemple

Exemple de render_email_template
Copy Copy
1
2let mut vars = std::collections::HashMap::new();
3vars.insert("article_title".to_string(), "Breaking News".to_string());
4vars.insert("author".to_string(), "Jane Smith".to_string());
5
6let body = models::RenderEmailTemplateBody {
7 template_id: "newsletter".to_string(),
8 variables: vars,
9};
10
11let params = RenderEmailTemplateParams {
12 tenant_id: "acme-corp-tenant".to_string(),
13 render_email_template_body: body,
14 locale: Some("en-US".to_string()),
15};
16
17let response = render_email_template(&configuration, params).await?;
18

update_email_template Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
idStringYes
update_email_template_bodymodels::UpdateEmailTemplateBodyYes

Réponse

Renvoie : ApiEmptyResponse

Exemple

Exemple de update_email_template
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = UpdateEmailTemplateParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "welcome-email".to_string(),
6 update_email_template_body: models::UpdateEmailTemplateBody {
7 subject: Some("Welcome to Acme Corp".to_string()),
8 body_html: Some("<p>Hello, \{{user.name}}!</p>".to_string()),
9 body_text: None,
10 },
11 };
12 let _ = update_email_template(&config, params).await?;
13 Ok(())
14}
15

get_event_log Internal Link

req tenantId urlId userIdWS

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
url_idStringOui
user_id_wsStringOui
start_timei64Oui
end_timei64Non

Réponse

Retourne : GetEventLogResponse

Exemple

get_event_log Exemple
Copy Copy
1
2async fn fetch_event_log(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetEventLogParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/article".to_string(),
6 user_id_ws: "user-12345".to_string(),
7 start_time: 1_640_995_200,
8 end_time: Some(1_640_995_300),
9 };
10 let _response: GetEventLogResponse = get_event_log(configuration, params).await?;
11 Ok(())
12}
13

get_global_event_log Internal Link

req tenantId urlId userIdWS

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
url_idStringYes
user_id_wsStringYes
start_timei64Yes
end_timei64No

Réponse

Renvoie : GetEventLogResponse

Exemple

get_global_event_log Exemple
Copy Copy
1
2async fn run(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetGlobalEventLogParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/article".to_string(),
6 user_id_ws: "user-12345".to_string(),
7 start_time: 1_680_000_000,
8 end_time: Some(1_680_864_000),
9 };
10 let _response = get_global_event_log(configuration, params).await?;
11 Ok(())
12}
13

create_feed_post Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
create_feed_post_paramsmodels::CreateFeedPostParamsOui
broadcast_idStringNon
is_liveboolNon
do_spam_checkboolNon
skip_dup_checkboolNon

Réponse

Retourne : CreateFeedPostsResponse

Exemple

Exemple create_feed_post
Copy Copy
1
2async fn run_example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = CreateFeedPostParams {
4 tenant_id: "acme-corp-tenant".into(),
5 create_feed_post_params: models::CreateFeedPostParams {
6 text: "Launching new features".into(),
7 media: vec![],
8 },
9 broadcast_id: Some("broadcast-2023-09".into()),
10 is_live: Some(true),
11 do_spam_check: Some(true),
12 skip_dup_check: Some(false),
13 };
14 let _response = create_feed_post(configuration, params).await?;
15 Ok(())
16}
17

create_feed_post_public Internal Link

Paramètres

NomTypeRequisDescription
tenant_idStringOui
create_feed_post_paramsmodels::CreateFeedPostParamsOui
broadcast_idStringNon
ssoStringNon

Réponse

Renvoie : CreateFeedPostResponse

Exemple

Exemple create_feed_post_public
Copy Copy
1
2async fn run_example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = CreateFeedPostPublicParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 create_feed_post_params: models::CreateFeedPostParams {
6 title: "Breaking News".to_string(),
7 body: "Details about the news...".to_string(),
8 ..Default::default()
9 },
10 broadcast_id: Some("news/article".to_string()),
11 sso: Some("sso-token-abc".to_string()),
12 };
13 let _response = create_feed_post_public(configuration, params).await?;
14 Ok(())
15}
16

delete_feed_post_public Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
post_idStringOui
broadcast_idStringNon
ssoStringNon

Réponse

Retourne : DeleteFeedPostPublicResponse

Exemple

Exemple delete_feed_post_public
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = DeleteFeedPostPublicParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 post_id: "news/article-123".to_string(),
6 broadcast_id: Some("broadcast-456".to_string()),
7 sso: Some("sso-token-789".to_string()),
8 };
9 let _response: DeleteFeedPostPublicResponse = delete_feed_post_public(&configuration, params).await?;
10 Ok(())
11}
12

get_feed_posts Internal Link

req tenantId afterId

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
after_idStringNon
limiti32Non
tagsVecNon

Réponse

Renvoie : GetFeedPostsResponse

Exemple

Exemple get_feed_posts
Copy Copy
1
2async fn fetch_feed(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetFeedPostsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 after_id: Some("post-12345".to_string()),
6 limit: Some(20),
7 tags: Some(vec!["news".to_string(), "article".to_string()]),
8 };
9 let _response = get_feed_posts(config, params).await?;
10 Ok(())
11}
12

get_feed_posts_public Internal Link

req tenantId afterId

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
after_idStringNo
limiti32No
tagsVecNo
ssoStringNo
is_crawlerboolNo
include_user_infoboolNo

Réponse

Retourne : PublicFeedPostsResponse

Exemple

get_feed_posts_public Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetFeedPostsPublicParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 after_id: Some("post123".to_string()),
6 limit: Some(20),
7 tags: Some(vec!["news".to_string(), "article".to_string()]),
8 sso: Some("sso-token-xyz".to_string()),
9 is_crawler: Some(false),
10 include_user_info: Some(true),
11 };
12 let _response = get_feed_posts_public(&configuration, params).await?;
13 Ok(())
14}
15

get_feed_posts_stats Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
post_idsVecYes
ssoStringNo

Réponse

Retourne : FeedPostsStatsResponse

Exemple

get_feed_posts_stats Exemple
Copy Copy
1
2async fn fetch_feed_stats() -> Result<(), Error> {
3 let params = GetFeedPostsStatsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 post_ids: vec![
6 "news/article/123".to_string(),
7 "blog/post/456".to_string(),
8 ],
9 sso: Some("sso-token-xyz".to_string()),
10 };
11 let _response = get_feed_posts_stats(&configuration, params).await?;
12 Ok(())
13}
14

get_user_reacts_public Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
post_idsVecNo
ssoStringNo

Réponse

Retourne: UserReactsResponse

Exemple

get_user_reacts_public Exemple
Copy Copy
1
2async fn fetch_user_reacts() -> Result<(), Error> {
3 let params = GetUserReactsPublicParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 post_ids: Some(vec![
6 "news/article-123".to_string(),
7 "blog/post-456".to_string(),
8 ]),
9 sso: Some("sso-token-xyz".to_string()),
10 };
11 let _response = get_user_reacts_public(&configuration, params).await?;
12 Ok(())
13}
14

react_feed_post_public Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
post_idStringOui
react_body_paramsmodels::ReactBodyParamsOui
is_undoboolNon
broadcast_idStringNon
ssoStringNon

Réponse

Retourne : ReactFeedPostResponse

Exemple

Exemple react_feed_post_public
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let config = configuration::Configuration::default();
4 let react_body = models::ReactBodyParams {
5 reaction: "like".to_string(),
6 };
7 let params = ReactFeedPostPublicParams {
8 tenant_id: "acme-corp-tenant".to_string(),
9 post_id: "news/article/12345".to_string(),
10 react_body_params: react_body,
11 is_undo: Some(false),
12 broadcast_id: Some("broadcast-xyz".to_string()),
13 sso: Some("sso-token-abc".to_string()),
14 };
15 let _response: ReactFeedPostResponse = react_feed_post_public(&config, params).await?;
16 Ok(())
17}
18

update_feed_post Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
feed_postmodels::FeedPostOui

Réponse

Renvoie : ApiEmptyResponse

Exemple

Exemple de update_feed_post
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let feed_post = models::FeedPost {
4 title: "Acme Corp Quarterly Update".to_string(),
5 content: Some("Q2 results exceeded expectations with a 15% revenue growth.".to_string()),
6 media: Some(vec![
7 models::FeedPostMediaItem {
8 asset: models::FeedPostMediaItemAsset {
9 url: "https://cdn.acme.com/media/q2-report.png".to_string(),
10 mime_type: Some("image/png".to_string()),
11 ..Default::default()
12 },
13 ..Default::default()
14 },
15 ]),
16 link: Some(models::FeedPostLink {
17 url: "https://www.acme.com/reports/q2".to_string(),
18 title: Some("Full Report".to_string()),
19 ..Default::default()
20 }),
21 ..Default::default()
22 };
23
24 let params = UpdateFeedPostParams {
25 tenant_id: "acme-corp-tenant".to_string(),
26 id: "news/q2-update".to_string(),
27 feed_post,
28 };
29
30 update_feed_post(&configuration, params).await?;
31 Ok(())
32}
33

update_feed_post_public Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
post_idStringOui
update_feed_post_paramsmodels::UpdateFeedPostParamsOui
broadcast_idStringNon
ssoStringNon

Réponse

Renvoie : CreateFeedPostResponse

Exemple

Exemple update_feed_post_public
Copy Copy
1
2let params = UpdateFeedPostPublicParams {
3 tenant_id: "acme-corp-tenant".into(),
4 post_id: "news/article-123".into(),
5 update_feed_post_params: models::UpdateFeedPostParams {
6 title: Some("Updated Headline".into()),
7 content: Some("Revised content of the article with latest information.".into()),
8 ..Default::default()
9 },
10 broadcast_id: Some("broadcast-001".into()),
11 sso: Some("sso-token-abc123".into()),
12};
13
14let response: CreateFeedPostResponse = update_feed_post_public(&configuration, params).await?;
15

flag_comment_public Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
comment_idStringYes
is_flaggedboolYes
ssoStringNo

Réponse

Retourne : ApiEmptyResponse

Exemple

flag_comment_public Exemple
Copy Copy
1
2async fn run(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = FlagCommentPublicParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "comment-12345".to_string(),
6 is_flagged: true,
7 sso: Some("user-sso-token".to_string()),
8 };
9 flag_comment_public(configuration, params).await?;
10 Ok(())
11}
12

get_gif_large Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
large_internal_url_sanitizedStringOui

Réponse

Renvoie : GifGetLargeResponse

Exemple

Exemple get_gif_large
Copy Copy
1
2let params: GetGifLargeParams = GetGifLargeParams {
3 tenant_id: "acme-corp-tenant".into(),
4 large_internal_url_sanitized: "news/article/gif123".into(),
5};
6
7let response: GifGetLargeResponse = get_gif_large(&configuration, params).await?;
8

get_gifs_search Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
searchStringOui
localeStringNon
ratingStringNon
pagef64Non

Réponse

Retourne : GetGifsSearchResponse

Exemple

Exemple get_gifs_search
Copy Copy
1
2async fn fetch_gifs(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetGifsSearchParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 search: "funny cats".to_string(),
6 locale: Some("en-US".to_string()),
7 rating: Some("pg".to_string()),
8 page: Some(1.0),
9 };
10 let _response = get_gifs_search(config, params).await?;
11 Ok(())
12}
13

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
localeStringNon
ratingStringNon
pagef64Non

Réponse

Renvoie : GetGifsTrendingResponse

Exemple

Exemple get_gifs_trending
Copy Copy
1
2async fn fetch_trending_gifs(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetGifsTrendingParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 locale: Some("en-US".to_string()),
6 rating: Some("pg".to_string()),
7 page: Some(1.0),
8 };
9 let _response = get_gifs_trending(configuration, params).await?;
10 Ok(())
11}
12

add_hash_tag Internal Link


Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
create_hash_tag_bodymodels::CreateHashTagBodyNon

Réponse

Retourne : CreateHashTagResponse

Exemple

add_hash_tag Exemple
Copy Copy
1
2async fn example(cfg: &configuration::Configuration) -> Result<(), Error> {
3 let params = AddHashTagParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 create_hash_tag_body: Some(models::CreateHashTagBody {
6 tag: "news/article".to_string(),
7 }),
8 };
9 let _response: CreateHashTagResponse = add_hash_tag(cfg, params).await?;
10 Ok(())
11}
12

add_hash_tags_bulk Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
bulk_create_hash_tags_bodymodels::BulkCreateHashTagsBodyNon

Réponse

Renvoie : BulkCreateHashTagsResponse

Exemple

Exemple add_hash_tags_bulk
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = AddHashTagsBulkParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 bulk_create_hash_tags_body: Some(models::BulkCreateHashTagsBody {
6 tags: vec![
7 models::BulkCreateHashTagsBodyTagsInner {
8 tag: "news/article".to_string(),
9 },
10 ],
11 }),
12 };
13 let _response: BulkCreateHashTagsResponse = add_hash_tags_bulk(&configuration, params).await?;
14 Ok(())
15}
16

delete_hash_tag Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
tagStringOui
delete_hash_tag_request_bodymodels::DeleteHashTagRequestBodyNon

Réponse

Renvoie : ApiEmptyResponse

Exemple

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

get_hash_tags Internal Link


Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
pagef64Non

Réponse

Retourne : GetHashTagsResponse

Exemple

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

patch_hash_tag Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
tagStringOui
update_hash_tag_bodymodels::UpdateHashTagBodyNon

Réponse

Retourne : UpdateHashTagResponse

Exemple

Exemple patch_hash_tag
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = PatchHashTagParams {
4 tenant_id: "acme-corp-tenant".into(),
5 tag: "news/article".into(),
6 update_hash_tag_body: Some(models::UpdateHashTagBody::default()),
7 };
8 let _response = patch_hash_tag(&configuration, params).await?;
9 Ok(())
10}
11

delete_moderation_vote Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
vote_idStringOui
broadcast_idStringNon
ssoStringNon

Réponse

Returns: VoteDeleteResponse

Exemple

Exemple delete_moderation_vote
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = DeleteModerationVoteParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "news/article-42".to_string(),
6 vote_id: "vote-12345".to_string(),
7 broadcast_id: Some("broadcast-987".to_string()),
8 sso: None,
9 };
10 let _response: VoteDeleteResponse = delete_moderation_vote(&configuration, params).await?;
11 Ok(())
12}
13

get_ban_users_from_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
ssoStringNon

Réponse

Renvoie : GetBannedUsersFromCommentResponse

Exemple

Exemple get_ban_users_from_comment
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetBanUsersFromCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "news/article/12345".to_string(),
6 sso: Some("sso-unique-id".to_string()),
7 };
8 let _response = get_ban_users_from_comment(&configuration, params).await?;
9 Ok(())
10}
11

get_comment_ban_status Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
ssoStringNon

Réponse

Renvoie : GetCommentBanStatusResponse

Exemple

Exemple de get_comment_ban_status
Copy Copy
1
2async fn example(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetCommentBanStatusParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "comment-12345".to_string(),
6 sso: Some("user@example.com".to_string()),
7 };
8 let _response: GetCommentBanStatusResponse = get_comment_ban_status(config, params).await?;
9 Ok(())
10}
11

get_comment_children Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
ssoStringNon

Réponse

Renvoie : ModerationApiChildCommentsResponse

Exemple

Exemple get_comment_children
Copy Copy
1
2async fn fetch_children(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetCommentChildrenParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "news/article/comment-9876".to_string(),
6 sso: Some("user-42".to_string()),
7 };
8 let _response: ModerationApiChildCommentsResponse = get_comment_children(config, params).await?;
9 Ok(())
10}
11

get_count Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
text_searchStringNo
by_ip_from_commentStringNo
filterStringNo
search_filtersStringNo
demoboolNo
ssoStringNo

Réponse

Renvoie : ModerationApiCountCommentsResponse

Exemple

Exemple get_count
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetCountParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 text_search: Some("breaking news".to_string()),
6 by_ip_from_comment: Some("192.168.1.1".to_string()),
7 filter: Some("status:approved".to_string()),
8 search_filters: Some("author:john".to_string()),
9 demo: Some(false),
10 sso: Some("sso-token-123".to_string()),
11 };
12 let _response = get_count(&configuration, params).await?;
13 Ok(())
14}
15

get_counts Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
ssoStringNon

Réponse

Renvoie : GetBannedUsersCountResponse

Exemple

Exemple get_counts
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = GetCountsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 sso: Some("news/article".to_string()),
6 };
7 let _response = get_counts(&configuration, params).await?;
8 Ok(())
9}
10

get_logs Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
ssoStringNon

Réponse

Renvoie : ModerationApiGetLogsResponse

Exemple

Exemple get_logs
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetLogsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "news/article-12345".to_string(),
6 sso: Some("user@example.com".to_string()),
7 };
8 let response = get_logs(&configuration, params).await?;
9 let _ = response;
10 Ok(())
11}
12

get_manual_badges Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
ssoStringNon

Réponse

Renvoie : GetTenantManualBadgesResponse

Exemple

get_manual_badges Exemple
Copy Copy
1
2async fn fetch_badges(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetManualBadgesParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 sso: Some("news/article".to_string()),
6 };
7 let _response = get_manual_badges(configuration, params).await?;
8 Ok(())
9}
10

get_manual_badges_for_user Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
badges_user_idStringNo
comment_idStringNo
ssoStringNo

Réponse

Renvoie : GetUserManualBadgesResponse

Exemple

Exemple get_manual_badges_for_user
Copy Copy
1
2async fn fetch_badges(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetManualBadgesForUserParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 badges_user_id: Some("user-42".to_string()),
6 comment_id: Some("comment-987".to_string()),
7 sso: Some("sso-abc123".to_string()),
8 };
9 let _response: GetUserManualBadgesResponse = get_manual_badges_for_user(config, params).await?;
10 Ok(())
11}
12

get_moderation_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
include_emailboolNon
include_ipboolNon
ssoStringNon

Réponse

Renvoie : ModerationApiCommentResponse

Exemple

get_moderation_comment Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetModerationCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "news/article-6789".to_string(),
6 include_email: Some(true),
7 include_ip: Some(true),
8 sso: Some("sso-user-42".to_string()),
9 };
10 let _response = get_moderation_comment(&configuration, params).await?;
11 Ok(())
12}
13

get_moderation_comment_text Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
ssoStringNon

Réponse

Renvoie : GetCommentTextResponse

Exemple

get_moderation_comment_text Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetModerationCommentTextParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "comment-12345".to_string(),
6 sso: Some("user-sso-token".to_string()),
7 };
8 let _response: GetCommentTextResponse =
9 get_moderation_comment_text(&configuration, params).await?;
10 Ok(())
11}
12

get_pre_ban_summary Internal Link

Paramètres

NameTypeRequiredDescription
tenant_idStringYes
comment_idStringYes
include_by_user_id_and_emailboolNo
include_by_ipboolNo
include_by_email_domainboolNo
ssoStringNo

Réponse

Retourne : PreBanSummary

Exemple

Exemple get_pre_ban_summary
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetPreBanSummaryParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "comment-12345".to_string(),
6 include_by_user_id_and_email: Some(true),
7 include_by_ip: Some(false),
8 include_by_email_domain: Some(true),
9 sso: Some("sso-token-abc".to_string()),
10 };
11 let _summary = get_pre_ban_summary(&configuration, params).await?;
12 Ok(())
13}
14

get_search_comments_summary Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
valueStringNon
filtersStringNon
search_filtersStringNon
ssoStringNon

Réponse

Retourne : ModerationCommentSearchResponse

Exemple

Exemple get_search_comments_summary
Copy Copy
1
2async fn run_example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetSearchCommentsSummaryParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 value: Some("news/article".to_string()),
6 filters: Some("status:approved".to_string()),
7 search_filters: Some("author:john".to_string()),
8 sso: Some("sso-token-123".to_string()),
9 };
10 let _response = get_search_comments_summary(configuration, params).await?;
11 Ok(())
12}
13

get_search_pages Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
valueStringNon
ssoStringNon

Réponse

Retourne : ModerationPageSearchResponse

Exemple

Exemple get_search_pages
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetSearchPagesParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 value: Some("news/article".to_string()),
6 sso: Some("sso-token-123".to_string()),
7 };
8 let response: ModerationPageSearchResponse = get_search_pages(&configuration, params).await?;
9 Ok(())
10}
11

get_search_sites Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
valueStringNon
ssoStringNon

Réponse

Renvoie : ModerationSiteSearchResponse

Exemple

Exemple get_search_sites
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = GetSearchSitesParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 value: Some("news/article".to_string()),
6 sso: Some("sso-token-abc".to_string()),
7 };
8 let _response = get_search_sites(&config, params).await?;
9 Ok(())
10}
11

get_search_suggest Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
text_searchStringNon
ssoStringNon

Réponse

Retourne : ModerationSuggestResponse

Exemple

Exemple get_search_suggest
Copy Copy
1
2async fn run_example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetSearchSuggestParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 text_search: Some("news/article".to_string()),
6 sso: Some("sso-token-123".to_string()),
7 };
8 let _response: ModerationSuggestResponse = get_search_suggest(configuration, params).await?;
9 Ok(())
10}
11

get_search_users Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
valueStringNon
ssoStringNon

Réponse

Renvoie : ModerationUserSearchResponse

Exemple

Exemple get_search_users
Copy Copy
1
2async fn run_example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetSearchUsersParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 value: Some("john.doe".to_string()),
6 sso: Some("sso-provider".to_string()),
7 };
8 let _response: ModerationUserSearchResponse = get_search_users(configuration, params).await?;
9 Ok(())
10}
11

get_trust_factor Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
user_idStringNon
ssoStringNon

Réponse

Renvoie : GetUserTrustFactorResponse

Exemple

Exemple get_trust_factor
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = GetTrustFactorParams {
4 tenant_id: "acme-corp-tenant".into(),
5 user_id: Some("user-12345".into()),
6 sso: Some("sso-provider".into()),
7 };
8 let _response = get_trust_factor(&configuration, params).await?;
9 Ok(())
10}
11

get_user_ban_preference Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
ssoStringNon

Réponse

Renvoie : ApiModerateGetUserBanPreferencesResponse

Exemple

Exemple get_user_ban_preference
Copy Copy
1
2async fn example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetUserBanPreferenceParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 sso: Some("user123".to_string()),
6 };
7 let _response = get_user_ban_preference(configuration, params).await?;
8 Ok(())
9}
10

get_user_internal_profile Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
comment_idStringNo
ssoStringNo

Réponse

Renvoie : GetUserInternalProfileResponse

Exemple

get_user_internal_profile Exemple
Copy Copy
1
2async fn fetch_profile() -> Result<(), Error> {
3 let params = GetUserInternalProfileParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: Some("news/article".to_string()),
6 sso: Some("sso-user-xyz".to_string()),
7 };
8 let _response = get_user_internal_profile(&configuration, params).await?;
9 Ok(())
10}
11

post_adjust_comment_votes Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
adjust_comment_votes_paramsmodels::AdjustCommentVotesParamsOui
broadcast_idStringNon
ssoStringNon

Réponse

Renvoie : AdjustVotesResponse

Exemple

post_adjust_comment_votes Exemple
Copy Copy
1
2async fn adjust_votes_example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = PostAdjustCommentVotesParams {
4 tenant_id: "acme-corp".to_string(),
5 comment_id: "comment-9876".to_string(),
6 adjust_comment_votes_params: models::AdjustCommentVotesParams::default(),
7 broadcast_id: Some("broadcast-2023-11".to_string()),
8 sso: Some("sso-xyz".to_string()),
9 };
10 let _response = post_adjust_comment_votes(configuration, params).await?;
11 Ok(())
12}
13

post_ban_user_from_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
ban_emailboolNon
ban_email_domainboolNon
ban_ipboolNon
delete_all_users_commentsboolNon
banned_untilStringNon
is_shadow_banboolNon
update_idStringNon
ban_reasonStringNon
ssoStringNon

Réponse

Renvoie : BanUserFromCommentResult

Exemple

Exemple de post_ban_user_from_comment
Copy Copy
1
2async fn example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = PostBanUserFromCommentParams {
4 tenant_id: "acme-corp".to_string(),
5 comment_id: "cmt-12345".to_string(),
6 ban_email: Some(true),
7 ban_email_domain: Some(false),
8 ban_ip: Some(true),
9 delete_all_users_comments: Some(false),
10 banned_until: Some("2024-12-31T23:59:59Z".to_string()),
11 is_shadow_ban: Some(false),
12 update_id: Some("upd-987".to_string()),
13 ban_reason: Some("spam".to_string()),
14 sso: Some("sso-provider".to_string()),
15 };
16 let _result: BanUserFromCommentResult = post_ban_user_from_comment(configuration, params).await?;
17 Ok(())
18}
19

post_ban_user_undo Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
ban_user_undo_paramsmodels::BanUserUndoParamsYes
ssoStringNo

Réponse

Retourne : ApiEmptyResponse

Exemple

Exemple post_ban_user_undo
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = PostBanUserUndoParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 ban_user_undo_params: models::BanUserUndoParams {
6 user_id: "user-42".to_string(),
7 note: Some("ban appeal accepted".to_string()),
8 },
9 sso: Some("sso-token-abc".to_string()),
10 };
11 let _ = post_ban_user_undo(&configuration, params).await?;
12 Ok(())
13}
14

post_bulk_pre_ban_summary Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
bulk_pre_ban_paramsmodels::BulkPreBanParamsYes
include_by_user_id_and_emailboolNo
include_by_ipboolNo
include_by_email_domainboolNo
ssoStringNo

Réponse

Retourne : BulkPreBanSummary

Exemple

post_bulk_pre_ban_summary Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let bulk_params = models::BulkPreBanParams::default();
4 let params = PostBulkPreBanSummaryParams {
5 tenant_id: "acme-corp-tenant".to_string(),
6 bulk_pre_ban_params: bulk_params,
7 include_by_user_id_and_email: Some(true),
8 include_by_ip: Some(false),
9 include_by_email_domain: Some(true),
10 sso: Some("sso-token-xyz".to_string()),
11 };
12 let _summary = post_bulk_pre_ban_summary(&configuration, params).await?;
13 Ok(())
14}
15

post_comments_by_ids Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comments_by_ids_paramsmodels::CommentsByIdsParamsOui
ssoStringNon

Réponse

Renvoie : ModerationApiChildCommentsResponse

Exemple

post_comments_by_ids Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = PostCommentsByIdsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comments_by_ids_params: models::CommentsByIdsParams {
6 comment_ids: vec!["cmt123".to_string(), "cmt456".to_string()],
7 },
8 sso: Some("user-sso-token".to_string()),
9 };
10 let _response = post_comments_by_ids(&configuration, params).await?;
11 Ok(())
12}
13

post_flag_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
broadcast_idStringNon
ssoStringNon

Réponse

Renvoie : ApiEmptyResponse

Exemple

post_flag_comment Exemple
Copy Copy
1
2async fn flag_comment_example() -> Result<(), Error> {
3 let params = PostFlagCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "comment-9f8e7d".to_string(),
6 broadcast_id: Some("broadcast-2024-01".to_string()),
7 sso: Some("sso-uid-12345".to_string()),
8 };
9 post_flag_comment(&config, params).await?;
10 Ok(())
11}
12

post_remove_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
broadcast_idStringNon
ssoStringNon

Réponse

Renvoie : PostRemoveCommentApiResponse

Exemple

post_remove_comment Exemple
Copy Copy
1
2async fn remove_comment_example(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = PostRemoveCommentParams {
4 tenant_id: "acme-corp".into(),
5 comment_id: "news/article/42".into(),
6 broadcast_id: Some("live-event-99".into()),
7 sso: Some("sso-user-abc".into()),
8 };
9 let _response = post_remove_comment(config, params).await?;
10 Ok(())
11}
12

post_restore_deleted_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
broadcast_idStringNon
ssoStringNon

Réponse

Renvoie : ApiEmptyResponse

Exemple

Exemple post_restore_deleted_comment
Copy Copy
1
2async fn restore_comment() -> Result<(), Error> {
3 let config: &configuration::Configuration = get_configuration();
4 let params = PostRestoreDeletedCommentParams {
5 tenant_id: "acme-corp-tenant".to_string(),
6 comment_id: "comment-12345".to_string(),
7 broadcast_id: Some("broadcast-987".to_string()),
8 sso: Some("user@example.com".to_string()),
9 };
10 let _response = post_restore_deleted_comment(config, params).await?;
11 Ok(())
12}
13

post_set_comment_approval_status Internal Link

Paramètres

NomTypeRequisDescription
tenant_idStringYes
comment_idStringYes
approvedboolNo
broadcast_idStringNo
ssoStringNo

Réponse

Renvoie : SetCommentApprovedResponse

Exemple

Exemple de post_set_comment_approval_status
Copy Copy
1
2async fn approve_comment(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = PostSetCommentApprovalStatusParams {
4 tenant_id: "acme-corp".to_string(),
5 comment_id: "cmt-9876".to_string(),
6 approved: Some(true),
7 broadcast_id: Some("broadcast-2023".to_string()),
8 sso: None,
9 };
10 let _response = post_set_comment_approval_status(configuration, params).await?;
11 Ok(())
12}
13

post_set_comment_review_status Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
reviewedboolNon
broadcast_idStringNon
ssoStringNon

Réponse

Renvoie : ApiEmptyResponse

Exemple

post_set_comment_review_status Exemple
Copy Copy
1
2async fn update_review_status(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = PostSetCommentReviewStatusParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "comment-98765".to_string(),
6 reviewed: Some(true),
7 broadcast_id: Some("broadcast-2023-summer".to_string()),
8 sso: Some("sso-user-42".to_string()),
9 };
10 post_set_comment_review_status(configuration, params).await?;
11 Ok(())
12}
13

post_set_comment_spam_status Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
spamboolNon
perm_not_spamboolNon
broadcast_idStringNon
ssoStringNon

Réponse

Retourne : ApiEmptyResponse

Exemple

post_set_comment_spam_status Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = PostSetCommentSpamStatusParams {
4 tenant_id: "acme-corp-tenant".into(),
5 comment_id: "comment-12345".into(),
6 spam: Some(true),
7 perm_not_spam: Some(false),
8 broadcast_id: Some("broadcast-678".into()),
9 sso: Some("user@example.com".into()),
10 };
11 post_set_comment_spam_status(&configuration, params).await?;
12 Ok(())
13}
14

post_set_comment_text Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
comment_idStringYes
set_comment_text_paramsmodels::SetCommentTextParamsYes
broadcast_idStringNo
ssoStringNo

Réponse

Renvoie : SetCommentTextResponse

Exemple

post_set_comment_text Exemple
Copy Copy
1
2async fn update_comment(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = PostSetCommentTextParams {
4 tenant_id: "acme-corp".to_string(),
5 comment_id: "comment-9876".to_string(),
6 set_comment_text_params: models::SetCommentTextParams {
7 text: "Revised comment content".to_string(),
8 },
9 broadcast_id: Some("broadcast-2023".to_string()),
10 sso: Some("sso-token-abc".to_string()),
11 };
12 let _response = post_set_comment_text(config, params).await?;
13 Ok(())
14}
15

post_un_flag_comment Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
comment_idStringYes
broadcast_idStringNo
ssoStringNo

Réponse

Retourne : ApiEmptyResponse

Exemple

post_un_flag_comment Exemple
Copy Copy
1
2async fn unflag_example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = PostUnFlagCommentParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "comment-12345".to_string(),
6 broadcast_id: Some("broadcast-987".to_string()),
7 sso: Some("user@example.com".to_string()),
8 };
9 let _ = post_un_flag_comment(configuration, params).await?;
10 Ok(())
11}
12

post_vote Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
directionStringNon
broadcast_idStringNon
ssoStringNon

Réponse

Retourne : VoteResponse

Exemple

post_vote Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let cfg = configuration::Configuration::default();
4 let params = PostVoteParams {
5 tenant_id: "acme-corp-tenant".to_string(),
6 comment_id: "news/article-12345".to_string(),
7 direction: Some("up".to_string()),
8 broadcast_id: Some("broadcast-987".to_string()),
9 sso: None,
10 };
11 let _response = post_vote(&cfg, params).await?;
12 Ok(())
13}
14

put_award_badge Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
badge_idStringYes
user_idStringNo
comment_idStringNo
broadcast_idStringNo
ssoStringNo

Réponse

Renvoie : AwardUserBadgeResponse

Exemple

put_award_badge Exemple
Copy Copy
1
2async fn example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = PutAwardBadgeParams {
4 tenant_id: "acme-corp".to_string(),
5 badge_id: "top-contributor".to_string(),
6 user_id: Some("user-42".to_string()),
7 comment_id: Some("comment-99".to_string()),
8 broadcast_id: None,
9 sso: Some("sso-abc123".to_string()),
10 };
11 let _response = put_award_badge(configuration, params).await?;
12 Ok(())
13}
14

put_close_thread Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
url_idStringOui
ssoStringNon

Réponse

Retour : ApiEmptyResponse

Exemple

Exemple put_close_thread
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let config = configuration::Configuration::default();
4 let params = PutCloseThreadParams {
5 tenant_id: "acme-corp-tenant".to_string(),
6 url_id: "news/article-123".to_string(),
7 sso: Some("sso-token-abc".to_string()),
8 };
9 put_close_thread(&config, params).await?;
10 Ok(())
11}
12

put_remove_badge Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
badge_idStringOui
user_idStringNon
comment_idStringNon
broadcast_idStringNon
ssoStringNon

Réponse

Retourne : RemoveUserBadgeResponse

Exemple

put_remove_badge Exemple
Copy Copy
1
2async fn remove_badge_example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = PutRemoveBadgeParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 badge_id: "news-contributor".to_string(),
6 user_id: Some("user-42".to_string()),
7 comment_id: Some("comment-12345".to_string()),
8 broadcast_id: None,
9 sso: Some("sso-key-xyz".to_string()),
10 };
11 let _response: RemoveUserBadgeResponse = put_remove_badge(configuration, params).await?;
12 Ok(())
13}
14

put_reopen_thread Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
url_idStringOui
ssoStringNon

Réponse

Renvoie : ApiEmptyResponse

Exemple

put_reopen_thread Exemple
Copy Copy
1
2async fn reopen_thread_example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = PutReopenThreadParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/article-123".to_string(),
6 sso: Some("user-42".to_string()),
7 };
8 let _response: ApiEmptyResponse = put_reopen_thread(configuration, params).await?;
9 Ok(())
10}
11

set_trust_factor Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
user_idStringNo
trust_factorStringNo
ssoStringNo

Réponse

Retourne : SetUserTrustFactorResponse

Exemple

set_trust_factor Exemple
Copy Copy
1
2async fn update_trust() -> Result<(), Error> {
3 let params = SetTrustFactorParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 user_id: Some("user-123".to_string()),
6 trust_factor: Some("high".to_string()),
7 sso: Some("sso-token-xyz".to_string()),
8 };
9 let _response = set_trust_factor(&configuration, params).await?;
10 Ok(())
11}
12

create_moderator Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
create_moderator_bodymodels::CreateModeratorBodyYes

Réponse

Renvoie : CreateModeratorResponse

Exemple

Exemple de create_moderator
Copy Copy
1
2async fn example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = CreateModeratorParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 create_moderator_body: models::CreateModeratorBody {
6 email: "mod@example.com".to_string(),
7 username: Some("mod_user".to_string()),
8 permissions: vec!["delete".to_string(), "edit".to_string()],
9 ..Default::default()
10 },
11 };
12 let _response = create_moderator(configuration, params).await?;
13 Ok(())
14}
15

delete_moderator Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
idStringYes
send_emailStringNo

Réponse

Renvoie : ApiEmptyResponse

Exemple

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

get_moderator Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui

Réponse

Renvoie : GetModeratorResponse

Exemple

Exemple get_moderator
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = GetModeratorParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "moderator-123".to_string(),
6 };
7 let _response: GetModeratorResponse = get_moderator(configuration, params).await?;
8 Ok(())
9}
10

get_moderators Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
skipf64Non

Réponse

Retourne : GetModeratorsResponse

Exemple

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

send_invite Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
idStringYes
from_nameStringYes

Réponse

Retourne : ApiEmptyResponse

Exemple

send_invite Exemple
Copy Copy
1
2async fn run_example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = SendInviteParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article".to_string(),
6 from_name: "John Doe".to_string(),
7 message: Some("Welcome to the platform".to_string()),
8 ..Default::default()
9 };
10 let _ = send_invite(configuration, params).await?;
11 Ok(())
12}
13

update_moderator Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
idStringYes
update_moderator_bodymodels::UpdateModeratorBodyYes

Réponse

Renvoie : ApiEmptyResponse

Exemple

Exemple de update_moderator
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = UpdateModeratorParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "moderator-42".to_string(),
6 update_moderator_body: models::UpdateModeratorBody {
7 name: Some("Alice Smith".to_string()),
8 email: Some("alice.smith@example.com".to_string()),
9 is_active: Some(true),
10 },
11 };
12 update_moderator(&configuration, params).await?;
13 Ok(())
14}
15

delete_notification_count Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
idStringYes

Réponse

Renvoie : ApiEmptyResponse

Exemple

Exemple delete_notification_count
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = DeleteNotificationCountParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article-123".to_string(),
6 };
7 let _response: ApiEmptyResponse = delete_notification_count(&configuration, params).await?;
8 Ok(())
9}
10

get_cached_notification_count Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui

Réponse

Retourne : GetCachedNotificationCountResponse

Exemple

Exemple get_cached_notification_count
Copy Copy
1
2async fn fetch_notification_count() -> Result<(), Error> {
3 let params = GetCachedNotificationCountParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article".to_string(),
6 };
7 let response = get_cached_notification_count(&configuration, params).await?;
8 let _ = response.user_notification_count;
9 Ok(())
10}
11

get_notification_count Internal Link

Paramètres

NameTypeRequiredDescription
tenant_idStringYes
user_idStringNo
url_idStringNo
from_comment_idStringNo
viewedboolNo

Réponse

Renvoie : GetNotificationCountResponse

Exemple

Exemple get_notification_count
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetNotificationCountParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 user_id: Some("john.doe".to_string()),
6 url_id: Some("blog/post-123".to_string()),
7 from_comment_id: Some("comment789".to_string()),
8 viewed: Some(true),
9 };
10 let _response = get_notification_count(&configuration, params).await?;
11 Ok(())
12}
13

get_notifications Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
user_idStringNon
url_idStringNon
from_comment_idStringNon
viewedboolNon
skipf64Non

Réponse

Retourne : GetNotificationsResponse

Exemple

Exemple get_notifications
Copy Copy
1
2async fn fetch_notifications(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetNotificationsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 user_id: Some("user-123".to_string()),
6 url_id: Some("news/article".to_string()),
7 from_comment_id: Some("cmt-456".to_string()),
8 viewed: Some(true),
9 skip: Some(0.0),
10 };
11 let _response = get_notifications(configuration, params).await?;
12 Ok(())
13}
14

update_notification Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
idStringYes
update_notification_bodymodels::UpdateNotificationBodyYes
user_idStringNo

Réponse

Retourne : ApiEmptyResponse

Exemple

update_notification Exemple
Copy Copy
1
2#[tokio::main]
3async fn main() -> Result<(), Error> {
4 let params = UpdateNotificationParams {
5 tenant_id: "acme-corp".to_string(),
6 id: "news/article".to_string(),
7 update_notification_body: models::UpdateNotificationBody {
8 title: "New article published".to_string(),
9 content: "Read the latest updates in our blog.".to_string(),
10 },
11 user_id: Some("user-123".to_string()),
12 };
13 update_notification(&configuration, params).await?;
14 Ok(())
15}
16

create_v1_page_react Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
url_idStringOui
titleStringNon

Réponse

Retourne : CreateV1PageReact

Exemple

Exemple create_v1_page_react
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: CreateV1PageReactParams = CreateV1PageReactParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/article".to_string(),
6 title: Some("Rust Community Update".to_string()),
7 };
8 let _response = create_v1_page_react(&config, params).await?;
9 Ok(())
10}
11

create_v2_page_react Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
url_idStringYes
idStringYes
titleStringNo

Réponse

Retourne : CreateV1PageReact

Exemple

create_v2_page_react Exemple
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = CreateV2PageReactParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/article".to_string(),
6 id: "comment-123".to_string(),
7 title: Some("Breaking News".to_string()),
8 };
9 let _react = create_v2_page_react(&configuration, params).await?;
10 Ok(())
11}
12

delete_v1_page_react Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
url_idStringOui

Réponse

Renvoie : CreateV1PageReact

Exemple

delete_v1_page_react Exemple
Copy Copy
1
2async fn run_example(cfg: &configuration::Configuration) -> Result<(), Error> {
3 let tenant_id: String = Some("acme-corp-tenant".to_string()).unwrap();
4 let url_id: String = "news/article".to_string();
5 let params: DeleteV1PageReactParams = DeleteV1PageReactParams {
6 tenant_id,
7 url_id,
8 ..Default::default()
9 };
10 let _result = delete_v1_page_react(cfg, params).await?;
11 Ok(())
12}
13

delete_v2_page_react Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
url_idStringYes
idStringYes

Réponse

Retourne : CreateV1PageReact

Exemple

delete_v2_page_react Exemple
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = DeleteV2PageReactParams {
4 tenant_id: "acme-corp-tenant".into(),
5 url_id: "news/article".into(),
6 id: "react-987".into(),
7 };
8 let _response: CreateV1PageReact = delete_v2_page_react(&config, params).await?;
9 Ok(())
10}
11

get_v1_page_likes Internal Link

Parameters

NameTypeRequiredDescription
tenant_idStringYes
url_idStringYes

Response

Renvoie : GetV1PageLikes

Example

Exemple get_v1_page_likes
Copy Copy
1
2async fn example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetV1PageLikesParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/article".to_string(),
6 };
7 let _likes = get_v1_page_likes(configuration, params).await?;
8 Ok(())
9}
10

get_v2_page_react_users Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
url_idStringOui
idStringOui

Réponse

Renvoie : GetV2PageReactUsersResponse

Exemple

get_v2_page_react_users Exemple
Copy Copy
1
2async fn example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetV2PageReactUsersParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/article".to_string(),
6 id: "react567".to_string(),
7 page: Some(1),
8 per_page: Some(50),
9 ..Default::default()
10 };
11 let _response = get_v2_page_react_users(configuration, params).await?;
12 Ok(())
13}
14

get_v2_page_reacts Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
url_idStringYes

Réponse

Renvoie : GetV2PageReacts

Exemple

get_v2_page_reacts Exemple
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = GetV2PageReactsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/article".to_string(),
6 page: Some(1),
7 page_size: Some(50),
8 };
9 let _reacts = get_v2_page_reacts(&configuration, params).await?;
10 Ok(())
11}
12

add_page Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
create_api_page_datamodels::CreateApiPageDataOui

Réponse

Renvoie : AddPageApiResponse

Exemple

add_page Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = AddPageParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 create_api_page_data: models::CreateApiPageData {
6 title: Some("Breaking News".to_string()),
7 url: Some("/news/article".to_string()),
8 ..Default::default()
9 },
10 };
11 let _response = add_page(&configuration, params).await?;
12 Ok(())
13}
14

delete_page Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
idStringYes

Réponse

Retourne : DeletePageApiResponse

Exemple

Exemple delete_page
Copy Copy
1
2async fn example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = DeletePageParams {
4 tenant_id: "acme-corp-tenant".into(),
5 id: "news/article".into(),
6 };
7 let _resp = delete_page(configuration, params).await?;
8 Ok(())
9}
10

get_offline_users Internal Link

Past commenters on the page who are NOT currently online. Sorted by displayName.
Commentateurs précédents sur la page qui ne sont PAS actuellement en ligne. Triés par displayName.

Use this after exhausting /users/online to render a "Members" section.
Utilisez ceci après avoir épuisé /users/online pour afficher une section « Membres ».

Cursor pagination on commenterName: server walks the partial {tenantId, urlId, commenterName} index from afterName forward via $gt, no $skip cost.
Pagination par curseur sur commenterName : le serveur parcourt le fragment {tenantId, urlId, commenterName} à partir de afterName vers l’avant via $gt, sans coût $skip.

Parameters

NomTypeObligatoireDescription
tenant_idStringYes
url_idStringYes
after_nameStringNo
after_user_idStringNo

Response

Retourne : PageUsersOfflineResponse

Example

Exemple get_offline_users
Copy Copy
1
2async fn fetch_offline(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetOfflineUsersParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/article".to_string(),
6 after_name: Some("alice".to_string()),
7 after_user_id: Some("user-42".to_string()),
8 };
9 let _response = get_offline_users(config, params).await?;
10 Ok(())
11}
12

get_online_users Internal Link

Visionneurs actuellement en ligne d’une page : les personnes dont la session websocket est abonnée à la page en ce moment.
Renvoie anonCount + totalCount (abonnés à toute la salle, y compris les visionneurs anonymes que nous n’énumérons pas).

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
url_idStringOui
after_nameStringNon
after_user_idStringNon

Réponse

Renvoie : PageUsersOnlineResponse

Exemple

Exemple get_online_users
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetOnlineUsersParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/article".to_string(),
6 after_name: Some("john_doe".to_string()),
7 after_user_id: Some("user-123".to_string()),
8 };
9 let _response: PageUsersOnlineResponse = get_online_users(&config, params).await?;
10 Ok(())
11}
12

get_page_by_urlid Internal Link

Paramètres

NameTypeRequiredDescription
tenant_idStringYes
url_idStringYes

Réponse

Retourne : GetPageByUrlidApiResponse

Exemple

Exemple get_page_by_urlid
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetPageByUrlidParams {
4 tenant_id: "acme-corp-tenant".into(),
5 url_id: "news/article".into(),
6 };
7 let _response = get_page_by_urlid(&config, params).await?;
8 Ok(())
9}
10

get_pages Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui

Réponse

Renvoie : GetPagesApiResponse

Exemple

Exemple get_pages
Copy Copy
1
2async fn fetch_pages(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetPagesParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 };
6 let _response: GetPagesApiResponse = get_pages(configuration, params).await?;
7 Ok(())
8}
9

get_pages_public Internal Link

Liste les pages pour un locataire. Utilisé par le client de bureau FChat pour remplir sa liste de salles. Nécessite enableFChat à vrai dans la configuration personnalisée résolue pour chaque page. Les pages qui nécessitent SSO sont filtrées en fonction de l'accès aux groupes de l'utilisateur demandeur.

Parameters

NomTypeObligatoireDescription
tenant_idStringYes
cursorStringNo
limiti32No
qStringNo
sort_bymodels::PagesSortByNo
has_commentsboolNo

Response

Retourne : GetPublicPagesResponse

Exemple

Exemple get_pages_public
Copy Copy
1
2async fn example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetPagesPublicParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 cursor: Some("page_20".to_string()),
6 limit: Some(50),
7 q: Some("news/article".to_string()),
8 sort_by: Some(models::PagesSortBy::CreatedDesc),
9 has_comments: Some(true),
10 };
11 let _response = get_pages_public(configuration, params).await?;
12 Ok(())
13}
14

get_users_info Internal Link

Bulk user info for a tenant. Given userIds, return display info from User / SSOUser.
Used by the comment widget to enrich users that just appeared via a presence event.
No page context: privacy is enforced uniformly (private profiles are masked).

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idsStringOui

Réponse

Renvoie : PageUsersInfoResponse

Exemple

Exemple get_users_info
Copy Copy
1
2let params = GetUsersInfoParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 ids: "user-1,user-2".to_string(),
5};
6let page: PageUsersInfoResponse = get_users_info(&configuration, params).await?;
7

patch_page Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
update_api_page_datamodels::UpdateApiPageDataOui

Réponse

Renvoie : PatchPageApiResponse

Exemple

Exemple patch_page
Copy Copy
1
2async fn run_patch_page() -> Result<(), Error> {
3 let update = models::UpdateApiPageData {
4 title: Some("Breaking News".into()),
5 content: Some("Updated article content".into()),
6 ..Default::default()
7 };
8 let params = PatchPageParams {
9 tenant_id: "acme-corp-tenant".into(),
10 id: "news/article".into(),
11 update_api_page_data: update,
12 };
13 let _resp: PatchPageApiResponse = patch_page(&configuration, params).await?;
14 Ok(())
15}
16

delete_pending_webhook_event Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
idStringYes

Réponse

Renvoie : ApiEmptyResponse

Exemple

Exemple delete_pending_webhook_event
Copy Copy
1
2async fn example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = DeletePendingWebhookEventParams {
4 tenant_id: "acme-corp-tenant".into(),
5 id: "event-12345".into(),
6 };
7 delete_pending_webhook_event(configuration, params).await?;
8 Ok(())
9}
10

get_pending_webhook_event_count Internal Link

Paramètres

NameTypeRequiredDescription
tenant_idStringYes
comment_idStringNo
external_idStringNo
event_typeStringNo
domainStringNo
attempt_count_gtf64No

Réponse

Renvoie: GetPendingWebhookEventCountResponse

Exemple

Exemple de get_pending_webhook_event_count
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetPendingWebhookEventCountParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: Some("comment-12345".to_string()),
6 external_id: Some("ext-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 = get_pending_webhook_event_count(&configuration, params).await?;
12 Ok(())
13}
14

get_pending_webhook_events Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
comment_idStringNo
external_idStringNo
event_typeStringNo
domainStringNo
attempt_count_gtf64No
skipf64No

Réponse

Retourne : GetPendingWebhookEventsResponse

Exemple

get_pending_webhook_events Exemple
Copy Copy
1
2async fn demo() -> Result<(), Error> {
3 let params = GetPendingWebhookEventsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: Some("comment-123".to_string()),
6 external_id: Some("external-789".to_string()),
7 event_type: Some("comment_created".to_string()),
8 domain: Some("news.example.com".to_string()),
9 attempt_count_gt: Some(1.0),
10 skip: Some(0.0),
11 };
12 let _response = get_pending_webhook_events(&config, params).await?;
13 Ok(())
14}
15

create_question_config Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
create_question_config_bodymodels::CreateQuestionConfigBodyOui

Réponse

Renvoie : CreateQuestionConfigResponse

Exemple

create_question_config Exemple
Copy Copy
1
2let params = CreateQuestionConfigParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 create_question_config_body: models::CreateQuestionConfigBody {
5 description: Some("Survey for news article feedback".to_string()),
6 custom_options: Some(vec![
7 QuestionConfigCustomOptionsInner {
8 option_key: "allow_multiple".to_string(),
9 option_value: "true".to_string(),
10 },
11 ]),
12 ..Default::default()
13 },
14};
15
16let response = create_question_config(&configuration, params).await?;
17

delete_question_config Internal Link

Parameters

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui

Réponse

Renvoie : ApiEmptyResponse

Exemple

Exemple de delete_question_config
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params: DeleteQuestionConfigParams = DeleteQuestionConfigParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "question-456".to_string(),
6 };
7 delete_question_config(&configuration, params).await?;
8 Ok(())
9}
10

get_question_config Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui

Réponse

Retourne : GetQuestionConfigResponse

Exemple

Exemple get_question_config
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetQuestionConfigParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article".to_string(),
6 };
7 let _response = get_question_config(&configuration, params).await?;
8 Ok(())
9}
10

get_question_configs Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
skipf64Non

Réponse

Retourne : GetQuestionConfigsResponse

Exemple

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

update_question_config Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
update_question_config_bodymodels::UpdateQuestionConfigBodyOui

Réponse

Retourne : ApiEmptyResponse

Exemple

Exemple de mise à jour de la configuration de question
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = UpdateQuestionConfigParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article".to_string(),
6 update_question_config_body: UpdateQuestionConfigBody {
7 title: "Breaking News".to_string(),
8 is_active: true,
9 custom_options: vec![
10 QuestionConfigCustomOptionsInner {
11 key: "priority".to_string(),
12 value: "high".to_string(),
13 },
14 ],
15 description: Some("Config for breaking news article".to_string()),
16 },
17 };
18 update_question_config(&configuration, params).await?;
19 Ok(())
20}
21

create_question_result Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
create_question_result_bodymodels::CreateQuestionResultBodyOui

Réponse

Renvoie : CreateQuestionResultResponse

Exemple

Exemple create_question_result
Copy Copy
1
2let mut metadata = std::collections::HashMap::new();
3metadata.insert("source".to_string(), "web".to_string());
4
5let body = models::CreateQuestionResultBody {
6 question_id: "q-987".to_string(),
7 user_id: "user-42".to_string(),
8 answer: "Positive".to_string(),
9 metadata: Some(metadata),
10};
11
12let params = CreateQuestionResultParams {
13 tenant_id: "acme-corp-tenant".to_string(),
14 create_question_result_body: body,
15};
16
17let response = create_question_result(&configuration, params).await?;
18

delete_question_result Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui

Réponse

Renvoie : ApiEmptyResponse

Exemple

Exemple de delete_question_result
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = DeleteQuestionResultParams {
4 tenant_id: "acme-corp".to_string(),
5 id: "question-9876".to_string(),
6 };
7 delete_question_result(&configuration, params).await?;
8 Ok(())
9}
10

get_question_result Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui

Réponse

Retourne : GetQuestionResultResponse

Exemple

get_question_result Exemple
Copy Copy
1
2async fn fetch_question_result(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetQuestionResultParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "question-12345".to_string(),
6 locale: Some("en-US".to_string()),
7 };
8 let _response: GetQuestionResultResponse = get_question_result(config, params).await?;
9 Ok(())
10}
11

get_question_results Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
url_idStringNon
user_idStringNon
start_dateStringNon
question_idStringNon
question_idsStringNon
skipf64Non

Réponse

Renvoie : GetQuestionResultsResponse

Exemple

Exemple get_question_results
Copy Copy
1
2async fn example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetQuestionResultsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: Some("news/article".to_string()),
6 user_id: Some("user-12345".to_string()),
7 start_date: Some("2023-01-01".to_string()),
8 question_id: Some("q-987".to_string()),
9 question_ids: Some("q-1,q-2,q-3".to_string()),
10 skip: Some(10.0),
11 };
12 let _response = get_question_results(configuration, params).await?;
13 Ok(())
14}
15

update_question_result Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
update_question_result_bodymodels::UpdateQuestionResultBodyOui

Réponse

Renvoie : ApiEmptyResponse

Exemple

update_question_result Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = UpdateQuestionResultParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "question-9876".to_string(),
6 update_question_result_body: models::UpdateQuestionResultBody {
7 status: Some("approved".to_string()),
8 score: Some(95),
9 ..Default::default()
10 },
11 };
12 let _ = update_question_result(&configuration, params).await?;
13 Ok(())
14}
15

aggregate_question_results Internal Link

Paramètres

NomTypeRequisDescription
tenant_idStringOui
question_idStringNon
question_idsVecNon
url_idStringNon
time_bucketmodels::AggregateTimeBucketNon
start_datechrono::DateTimechrono::FixedOffsetNon
force_recalculateboolNon

Réponse

Renvoie : AggregateQuestionResultsResponse

Exemple

aggregate_question_results Exemple
Copy Copy
1
2let params = AggregateQuestionResultsParams {
3 tenant_id: "acme-corp-tenant".to_string(),
4 question_id: Some("question-123".to_string()),
5 question_ids: Some(vec!["question-123".to_string(), "question-456".to_string()]),
6 url_id: Some("news/article".to_string()),
7 time_bucket: Some(models::AggregateTimeBucket::Day),
8 start_date: Some(chrono::DateTime::parse_from_rfc3339("2023-01-01T00:00:00+00:00").unwrap()),
9 force_recalculate: Some(true),
10};
11
12let response = aggregate_question_results(&configuration, params).await?;
13

bulk_aggregate_question_results Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
bulk_aggregate_question_results_requestmodels::BulkAggregateQuestionResultsRequestOui
force_recalculateboolNon

Réponse

Renvoie : BulkAggregateQuestionResultsResponse

Exemple

Exemple bulk_aggregate_question_results
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let request = models::BulkAggregateQuestionResultsRequest {
4 question_ids: vec!["q123".into(), "q456".into()],
5 time_bucket: "daily".into(),
6 };
7 let params = BulkAggregateQuestionResultsParams {
8 tenant_id: "acme-corp-tenant".into(),
9 bulk_aggregate_question_results_request: request,
10 force_recalculate: Some(true),
11 };
12 let _response = bulk_aggregate_question_results(&configuration, params).await?;
13 Ok(())
14}
15

combine_comments_with_question_results Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
question_idStringNo
question_idsVecNo
url_idStringNo
start_datechrono::DateTimechrono::FixedOffsetNo
force_recalculateboolNo
min_valuef64No
max_valuef64No
limitf64No

Réponse

Retourne : CombineQuestionResultsWithCommentsResponse

Exemple

Exemple combine_comments_with_question_results
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let config = configuration::Configuration::default();
4 let params = CombineCommentsWithQuestionResultsParams {
5 tenant_id: "acme-corp-tenant".to_string(),
6 question_id: Some("q123".to_string()),
7 question_ids: Some(vec!["q123".to_string(), "q124".to_string()]),
8 url_id: Some("news/article".to_string()),
9 start_date: Some(chrono::DateTime::parse_from_rfc3339("2023-01-01T00:00:00+00:00").unwrap()),
10 force_recalculate: Some(true),
11 min_value: Some(0.0),
12 max_value: Some(100.0),
13 limit: Some(50.0),
14 };
15 let _response = combine_comments_with_question_results(&config, params).await?;
16 Ok(())
17}
18

add_sso_user Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
create_apisso_user_datamodels::CreateApissoUserDataYes

Réponse

Renvoie : AddSsoUserApiResponse

Exemple

Exemple add_sso_user
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let user_data = models::CreateApissoUserData {
4 username: "jdoe".to_string(),
5 email: "jdoe@acme.com".to_string(),
6 display_name: Some("John Doe".to_string()),
7 is_active: Some(true),
8 };
9 let params = AddSsoUserParams {
10 tenant_id: "acme-corp".to_string(),
11 create_apisso_user_data: user_data,
12 };
13 let _response = add_sso_user(&configuration, params).await?;
14 Ok(())
15}
16

delete_sso_user Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
delete_commentsboolNon
comment_delete_modeStringNon

Réponse

Renvoie : DeleteSsoUserApiResponse

Exemple

Exemple delete_sso_user
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = DeleteSsoUserParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "user-42".to_string(),
6 delete_comments: Some(true),
7 comment_delete_mode: Some("soft".to_string()),
8 };
9 let _response: DeleteSsoUserApiResponse = delete_sso_user(&config, params).await?;
10 Ok(())
11}
12

get_sso_user_by_email Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
emailStringOui

Réponse

Renvoie : GetSsoUserByEmailApiResponse

Exemple

Exemple get_sso_user_by_email
Copy Copy
1
2async fn run_example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let tenant_id = Some("acme-corp".to_string());
4 let email = Some("john.doe@example.com".to_string());
5 let params = GetSsoUserByEmailParams {
6 tenant_id: tenant_id.unwrap(),
7 email: email.unwrap(),
8 };
9 let _response = get_sso_user_by_email(configuration, params).await?;
10 Ok(())
11}
12

get_sso_user_by_id Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui

Réponse

Renvoie : GetSsoUserByIdApiResponse

Exemple

get_sso_user_by_id Exemple
Copy Copy
1
2async fn example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetSsoUserByIdParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "user-9876".to_string(),
6 };
7 let _response: GetSsoUserByIdApiResponse = get_sso_user_by_id(configuration, params).await?;
8 Ok(())
9}
10

get_sso_users Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
skipi32Non

Réponse

Renvoie : GetSsoUsersResponse

Exemple

get_sso_users Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetSsoUsersParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 skip: Some(10),
6 };
7 let _response = get_sso_users(&configuration, params).await?;
8 Ok(())
9}
10

patch_sso_user Internal Link

Paramètres

NameTypeRequiredDescription
tenant_idStringYes
idStringYes
update_apisso_user_datamodels::UpdateApissoUserDataYes
update_commentsboolNo

Réponse

Renvoie: PatchSsoUserApiResponse

Exemple

Exemple patch_sso_user
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let config = configuration::Configuration::default();
4 let update_data = models::UpdateApissoUserData {
5 email: Some("john.doe@example.com".to_string()),
6 name: Some("John Doe".to_string()),
7 };
8 let params = PatchSsoUserParams {
9 tenant_id: "acme-corp-tenant".to_string(),
10 id: "user-12345".to_string(),
11 update_apisso_user_data: update_data,
12 update_comments: Some(true),
13 };
14 let _response: PatchSsoUserApiResponse = patch_sso_user(&config, params).await?;
15 Ok(())
16}
17

put_sso_user Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
update_apisso_user_datamodels::UpdateApissoUserDataOui
update_commentsboolNon

Réponse

Renvoie : PutSsoUserApiResponse

Exemple

Exemple put_sso_user
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let update_data = UpdateApissoUserData {
4 email: "jane.doe@example.com".to_string(),
5 display_name: "Jane Doe".to_string(),
6 };
7 let params = PutSsoUserParams {
8 tenant_id: "acme-corp-tenant".to_string(),
9 id: "user-12345".to_string(),
10 update_apisso_user_data: update_data,
11 update_comments: Some(true),
12 };
13 let _response = put_sso_user(&configuration, params).await?;
14 Ok(())
15}
16

create_subscription Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
create_api_user_subscription_datamodels::CreateApiUserSubscriptionDataOui

Réponse

Renvoie : CreateSubscriptionApiResponse

Exemple

Exemple create_subscription
Copy Copy
1
2async fn run(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let subscription_data = models::CreateApiUserSubscriptionData {
4 plan_id: "pro-plan".to_string(),
5 trial_period_days: Some(14),
6 start_date: Some("2024-01-01".to_string()),
7 ..Default::default()
8 };
9 let params = CreateSubscriptionParams {
10 tenant_id: "acme-corp-tenant".to_string(),
11 create_api_user_subscription_data: subscription_data,
12 };
13 let _response: CreateSubscriptionApiResponse = create_subscription(configuration, params).await?;
14 Ok(())
15}
16

delete_subscription Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
user_idStringNon

Réponse

Retourne : DeleteSubscriptionApiResponse

Exemple

delete_subscription Exemple
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = DeleteSubscriptionParams {
4 tenant_id: "acme-corp".to_string(),
5 id: "sub-2024-09".to_string(),
6 user_id: Some("user-42".to_string()),
7 };
8 let _response = delete_subscription(&config, params).await?;
9 Ok(())
10}
11

get_subscriptions Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
user_idStringNon

Réponse

Renvoie : GetSubscriptionsApiResponse

Exemple

Exemple get_subscriptions
Copy Copy
1
2async fn fetch_subscriptions(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetSubscriptionsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 user_id: Some("user-12345".to_string()),
6 };
7 let _response: GetSubscriptionsApiResponse = get_subscriptions(config, params).await?;
8 Ok(())
9}
10

update_subscription Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
update_api_user_subscription_datamodels::UpdateApiUserSubscriptionDataOui
user_idStringNon

Réponse

Renvoie : UpdateSubscriptionApiResponse

Exemple

Exemple update_subscription
Copy Copy
1
2async fn example(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = UpdateSubscriptionParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "sub-12345".to_string(),
6 update_api_user_subscription_data: models::UpdateApiUserSubscriptionData {
7 plan_id: "premium".to_string(),
8 status: "active".to_string(),
9 },
10 user_id: Some("user-987".to_string()),
11 };
12 let _resp = update_subscription(config, params).await?;
13 Ok(())
14}
15

get_tenant_daily_usages Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
year_numberf64Non
month_numberf64Non
day_numberf64Non
skipf64Non

Réponse

Renvoie : GetTenantDailyUsagesResponse

Exemple

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

create_tenant_package Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
create_tenant_package_bodymodels::CreateTenantPackageBodyOui

Réponse

Renvoie : CreateTenantPackageResponse

Exemple

Exemple de create_tenant_package
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = CreateTenantPackageParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 create_tenant_package_body: models::CreateTenantPackageBody {
6 package_name: "Standard".to_string(),
7 package_type: "news/article".to_string(),
8 description: Some("Package for news articles".to_string()),
9 ..Default::default()
10 },
11 };
12 let _response = create_tenant_package(&configuration, params).await?;
13 Ok(())
14}
15

delete_tenant_package Internal Link

Paramètres

NameTypeRequiredDescription
tenant_idStringYes
idStringYes

Réponse

Renvoie : ApiEmptyResponse

Exemple

Exemple delete_tenant_package
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = DeleteTenantPackageParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "premium-plan".to_string(),
6 force: Some(true),
7 };
8 delete_tenant_package(&configuration, params).await?;
9 Ok(())
10}
11

get_tenant_package Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui

Réponse

Renvoie : GetTenantPackageResponse

Exemple

Exemple get_tenant_package
Copy Copy
1
2async fn example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetTenantPackageParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article".to_string(),
6 };
7 let _response: GetTenantPackageResponse = get_tenant_package(configuration, params).await?;
8 Ok(())
9}
10

get_tenant_packages Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
skipf64Non

Réponse

Retourne : GetTenantPackagesResponse

Exemple

get_tenant_packages Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetTenantPackagesParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 skip: Some(5.0),
6 };
7 let _resp = get_tenant_packages(&config, params).await?;
8 Ok(())
9}
10

replace_tenant_package Internal Link


Paramètres

NomTypeRequisDescription
tenant_idStringOui
idStringOui
replace_tenant_package_bodymodels::ReplaceTenantPackageBodyOui

Réponse

Renvoie: ApiEmptyResponse

Exemple

replace_tenant_package Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = ReplaceTenantPackageParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article".to_string(),
6 replace_tenant_package_body: models::ReplaceTenantPackageBody {
7 package_id: "premium-plan".to_string(),
8 enabled: true,
9 description: Some("Premium package for high traffic".to_string()),
10 },
11 };
12 replace_tenant_package(&configuration, params).await?;
13 Ok(())
14}
15

update_tenant_package Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
idStringYes
update_tenant_package_bodymodels::UpdateTenantPackageBodyYes

Réponse

Renvoie : ApiEmptyResponse

Exemple

Exemple de update_tenant_package
Copy Copy
1
2async fn run_update(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let body = models::UpdateTenantPackageBody {
4 plan: Some("enterprise".to_string()),
5 renewal_date: Some("2024-12-31".to_string()),
6 ..Default::default()
7 };
8 let params = UpdateTenantPackageParams {
9 tenant_id: "acme-corp-tenant".to_string(),
10 id: "pkg-2024".to_string(),
11 update_tenant_package_body: body,
12 };
13 let _: ApiEmptyResponse = update_tenant_package(configuration, params).await?;
14 Ok(())
15}
16

create_tenant_user Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
create_tenant_user_bodymodels::CreateTenantUserBodyOui

Réponse

Retourne : CreateTenantUserResponse

Exemple

Exemple create_tenant_user
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = CreateTenantUserParams {
4 tenant_id: "acme-corp".to_string(),
5 create_tenant_user_body: models::CreateTenantUserBody {
6 email: "john.doe@example.com".to_string(),
7 role: "admin".to_string(),
8 first_name: Some("John".to_string()),
9 last_name: Some("Doe".to_string()),
10 digest_email_frequency: Some(DigestEmailFrequency::Daily),
11 imported_agent_approval_notification_frequency: Some(ImportedAgentApprovalNotificationFrequency::Weekly),
12 ..Default::default()
13 },
14 };
15 let _response: CreateTenantUserResponse = create_tenant_user(&configuration, params).await?;
16 Ok(())
17}
18

delete_tenant_user Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
delete_commentsStringNon
comment_delete_modeStringNon

Réponse

Retourne : ApiEmptyResponse

Exemple

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

get_tenant_user Internal Link

Paramètres

NameTypeRequiredDescription
tenant_idStringYes
idStringYes

Réponse

Renvoie : GetTenantUserResponse

Exemple

Exemple get_tenant_user
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let config = configuration::Configuration::default();
4 let params = GetTenantUserParams {
5 tenant_id: "acme-corp-tenant".into(),
6 id: "user-42".into(),
7 };
8 let _response = get_tenant_user(&config, params).await?;
9 Ok(())
10}
11

get_tenant_users Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
skipf64Non

Réponse

Renvoie : GetTenantUsersResponse

Exemple

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

replace_tenant_user Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
idStringYes
replace_tenant_user_bodymodels::ReplaceTenantUserBodyYes
update_commentsStringNo

Réponse

Renvoie : ApiEmptyResponse

Exemple

Exemple replace_tenant_user
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = ReplaceTenantUserParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "user-12345".to_string(),
6 replace_tenant_user_body: ReplaceTenantUserBody::default(),
7 update_comments: Some("Update user role".to_string()),
8 };
9 replace_tenant_user(&configuration, params).await?;
10 Ok(())
11}
12

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
redirect_urlStringNon

Réponse

Retourne: ApiEmptyResponse

Exemple

Exemple send_login_link
Copy Copy
1
2async fn run_example(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = SendLoginLinkParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article".to_string(),
6 redirect_url: Some("https://acme.com/after-login".to_string()),
7 };
8 send_login_link(config, params).await?;
9 Ok(())
10}
11

update_tenant_user Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
idStringYes
update_tenant_user_bodymodels::UpdateTenantUserBodyYes
update_commentsStringNo

Réponse

Renvoie : ApiEmptyResponse

Exemple

Exemple update_tenant_user
Copy Copy
1
2async fn run_example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = UpdateTenantUserParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "user-9876".to_string(),
6 update_tenant_user_body: models::UpdateTenantUserBody {
7 email: "jane.doe@example.com".to_string(),
8 role: "editor".to_string(),
9 },
10 update_comments: Some("Promoted to editor".to_string()),
11 };
12 let _ = update_tenant_user(configuration, params).await?;
13 Ok(())
14}
15

create_tenant Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
create_tenant_bodymodels::CreateTenantBodyOui

Réponse

Renvoie : CreateTenantResponse

Exemple

Exemple create_tenant
Copy Copy
1
2async fn example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let create_body = models::CreateTenantBody {
4 name: "Acme Corp".into(),
5 domain: ApiDomainConfiguration {
6 domain_name: "acme.example.com".into(),
7 ..Default::default()
8 },
9 imported_site_type: Some(ImportedSiteType::NewsArticle),
10 billing_info: Some(BillingInfo {
11 plan: "enterprise".into(),
12 ..Default::default()
13 }),
14 ..Default::default()
15 };
16 let params = CreateTenantParams {
17 tenant_id: "acme-corp-tenant".to_string(),
18 create_tenant_body: create_body,
19 };
20 let _response: CreateTenantResponse = create_tenant(configuration, params).await?;
21 Ok(())
22}
23

delete_tenant Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
sureStringNon

Réponse

Renvoie : ApiEmptyResponse

Exemple

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

get_tenant Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
idStringYes

Réponse

Renvoie : GetTenantResponse

Exemple

Exemple get_tenant
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetTenantParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "news/article".to_string(),
6 include_billing: Some(true),
7 };
8 let _response: GetTenantResponse = get_tenant(&configuration, params).await?;
9 Ok(())
10}
11

get_tenants Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
metaStringNon
skipf64Non

Réponse

Retourne : GetTenantsResponse

Exemple

Exemple get_tenants
Copy Copy
1
2async fn example(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetTenantsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 meta: Some("news/article".to_string()),
6 skip: Some(10.0),
7 };
8 let _response = get_tenants(config, params).await?;
9 Ok(())
10}
11

update_tenant Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
update_tenant_bodymodels::UpdateTenantBodyOui

Réponse

Retourne : ApiEmptyResponse

Exemple

Exemple de update_tenant
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = UpdateTenantParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "tenant-001".to_string(),
6 update_tenant_body: UpdateTenantBody {
7 description: Some("Primary tenant for Acme Corp".to_string()),
8 ..Default::default()
9 },
10 };
11 let _ = update_tenant(&configuration, params).await?;
12 Ok(())
13}
14

change_ticket_state Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
user_idStringYes
idStringYes
change_ticket_state_bodymodels::ChangeTicketStateBodyYes

Réponse

Renvoie : ChangeTicketStateResponse

Exemple

Exemple change_ticket_state
Copy Copy
1
2async fn example(config: &configuration::Configuration) -> Result<(), Error> {
3 let body = models::ChangeTicketStateBody {
4 state: Some("closed".to_string()),
5 comment: Some("Issue resolved".to_string()),
6 };
7 let params = ChangeTicketStateParams {
8 tenant_id: "acme-corp-tenant".to_string(),
9 user_id: "user-1234".to_string(),
10 id: "ticket-5678".to_string(),
11 change_ticket_state_body: body,
12 };
13 let _response: ChangeTicketStateResponse = change_ticket_state(config, params).await?;
14 Ok(())
15}
16

create_ticket Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
user_idStringOui
create_ticket_bodymodels::CreateTicketBodyOui

Réponse

Renvoie : CreateTicketResponse

Exemple

Exemple create_ticket
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let body = models::CreateTicketBody {
4 title: "Login Issue".to_string(),
5 description: "User cannot log in after password reset".to_string(),
6 priority: Some("high".to_string()),
7 };
8 let params = CreateTicketParams {
9 tenant_id: "acme-corp-tenant".to_string(),
10 user_id: "user-12345".to_string(),
11 create_ticket_body: body,
12 };
13 let _response: CreateTicketResponse = create_ticket(&configuration, params).await?;
14 Ok(())
15}
16

get_ticket Internal Link

Paramètres

NameTypeRequiredDescription
tenant_idStringYes
idStringYes
user_idStringNo

Réponse

Renvoie : GetTicketResponse

Exemple

Exemple get_ticket
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = GetTicketParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "ticket-456".to_string(),
6 user_id: Some("user-123".to_string()),
7 };
8 let _response: GetTicketResponse = get_ticket(&configuration, params).await?;
9 Ok(())
10}
11

get_tickets Internal Link

Paramètres

NameTypeRequiredDescription
tenant_idStringYes
user_idStringNo
statef64No
skipf64No
limitf64No

Réponse

Renvoie : GetTicketsResponse

Exemple

Exemple get_tickets
Copy Copy
1
2async fn fetch_tickets(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetTicketsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 user_id: Some("user-12345".to_string()),
6 state: Some(1.0),
7 skip: Some(0.0),
8 limit: Some(20.0),
9 };
10 let _response: GetTicketsResponse = get_tickets(configuration, params).await?;
11 Ok(())
12}
13

get_translations Internal Link

Paramètres

NomTypeObligatoireDescription
namespaceStringOui
componentStringOui
localeStringNon
use_full_translation_idsboolNon

Réponse

Renvoie : GetTranslationsResponse

Exemple

Exemple get_translations
Copy Copy
1
2async fn fetch_translations() -> Result<(), Error> {
3 let params = GetTranslationsParams {
4 namespace: "acme-corp-tenant".to_string(),
5 component: "news/article".to_string(),
6 locale: Some("en-US".to_string()),
7 use_full_translation_ids: Some(true),
8 };
9 let _response: GetTranslationsResponse = get_translations(&configuration, params).await?;
10 Ok(())
11}
12

upload_image Internal Link

Téléverser et redimensionner une image

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
filestd::path::PathBufOui
size_presetmodels::SizePresetNon
url_idStringNon

Réponse

Renvoie : UploadImageResponse

Exemple

upload_image Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = UploadImageParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 file: std::path::PathBuf::from("/tmp/photo.jpg"),
6 size_preset: Some(models::SizePreset::Medium),
7 url_id: Some("news/article".to_string()),
8 };
9 let _response = upload_image(&configuration, params).await?;
10 Ok(())
11}
12

get_user_badge_progress_by_id Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
idStringYes

Réponse

Retourne : ApiGetUserBadgeProgressResponse

Exemple

get_user_badge_progress_by_id Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetUserBadgeProgressByIdParams {
4 tenant_id: "acme-corp".to_string(),
5 id: "user-12345".to_string(),
6 };
7 let _response = get_user_badge_progress_by_id(&configuration, params).await?;
8 Ok(())
9}
10

get_user_badge_progress_by_user_id Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
user_idStringYes

Réponse

Retourne : ApiGetUserBadgeProgressResponse

Exemple

Exemple get_user_badge_progress_by_user_id
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let config = configuration::Configuration::default();
4 let params = GetUserBadgeProgressByUserIdParams {
5 tenant_id: "acme-corp-tenant".to_string(),
6 user_id: "user-9876".to_string(),
7 };
8 let _response = get_user_badge_progress_by_user_id(&config, params).await?;
9 Ok(())
10}
11

get_user_badge_progress_list Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
user_idStringNon
limitf64Non
skipf64Non

Réponse

Renvoie : ApiGetUserBadgeProgressListResponse

Exemple

Exemple get_user_badge_progress_list
Copy Copy
1
2async fn fetch_badge_progress(conf: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetUserBadgeProgressListParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 user_id: Some("user-98765".to_string()),
6 limit: Some(20.0),
7 skip: Some(5.0),
8 };
9 let _resp = get_user_badge_progress_list(conf, params).await?;
10 Ok(())
11}
12

create_user_badge Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
create_user_badge_paramsmodels::CreateUserBadgeParamsOui

Réponse

Renvoie : ApiCreateUserBadgeResponse

Exemple

Exemple create_user_badge
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = CreateUserBadgeParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 create_user_badge_params: models::CreateUserBadgeParams {
6 badge_type: "premium".to_string(),
7 user_id: "user-123".to_string(),
8 description: Some("Top contributor".to_string()),
9 expires_at: None,
10 },
11 };
12 let _response = create_user_badge(&configuration, params).await?;
13 Ok(())
14}
15

delete_user_badge Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui

Réponse

Renvoie : ApiEmptySuccessResponse

Exemple

delete_user_badge Exemple
Copy Copy
1
2async fn remove_badge(config: &configuration::Configuration) -> Result<(), Error> {
3 let params: DeleteUserBadgeParams = DeleteUserBadgeParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "badge-abcde".to_string(),
6 };
7 let _ = delete_user_badge(config, params).await?;
8 Ok(())
9}
10

get_user_badge Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui

Réponse

Renvoie : ApiGetUserBadgeResponse

Exemple

Exemple get_user_badge
Copy Copy
1
2async fn fetch_badge() -> Result<(), Error> {
3 let params = GetUserBadgeParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "badge-42".to_string(),
6 };
7 let _response: ApiGetUserBadgeResponse = get_user_badge(&configuration, params).await?;
8 Ok(())
9}
10

get_user_badges Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
user_idStringNo
badge_idStringNo
displayed_on_commentsboolNo
limitf64No
skipf64No

Réponse

Renvoie : ApiGetUserBadgesResponse

Exemple

Exemple get_user_badges
Copy Copy
1
2async fn fetch_badges(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetUserBadgesParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 user_id: Some("user-12345".to_string()),
6 badge_id: Some("top-commenter".to_string()),
7 displayed_on_comments: Some(true),
8 limit: Some(50.0),
9 skip: Some(0.0),
10 };
11 let _response = get_user_badges(configuration, params).await?;
12 Ok(())
13}
14

update_user_badge Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
update_user_badge_paramsmodels::UpdateUserBadgeParamsOui

Réponse

Retourne : ApiEmptySuccessResponse

Exemple

update_user_badge Exemple
Copy Copy
1
2async fn example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = UpdateUserBadgeParams {
4 tenant_id: "acme-corp".to_string(),
5 id: "user-42".to_string(),
6 update_user_badge_params: models::UpdateUserBadgeParams {
7 badge_name: "contributor".to_string(),
8 expires_at: Some("2025-12-31T23:59:59Z".to_string()),
9 },
10 };
11 let _resp = update_user_badge(configuration, params).await?;
12 Ok(())
13}
14

get_user_notification_count Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
ssoStringNon

Réponse

Renvoie : GetUserNotificationCountResponse

Exemple

Exemple get_user_notification_count
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetUserNotificationCountParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 sso: Some("user-sso-token".to_string()),
6 };
7 let response = get_user_notification_count(&config, params).await?;
8 println!("{:?}", response);
9 Ok(())
10}
11

get_user_notifications Internal Link

Paramètres

NameTypeRequiredDescription
tenant_idStringOui
url_idStringNon
page_sizei32Non
after_idStringNon
include_contextboolNon
after_created_ati64Non
unread_onlyboolNon
dm_onlyboolNon
no_dmboolNon
include_translationsboolNon
include_tenant_notificationsboolNon
ssoStringNon

Réponse

Retourne : GetMyNotificationsResponse

Exemple

Exemple get_user_notifications
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetUserNotificationsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: Some("news/article".to_string()),
6 page_size: Some(20),
7 after_id: None,
8 include_context: Some(true),
9 after_created_at: None,
10 unread_only: Some(false),
11 dm_only: Some(false),
12 no_dm: Some(true),
13 include_translations: Some(false),
14 include_tenant_notifications: Some(true),
15 sso: None,
16 };
17 let _resp = get_user_notifications(&config, params).await?;
18 Ok(())
19}
20

reset_user_notification_count Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringYes
ssoStringNo

Réponse

Renvoie : ResetUserNotificationsResponse

Exemple

reset_user_notification_count Exemple
Copy Copy
1
2async fn run_example(config: &configuration::Configuration) -> Result<(), Error> {
3 let params = ResetUserNotificationCountParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 sso: Some("john.doe".to_string()),
6 };
7 let _response: ResetUserNotificationsResponse = reset_user_notification_count(config, params).await?;
8 Ok(())
9}
10

reset_user_notifications Internal Link

Paramètres

NomTypeRequisDescription
tenant_idStringOui
after_idStringNon
after_created_ati64Non
unread_onlyboolNon
dm_onlyboolNon
no_dmboolNon
ssoStringNon

Réponse

Retourne : ResetUserNotificationsResponse

Exemple

reset_user_notifications Exemple
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = ResetUserNotificationsParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 after_id: Some("notif-12345".to_string()),
6 after_created_at: Some(1_640_995_200),
7 unread_only: Some(true),
8 dm_only: Some(false),
9 no_dm: Some(true),
10 sso: Some("sso-provider".to_string()),
11 };
12 let _response: ResetUserNotificationsResponse =
13 reset_user_notifications(&configuration, params).await?;
14 Ok(())
15}
16

update_user_notification_comment_subscription_status Internal Link

Enable or disable notifications for a specific comment.

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
notification_idStringOui
opted_in_or_outStringOui
comment_idStringOui
ssoStringNon

Réponse

Renvoie : UpdateUserNotificationCommentSubscriptionStatusResponse

Exemple

Exemple de mise à jour du statut d'abonnement aux notifications de commentaire
Copy Copy
1
2async fn run_example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = UpdateUserNotificationCommentSubscriptionStatusParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 notification_id: "comment-reply".to_string(),
6 opted_in_or_out: "opted_in".to_string(),
7 comment_id: "12345".to_string(),
8 sso: Some("user-sso-token".to_string()),
9 };
10 let _response = update_user_notification_comment_subscription_status(configuration, params).await?;
11 Ok(())
12}
13

update_user_notification_page_subscription_status Internal Link

Enable 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 racines, et aussi

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
url_idStringOui
urlStringOui
page_titleStringOui
subscribed_or_unsubscribedStringOui
ssoStringNon

Réponse

Retourne : UpdateUserNotificationPageSubscriptionStatusResponse

Exemple

Exemple de update_user_notification_page_subscription_status
Copy Copy
1
2async fn example() -> Result<UpdateUserNotificationPageSubscriptionStatusResponse, Error> {
3 let params = UpdateUserNotificationPageSubscriptionStatusParams {
4 tenant_id: "acme-corp-tenant".to_owned(),
5 url_id: "news-article-2024".to_owned(),
6 url: "https://news.example.com/articles/rust".to_owned(),
7 page_title: "Rust Dominates the Programming World".to_owned(),
8 subscribed_or_unsubscribed: "subscribed".to_owned(),
9 sso: Some("sso-token-abc".to_owned()),
10 };
11 update_user_notification_page_subscription_status(&configuration, params).await
12}
13

update_user_notification_status Internal Link

Paramètres

NomTypeRequisDescription
tenant_idStringOui
notification_idStringOui
new_statusStringOui
ssoStringNon

Réponse

Retourne : UpdateUserNotificationStatusResponse

Exemple

Exemple de update_user_notification_status
Copy Copy
1
2async fn run_update() -> Result<(), Error> {
3 let params = UpdateUserNotificationStatusParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 notification_id: "news/article".to_string(),
6 new_status: "read".to_string(),
7 sso: Some("sso-token-123".to_string()),
8 };
9 let _response: UpdateUserNotificationStatusResponse =
10 update_user_notification_status(&configuration, params).await?;
11 Ok(())
12}
13

get_user_presence_statuses Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
url_id_wsStringOui
user_idsStringOui

Réponse

Renvoie : GetUserPresenceStatusesResponse

Exemple

get_user_presence_statuses Exemple
Copy Copy
1
2async fn run() -> Result<(), Error> {
3 let params = GetUserPresenceStatusesParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id_ws: "news/article".to_string(),
6 user_ids: "user123,user456".to_string(),
7 };
8 let _response = get_user_presence_statuses(&configuration, params).await?;
9 Ok(())
10}
11

search_users Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
url_idStringOui
username_starts_withStringNon
mention_group_idsVecNon
ssoStringNon
search_sectionStringNon

Réponse

Retourne : SearchUsersResult

Exemple

Exemple search_users
Copy Copy
1
2async fn run_search() -> Result<(), Error> {
3 let params = SearchUsersParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/article".to_string(),
6 username_starts_with: Some("john".to_string()),
7 mention_group_ids: Some(vec!["group1".to_string(), "group2".to_string()]),
8 sso: Some("sso-provider".to_string()),
9 search_section: Some("comments".to_string()),
10 };
11 let _result: SearchUsersResult = search_users(&configuration, params).await?;
12 Ok(())
13}
14

get_user Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui

Réponse

Renvoie : GetUserResponse

Exemple

get_user Exemple
Copy Copy
1
2async fn example(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetUserParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 id: "user-123".to_string(),
6 include_details: Some(true),
7 };
8 let _response = get_user(configuration, params).await?;
9 Ok(())
10}
11

create_vote Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
comment_idStringOui
directionStringOui
user_idStringNon
anon_user_idStringNon

Réponse

Renvoie : VoteResponse

Exemple

create_vote Exemple
Copy Copy
1
2async fn submit_vote() -> Result<(), Error> {
3 let params = CreateVoteParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 comment_id: "news/article/12345".to_string(),
6 direction: "up".to_string(),
7 user_id: Some("user-42".to_string()),
8 anon_user_id: Some("anon-99".to_string()),
9 };
10 let _response = create_vote(&config, params).await?;
11 Ok(())
12}
13

delete_vote Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
idStringOui
edit_keyStringNon

Réponse

Renvoie : VoteDeleteResponse

Exemple

Exemple de delete_vote
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = DeleteVoteParams {
4 tenant_id: "acme-corp".to_string(),
5 id: "vote-12345".to_string(),
6 edit_key: Some("edit-key-abc".to_string()),
7 };
8 let _response: VoteDeleteResponse = delete_vote(&configuration, params).await?;
9 Ok(())
10}
11

get_votes Internal Link

Paramètres

NomTypeRequisDescription
tenant_idStringOui
url_idStringOui

Réponse

Renvoie : GetVotesResponse

Exemple

Exemple get_votes
Copy Copy
1
2async fn fetch_votes(configuration: &configuration::Configuration) -> Result<(), Error> {
3 let params = GetVotesParams {
4 tenant_id: "acme-corp-tenant".to_string(),
5 url_id: "news/article".to_string(),
6 limit: Some(100),
7 };
8 let _response: GetVotesResponse = get_votes(configuration, params).await?;
9 Ok(())
10}
11

get_votes_for_user Internal Link

Paramètres

NomTypeObligatoireDescription
tenant_idStringOui
url_idStringOui
user_idStringNon
anon_user_idStringNon

Réponse

Renvoie : GetVotesForUserResponse

Exemple

Exemple get_votes_for_user
Copy Copy
1
2async fn example() -> Result<(), Error> {
3 let params = GetVotesForUserParams {
4 tenant_id: "acme-corp".to_string(),
5 url_id: "news/2023/09/awesome-article".to_string(),
6 user_id: Some("user-12345".to_string()),
7 anon_user_id: None,
8 };
9 let _response = get_votes_for_user(&configuration, params).await?;
10 Ok(())
11}
12

Besoin d'aide ?

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

Contribuer

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