Add Drive resource and example.
ClosedPublic

Authored by barchiesi on Jun 16 2019, 12:10 AM.

Details

Summary

Add support for the Drive resource as described in the Google Drive API Reference [1].

[1] https://developers.google.com/drive/api/v2/reference/drives

Test Plan

Test units have been added for the Drive resource operations. An example is included which demonstrates fetching, modifying, hiding Drives.

Diff Detail

Repository
R477 KGAPI Library
Branch
drives
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 12879
Build 12897: arc lint + arc unit
barchiesi created this revision.Jun 16 2019, 12:10 AM
Restricted Application added a project: KDE PIM. · View Herald TranscriptJun 16 2019, 12:10 AM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
barchiesi requested review of this revision.Jun 16 2019, 12:10 AM

In this revision I would like to also include deprecation notices/warnings on the Teamdrive resource, as it is officially deprecated by Google. What is the correct way to do this?

To deprecate an entire class, change its the export macro to KGAPIDRIVE_DEPRECATED_EXPORT. If you want to deprecate just a particular method but not the whole class, prefix its definition with KGAPIDRIVE_DEPRECATED.

barchiesi updated this revision to Diff 59908.Jun 16 2019, 11:21 AM
  • Deprecate Teamdrive fetch/create/modify/delete jobs.

I added KGAPIDRIVE_DEPRECATED_EXPORT to the create/delete/modify/fetch jobs and afterwards all tests and the teamdrive example show warnings. Is that correct? Or should I delete tests/examples?

barchiesi added a subscriber: LibKGAPI.
barchiesi updated this revision to Diff 59911.Jun 16 2019, 12:25 PM

Renamed wrong attributes in Drives::Capabilities.

barchiesi updated this revision to Diff 59935.Jun 16 2019, 4:10 PM
  • Added canCreateDrives attribute to About.
barchiesi updated this revision to Diff 59936.Jun 16 2019, 4:13 PM

Fixing previous edit mistakes (not sure what happened, still trying to understand arc).

dvratil accepted this revision.Jun 17 2019, 12:20 PM

Looks good, thanks a lot!

This revision is now accepted and ready to land.Jun 17 2019, 12:20 PM
  • Deprecate Teamdrive fetch/create/modify/delete jobs.

    I added KGAPIDRIVE_DEPRECATED_EXPORT to the create/delete/modify/fetch jobs and afterwards all tests and the teamdrive example show warnings. Is that correct? Or should I delete tests/examples?

@dvratil My previous edits hid the above question, what do you think about it?

It's fine to leave it in and ignore the warnings - I think there's some way to disable deprecation warnings internally, but I can't find it now.

barchiesi updated this revision to Diff 60092.EditedJun 19 2019, 10:56 PM
  • Silence Team Drive deprecation warnings for examples and tests.

@dvratil this seems like a possible solution, what do you think?

dvratil accepted this revision.Jun 23 2019, 12:03 PM

Nice trick! :)

This revision was automatically updated to reflect the committed changes.

@barchiesi This commit broke the kio-gdrive build (CanCreateTeamDrives no longer existing).

Could you push a fix for that? Thanks!