Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

License and shared-drive #26

Open
huu4ontocord opened this issue Jul 19, 2021 · 2 comments
Open

License and shared-drive #26

huu4ontocord opened this issue Jul 19, 2021 · 2 comments

Comments

@huu4ontocord
Copy link

Hi, two questions:

Can I assume this is under BSD?

Also, Could we get sharred drive support added? If you give me pointers I can do it and push a PR

https://developers.google.com/drive/api/v3/enable-shareddrives?hl=en

@martindurant
Copy link
Member

License file added in #25 (BSD-2) . It should be references in setup.py, I suppose.
Yes please, do have a stab. I don't know much about shared drives, but I wouldn't expect it to be too tricky. You'd need to decide where there show up - the interface can already list drives (.drives property).

@DahnJ
Copy link

DahnJ commented May 4, 2023

A very rough pointer that will hopefully be helpful to whoever works on implementing this. I don't know the Drive API well, but this is what I got from quickly looking into this.

Many methods in the Drive API simply require you to pass supportsAllDrives=True

For example, calling get (documentation) on line 141 should become

response = self.service.get(
    fileId=file_id, 
    fields=fields,
    supportsAllDrives=True,  # <-
).execute()

In some cases, like with list, you need a few more parameters. For example, line 184 should be

response = self.service.list(
    q=query, 
    spaces=self.spaces, 
    fields=afields, 
    pageToken=page_token,
    driveId=drive_id,                  # <-
    corpora='drive',                   # <-
    includeItemsFromAllDrives=True,    # <-
    supportsAllDrives=True,            # <-
).execute()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants