dodo_payments 0.1.1

This is Unoffical SDK of dodopayments.com
Documentation
use super::*;
use crate::{client::Handle, operations::list_webhooks::ListWebhooksResponse};
use std::sync::Arc;

pub struct ListWebhooksBuilder {
    pub config: ListWebhooksConfig,
    pub(crate) handle: Arc<Handle>,
}

impl ListWebhooksBuilder {
    pub fn new(handle: Arc<Handle>) -> Self {
        Self {
            handle,
            config: ListWebhooksConfig {
                limit: None,
                iterator: None,
            },
        }
    }

    pub fn limit(mut self, limit: i32) -> Self {
        self.config.limit = Some(limit);
        self
    }

    pub fn iterator(mut self, iterator: String) -> Self {
        self.config.iterator = Some(iterator);
        self
    }

    pub async fn send(self) -> Result<ListWebhooksResponse, crate::errors::Error> {
        Ok(ListWebhooks::orchestrate(self.handle, self.config).await?)
    }
}