-
Hi, thanks for the great work on the library! I want to create an empty google doc, sheet or presentation in my Folder. I was able to create folders with the below function using the mime type In my python scripts I use: drive.files()
.create(
body={
"name": "name",
"mimeType": "application/vnd.google-apps.document",
"parents": [folder_id],
},
fields="id",
)
.execute() but I see no async fn create_file(
hub: &DriveHub<HttpsConnector<HttpConnector>>,
parent: &str,
name: &str,
mime: &str,
) {
let emptybuf: [u8; 0] = [];
let empty_stream = Cursor::new(&emptybuf);
hub.files()
.create(google_drive3::api::File {
name: Some(name.into()),
mime_type: Some(mime.into()),
parents: Some(vec![parent.into()]),
..Default::default()
})
.param("fields", "id")
.upload(empty_stream.clone(), mime.parse().unwrap())
.await
.expect("Failed to create file");
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
That might be a bug in the generator, or something else, I really don't know. You could try to vendor the code and make the private function public, see if this works. Otherwise, maybe consider using the official Google crates which are now under active development: https://github.com/googleapis/google-cloud-rust . |
Beta Was this translation helpful? Give feedback.
That might be a bug in the generator, or something else, I really don't know. You could try to vendor the code and make the private function public, see if this works.
Otherwise, maybe consider using the official Google crates which are now under active development: https://github.com/googleapis/google-cloud-rust .