revai 0.7.0

A fully generated & opinionated API client for the Rev.ai API.
Documentation
use crate::{ClientResult, Response};

#[async_trait::async_trait]
pub trait JobOps {
    /// Send a plain text email.
    ///
    /// This is a nicer experience than using `post`.
    async fn post(&self, b: bytes::Bytes) -> ClientResult<Response<crate::types::Job>>;
}

#[async_trait::async_trait]
impl JobOps for crate::jobs::Jobs {
    /// Create a job.
    async fn post(&self, b: bytes::Bytes) -> ClientResult<Response<crate::types::Job>> {
        let url = self.client.url("/jobs", None);
        let form = reqwest::multipart::Form::new()
            .part(
                "media",
                reqwest::multipart::Part::bytes(b.to_vec())
                    .mime_str("video/mp4")
                    .unwrap()
                    .file_name("testing.mp4"),
            )
            .text("options", "{}");

        self.client.post_form(&url, form).await
    }
}