args-api 0.1.0

Shared API contract types and endpoint definitions for args.
Documentation
use serde::{Deserialize, Serialize};

use crate::{endpoint::Endpoint, resource::RunnerResource};

pub struct CreateRunner;

impl Endpoint for CreateRunner {
    const PATH: &'static str = "/ci/runner/{owner}";
    const METHOD: http::Method = http::Method::POST;

    type Request = CreateRunnerRequest;
    type Response = CreateRunnerResponse;
}

#[derive(ApiRequest, Debug, Serialize, Deserialize)]
pub struct CreateRunnerRequest {
    pub name: String,
    pub owner_type: String,
}

pub type CreateRunnerResponse = RunnerResource;