uarp-sdk 0.5.6

Async Rust client for the UARP (Snaga) Universal Agent Runtime Platform API
Documentation
// Code generated by @uarp/codegen from spec/openapi.json. DO NOT EDIT.
//!
//! First-time platform setup

#![allow(unused_imports, clippy::too_many_arguments)]

use reqwest::Method;
use serde::{Deserialize, Serialize};

use crate::client::{Client, Request, NO_BODY, NO_QUERY};
use crate::error::Result;
use crate::generated::models;
use crate::multipart::{field_text, FilePart};
use crate::util::encode_path;

/// First-time platform setup
#[derive(Debug, Clone)]
pub struct BootstrapApi {
    pub(crate) client: Client,
}

impl Client {
    /// First-time platform setup
    pub fn bootstrap(&self) -> BootstrapApi {
        BootstrapApi { client: self.clone() }
    }
}

impl BootstrapApi {
    /// Bootstrap the platform (first-time setup)
    ///
    /// `POST /api/v1/bootstrap`
    pub async fn bootstrap(&self, body: &models::BootstrapRequest) -> Result<serde_json::Value> {
        self.client
            .request_json(Request {
                method: Method::POST,
                path: "/api/v1/bootstrap".to_string(),
                query: NO_QUERY,
                body: Some(body),
                headers: Vec::new(),
                idempotent: true,
            })
            .await
    }
}