Skip to main content

fizzy_sdk/generated/services/
pins.rs

1// Generated by fizzy-sdk-generator from openapi.json and behavior-model.json. DO NOT EDIT.
2
3use crate::client::Scope;
4use crate::error::Error;
5use crate::generated::routes;
6use crate::generated::types::*;
7
8/// The `Pins` operations.
9pub struct PinsService<'a> {
10    scope: Scope<'a>,
11}
12
13impl<'a> PinsService<'a> {
14    pub(crate) fn new(scope: Scope<'a>) -> Self {
15        Self { scope }
16    }
17
18    /// The client and account these operations send through.
19    pub fn scope(&self) -> &Scope<'a> {
20        &self.scope
21    }
22
23    /// `ListPins` — `GET /{accountId}/my/pins.json`.
24    ///
25    /// Sent up to 3 times, backing off from 1000 ms, when the answer is 429, 500 or 503.
26    pub async fn list(&self) -> Result<Vec<Card>, Error> {
27        let operation = self.scope.operation(&routes::LIST_PINS, &[])?;
28        self.scope.client().send(operation).await
29    }
30}