From 9daa5f2ed34b75c03f7aa81183de5f95ae2c51b4 Mon Sep 17 00:00:00 2001 From: leonard Date: Mon, 26 Feb 2024 11:27:17 +0100 Subject: [PATCH] documentation --- src/effects/effects_for_account_request.rs | 33 +++++++++++++++++++ .../effects_for_liquidity_pools_request.rs | 31 +++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/src/effects/effects_for_account_request.rs b/src/effects/effects_for_account_request.rs index 22b24ec..a6db301 100644 --- a/src/effects/effects_for_account_request.rs +++ b/src/effects/effects_for_account_request.rs @@ -1,5 +1,38 @@ use crate::{models::{Order, Request}, BuildQueryParametersExt}; +/// Represents the request to fetch effects for a specific account from the Horizon API. +/// +/// `EffectsForAccountRequest` is a struct used to construct queries for retrieving information about effects +/// from the Horizon server. It includes parameters that allow for pagination control and sorting +/// of the effect records. +/// +/// # Usage +/// Instances of `EffectsForAccountRequest` are created and optionally configured using the builder pattern. +/// Once the desired parameters are set, the request can be passed to the Horizon client to fetch +/// effect data. +/// +/// # Fields +/// * `account_id` - The account's public id. +/// * `cursor` - A pointer to a specific location in a collection of responses, derived from the +/// * `limit` - Specifies the maximum number of records to be returned in a single response. +/// * `order` - Determines the [`Order`] of the records in the response. Valid options are [`Order::Asc`] (ascending) +/// +/// # Example +/// ```rust +/// use stellar_rs::effects::effects_for_account_request::EffectsForAccountRequest; +/// use stellar_rs::models::*; +/// +/// let request = EffectsForAccountRequest::new() +/// .set_account_id("GBL3QJ2MB3KJ7YV7YVXJ5ZL5V6Z5ZL5V6Z5ZL5V6Z5ZL5V6Z5ZL5V6Z".to_string()) +/// .unwrap() +/// .set_cursor(1234).unwrap() +/// .set_limit(20).unwrap() +/// .set_order(Order::Desc); +/// +/// // The request can now be used with a Horizon client to fetch effects. +/// ``` +/// + #[derive(Default)] pub struct EffectsForAccountRequest { /// The accounts public id diff --git a/src/effects/effects_for_liquidity_pools_request.rs b/src/effects/effects_for_liquidity_pools_request.rs index c975519..1f695d9 100644 --- a/src/effects/effects_for_liquidity_pools_request.rs +++ b/src/effects/effects_for_liquidity_pools_request.rs @@ -1,6 +1,37 @@ use crate::models::{Order, Request}; use crate::BuildQueryParametersExt; +/// Represents the request to fetch effects for a specific liquidity pool from the Horizon API. + +/// `EffectsForLiquidityPoolRequest` is a struct used to construct queries for retrieving information about effects +/// from the Horizon server. It includes parameters that allow for pagination control and sorting +/// of the effect records. + +/// # Usage +/// Instances of `EffectsForLiquidityPoolRequest` are created and optionally configured using the builder pattern. +/// Once the desired parameters are set, the request can be passed to the Horizon client to fetch +/// effect data. +/// +/// # Fields +/// * `liquidity_pool_id` - The liquidity pool id. +/// * `cursor` - A pointer to a specific location in a collection of responses, derived from the +/// `paging_token` value of a record. Used for pagination control in the API response. +/// * `limit` - Specifies the maximum number of records to be returned in a single response. +/// +/// # Example +/// ```rust +/// use stellar_rs::effects::effects_for_liquidity_pools_request::EffectsForLiquidityPoolRequest; +/// use stellar_rs::models::*; +/// +/// let request = EffectsForLiquidityPoolRequest::new() +/// .set_liquidity_pool_id("01c58ab8fb283c8b083a26bf2fe06b7b6c6304c13f9d29d956cdf15a48bea72d".to_string()) +/// .set_cursor(1234).unwrap() +/// .set_limit(20).unwrap() +/// .set_order(Order::Desc); +/// +/// // The request can now be used with a Horizon client to fetch effects. +/// ``` +/// #[derive(Default)] pub struct EffectsForLiquidityPoolRequest { /// The liquidity pool id