ig_client/application/interfaces/operations.rs
1/******************************************************************************
2 Author: Joaquín Béjar García
3 Email: jb@taunais.com
4 Date: 8/3/26
5******************************************************************************/
6
7//! Operations service interface for IG Markets API
8//!
9//! This module defines the interface for managing API application operations,
10//! including retrieving application details and disabling API keys.
11
12use crate::error::AppError;
13use crate::model::responses::{ApplicationDetailsResponse, StatusResponse};
14use async_trait::async_trait;
15
16/// Service for managing API application operations in the IG Markets API
17///
18/// This service provides methods for retrieving API application details
19/// and managing API key status.
20#[async_trait]
21pub trait OperationsService: Send + Sync {
22 /// Returns a list of client-owned applications
23 ///
24 /// # Returns
25 /// * `Ok(ApplicationDetailsResponse)` - Details of all client applications
26 /// * `Err(AppError)` - If the request fails
27 async fn get_client_apps(&self) -> Result<ApplicationDetailsResponse, AppError>;
28
29 /// Disables the current application key
30 ///
31 /// Disables the current application key from processing further requests.
32 /// Disabled keys may be re-enabled via the My Account section on
33 /// the IG Web Dealing Platform.
34 ///
35 /// # Returns
36 /// * `Ok(StatusResponse)` - The disable operation status
37 /// * `Err(AppError)` - If the request fails
38 async fn disable_client_app(&self) -> Result<StatusResponse, AppError>;
39}