fizzy-sdk 0.2.4

Official Fizzy API client, generated from the Smithy model in spec/
Documentation
// Generated by fizzy-sdk-generator from openapi.json and behavior-model.json. DO NOT EDIT.

use crate::client::Scope;
use crate::error::Error;
use crate::generated::routes;
use crate::generated::types::*;

/// The `Pins` operations.
pub struct PinsService<'a> {
    scope: Scope<'a>,
}

impl<'a> PinsService<'a> {
    pub(crate) fn new(scope: Scope<'a>) -> Self {
        Self { scope }
    }

    /// The client and account these operations send through.
    pub fn scope(&self) -> &Scope<'a> {
        &self.scope
    }

    /// `ListPins` — `GET /{accountId}/my/pins.json`.
    ///
    /// Sent up to 3 times, backing off from 1000 ms, when the answer is 429, 500 or 503.
    pub async fn list(&self) -> Result<Vec<Card>, Error> {
        let operation = self.scope.operation(&routes::LIST_PINS, &[])?;
        self.scope.client().send(operation).await
    }
}