Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-pease authored and LeonardTibben committed Jun 14, 2024
1 parent 9b28592 commit 09f8edc
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions stellar_rust_sdk/src/models/response_models.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
use crate::Getters;
use serde::{Deserialize, Serialize};

/// Represents the navigational links in a response.
///
/// Contains the links to the current, next, and previous pages of the response.
///
#[derive(Default, Debug, Deserialize, Serialize, Clone, Getters)]
pub struct ResponseLinks {
#[serde(rename = "self")]
Expand All @@ -9,22 +13,33 @@ pub struct ResponseLinks {
pub prev: Option<Link>,
}

/// Represents a navigational link in a response.
///
/// Contains an optional url.
///
#[derive(Default, Debug, Deserialize, Serialize, Clone, Getters)]
pub struct Link {
pub href: Option<String>,
}

#[derive(Default, Debug, Deserialize, Serialize, Clone, Getters)]
pub struct Embedded<T> {
pub records: Vec<T>,
}

/// Represents a navigational link in a response.
///
/// Contains an optional url, and an optional boolean to indicate whether a link is templated or not.
///
#[derive(Default, Debug, Deserialize, Serialize, Clone, Getters)]
pub struct TemplateLink {
pub href: Option<String>,
pub templated: Option<bool>,
}

/// Represents a collection of results in a response.
///
/// Contains a vector, which can hold any type of record returned by the API.
#[derive(Default, Debug, Deserialize, Serialize, Clone, Getters)]
pub struct Embedded<T> {
pub records: Vec<T>,
}

/// Represents the authorization and control flags for an asset in the all assets response.
///
/// Details the various boolean flags that are
Expand All @@ -45,4 +60,4 @@ pub struct Flags {
/// A `bool` indicating whether the asset supports the clawback operation.
/// If `true`, the issuer can claw back the asset from user accounts.
auth_clawback_enabled: bool,
}
}

0 comments on commit 09f8edc

Please sign in to comment.