drive icon indicating copy to clipboard operation
drive copied to clipboard

Add Support For Team Drives

Open markmandel opened this issue 8 years ago • 19 comments

Starting this issue to discuss how drive can support Team Drives, so that work can be started on

For reference, the Team Drives API: https://developers.google.com/drive/v3/reference/teamdrives

My current idea is to make it part of drive init which asks you if you want to sync the current directory with your personal Drive folder, or to choose a Team Drive (list all available) to sync.

This is then stores the team drive id in the .gd folder somewhere, and is subsequently checked for, and utilised when performing drive functionality, such as listing, getting etc.

What do you think of that idea?

markmandel avatar May 25 '17 17:05 markmandel

Hello there @markmandel, thank you for the feature request and welcome to drive!

Firstly my apologies for the late reply, I've been working on a bunch of other projects.

Interesting, I haven't yet used teamDrives and btw drive is still using the drive/v2 API, I haven't yet had enough time to move to drive/v3 but let me read through the docs.

I wonder: a) In regards to your suggestion of storing the drive id in the .gd folder, is a user allowed to have more than one teamDrive? -- if so then storing the id in the .gd folder or the local DB might not work well. b) Perhaps for teamDrive folders instead of explicitly making them as teamDrives, we could store a special marker in the folder or easier when doing resolution by folder, we can readily get the information for Google Drive's remote API and then switch to using teamDrive endpoints -- this is what happens currently for remote resolution, search first by path and that then we map to a fileId.

However, am looking at this issue without much knowledge about teamDrives nor about the drive/v3 API. I'll study the drive/v3 API and then sound less ignorant :)

odeke-em avatar May 27 '17 19:05 odeke-em

No worries - we all have other things going on :)

As per API versions - I'm also wondering if this work would need to be predicated by a move to the v3 API (a non substantial piece of work, I'm sure).

a) Yes, a person can have more than one team drive. I currently have around 10. b) This may be easier.

Another option may be when you drive ls the root of your gdrive directory - we query both the list of your folders, and then also query the team drive api, and list one after the other - so that there doesn't need to be a seperation between the two. These could be delineated by a marker (*?) and interleaved or a horizontal line, depending on what works best.

I'm not particularly wedded to either approach. I'm leaning toward this one, as it means you don't have to init new drive folders for each team drive, which would be a plus.

markmandel avatar May 30 '17 17:05 markmandel

I don't know much about the drive API, but it looks to me that v2 does support team drives

https://developers.google.com/drive/v2/reference/teamdrives https://developers.google.com/drive/v2/reference/files/list

streaps avatar Aug 09 '17 19:08 streaps

https://developers.google.com/drive/v2/web/enable-teamdrives

streaps avatar Aug 09 '17 19:08 streaps

My apologies for the late reply, @chevillet just brought this to my attention. In deed, drive/v2 supports team drives and some weeks back I read through the documentation. I'll see about implementing this over the weekend, or anyone else too is welcome to help out.

odeke-em avatar Nov 23 '17 07:11 odeke-em

I just noticed the help-wanted label - how can I help? Happy to test or write documentation not very familiar with Go or the code base.

maxwell-k avatar Nov 23 '17 22:11 maxwell-k

Hello there @maxwell-k, welcome to drive and thank you very much for volunteering, this is awesome!

No worries about not being familiar with Go or the code base, I too started with the same remark for the original repo before making this fork, and I went through the features then picked up: this repo is proof that anyone can pick up Go and Google Drive APIs :)

So team-drives are quite involved but the APIs are documented at:

  • drive/v2 https://godoc.org/google.golang.org/api/drive/v2

Otherwise, overall the repo could definitely use your help. As you requested, there are some open issues marked with label documentation https://github.com/odeke-em/drive/issues?q=is%3Aopen+is%3Aissue+label%3Adocumentation.

Please feel free to whet your appetite and for anything that you notice or would like to tweak, it's all yours to change :)

odeke-em avatar Nov 23 '17 23:11 odeke-em

Hi, the last update on this was a year ago - was there any progress since? Is the API substantially different, or e.g. pulling by ID could work ?

kubaraczkowski avatar Jan 22 '19 14:01 kubaraczkowski

I changed roles before I had time to make useful progress. I no longer have a use case for drive with team drives.

maxwell-k avatar Jan 22 '19 16:01 maxwell-k

If I understand correctly, you won't develop further as the need is gone rather than that you don't have access to Team Drives anymore?

Is there anyone else on the team that could help? From your reading of the docs - was the TeamDrive API substantially different, or should it mostly be an extension of what's already available in drive?

On Tue, 22 Jan 2019 at 17:59, Keith Maxwell [email protected] wrote:

I changed roles before I had time to make useful progress. I no longer have a use case for drive with team drives.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/odeke-em/drive/issues/913#issuecomment-456477014, or mute the thread https://github.com/notifications/unsubscribe-auth/AAh2nOWZf_RmODxrXUHOu4rYZUgzXGGzks5vF0N3gaJpZM4NmoXL .

kubaraczkowski avatar Jan 23 '19 07:01 kubaraczkowski

That's right. I think it would mostly be an extension.

To avoid any confusion; I am not a part of the team here, just a former user.

maxwell-k avatar Jan 25 '19 15:01 maxwell-k

OK, got it. Anyone from the team to answer perhaps?

As far as I understand the API you mostly need to declare that the app supports teamdrives and then "standard" methods of creating/pulling files should work. The difference is mostly in handling permissions and so on. So for instance PyDrive added the support by mostly adding "supportsTeamDrive"=True in places.

On Fri, 25 Jan 2019 at 16:33, Keith Maxwell [email protected] wrote:

That's right. I think it would mostly be an extension.

To avoid any confusion; I am not a part of the team here, just a former user.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/odeke-em/drive/issues/913#issuecomment-457611637, or mute the thread https://github.com/notifications/unsubscribe-auth/AAh2nHCWipT2aXyg7DyvVndWrIVGqdSwks5vGyPfgaJpZM4NmoXL .

kubaraczkowski avatar Jan 25 '19 16:01 kubaraczkowski

I can add a team drive to anyone's account who is willing to work on adding teamdrive support.

Cyber5imon avatar Apr 06 '19 20:04 Cyber5imon

@SPDurkee Hi Simon, I'm willing to work on adding teamdrive support.

jwinarske-pwc avatar Oct 18 '19 00:10 jwinarske-pwc

Hi,

I was looking into this today. Some updates which may be of importance:

  1. Team Drives are now called Shared Drives (not to be confused with Shared Folders)
  2. The v2 API has two parameters for accessing items on Shared Drives called supportsAllDrives and includeItemsFromAllDrives https://developers.google.com/drive/api/v2/enable-shareddrives
  3. The parameters listed in (2) are scheduled to be obsoleted on June 1, 2020: "Note: The supportsAllDrives parameter will be valid until June 1, 2020. After June 1, 2020, all applications will be assumed to support shared drives." "Note: After June 1, 2020, the includeItemsFromAllDrives parameter will be ignored and shared drive items will be returned in the results."
  4. Based on my reading of the notices in (3), the contents of Shared Drives will be exposed to all applications after June 1, 2020, whether they support it or not.
  5. If "drive" does not explicitly add Shared Drives support by June 1, unexpected behavior may result on accounts with Shared Drives.

jlick avatar May 07 '20 19:05 jlick

I'm also looking forward for shared drives support

lpanebr avatar Oct 22 '20 18:10 lpanebr

Hi there! Any updates? 😉

dobeerman avatar Apr 26 '21 07:04 dobeerman

This might as well be a "hey babe, are you awake?" message in the middle of the night, but I had just found out about this program, and this is what I want to use the program for. And yea, I'd really love for this feature implemented. S-so... any updates? Thanks!

whinee avatar Jul 15 '22 05:07 whinee

@whinee I gave up on it after waiting years with still no sign of the feature.

Rclone does work with shared drives, so these days I just use that instead.

erayd avatar Jul 15 '22 06:07 erayd