gdrive v0.2.0 Gdrive

Documentation for Gdrive.

Link to this section Summary

Functions

Copy file or folder to new location

Create an empty file

Create a new folder

Create a new folder under a parent folder

Delete file or folder

Get file/folder detail

List all item in default space

Rename a file or folder

Upload file to google drive

Link to this section Functions

Link to this function copy(id, new_folder_id, opts \\ [])

Copy file or folder to new location

Parameters

  • id: file id or folder id
  • new_folder_id: new parent folder id

Examples

Gdrive.copy("aKDnadYQsdfPD", "sIkasWEdENsdEPN")
Link to this function create(name, opts \\ [])

Create an empty file

Parameters

  • name: file name

Examples

Gdrive.create("Hello.txt")

You can create file under a folder

Examples

Gdrive.create("hello.txt", parents: ["parent_folder_ids"])
Link to this function create_folder(name)

Create a new folder

Parameters

  • name: folder name

Examples

Gdrive.create_folder("secret")
Link to this function create_folder(name, parent_id)

Create a new folder under a parent folder

Link to this function delete(id, opts \\ [])

Delete file or folder

Parameters

  • id: file id or folder id

Examples

Gdrive.delete("aKDnadYQsdfPD")
Link to this function get(id, opts \\ [])

Get file/folder detail

Parameters

  • id: file id or folder id

Examples

Gdrive.get("aKDnadYQsdfPD")
Link to this function list(query, opts \\ [])

List all item in default space

Parameters

Examples

Gdrive.list("name='hello.txt'")
Link to this function rename(id, new_name, opts \\ [])

Rename a file or folder

Parameters

  • id: file id or folder id
  • new_name: new file or folder name

Examples

Gdrive.rename("aKDnadYQsdfPD", "new folder")
Link to this function upload(path, opts \\ [])

Upload file to google drive

You can upload to a specific folder, similar to Gdrive.File.create

Parameters

  • path: path to local file

Examples

Gdrive.upload("/user/test/Hello.txt", name: "goodbye.txt")