Create multiple assets concurrently #5

Merged
Quaternions merged 16 commits from staging into master 2024-08-17 18:00:28 +00:00
Showing only changes of commit 99f62d090b - Show all commits

View File

@ -15,8 +15,8 @@ pub struct CreateAssetRequest{
}
#[derive(Debug)]
pub enum CreateError{
ParseError(url::ParseError),
SerializeError(serde_json::Error),
Parse(url::ParseError),
Serialize(serde_json::Error),
Reqwest(reqwest::Error),
}
impl std::fmt::Display for CreateError{
@ -298,9 +298,9 @@ impl CloudContext{
.send().await
}
pub async fn create_asset(&self,config:CreateAssetRequest,body:impl Into<std::borrow::Cow<'static,[u8]>>)->Result<RobloxOperation,CreateError>{
let url=reqwest::Url::parse("https://apis.roblox.com/assets/v1/assets").map_err(CreateError::ParseError)?;
let url=reqwest::Url::parse("https://apis.roblox.com/assets/v1/assets").map_err(CreateError::Parse)?;
let request_config=serde_json::to_string(&config).map_err(CreateError::SerializeError)?;
let request_config=serde_json::to_string(&config).map_err(CreateError::Serialize)?;
let part=reqwest::multipart::Part::bytes(body)
//you must have a file name or roblox will 400!!!!!!!!!