Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
leonard committed Feb 26, 2024
1 parent f8ac22c commit 9daa5f2
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/effects/effects_for_account_request.rs
Original file line number Diff line number Diff line change
@@ -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()

Check failure on line 28 in src/effects/effects_for_account_request.rs

View workflow job for this annotation

GitHub Actions / Build and test Stellar SDK

no method named `unwrap` found for struct `EffectsForAccountRequest` in the current scope
/// .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
Expand Down
31 changes: 31 additions & 0 deletions src/effects/effects_for_liquidity_pools_request.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 9daa5f2

Please sign in to comment.