-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add Google Drive Permissions + Files services #66
base: main
Are you sure you want to change the base?
Conversation
e0052fd
to
9276f9f
Compare
gcp_pilot/drive.py
Outdated
@@ -1,16 +1,55 @@ | |||
# Reference: https://developers.google.com/drive/api/reference/rest/v3 | |||
|
|||
from gcp_pilot.base import GoogleCloudPilotAPI | |||
|
|||
from gcp_pilot.base import DiscoveryMixin, GoogleCloudPilotAPI | |||
|
|||
class Drive(GoogleCloudPilotAPI): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Drive
cannot be used directly, maybe extend from abc.ABC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually it can be used directly. Someone can initialize it and use service.client
, since this class defines the required scope and the service porperly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But without any methods, it's useless, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well kind of, I would say. It might not be recommended to use directly given our coding-style and purpose.. but as I mentioned before it could still be useful for someone who wants to use a non supported Drive service
we have two options - just to make sure their W/S
a) extends from abc: by preventing "standalone" usage of Drive
or
b) do not extends: allow anyone to use Drive freely
I don't have preferences, I’m slightly inclined toward option b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd lean towards (a) to align with gcp-pilot's purpose: friendlier wrapper.
Anyone can still use the Drive if it extends to its own class, just like you are already doing with some resources.
9276f9f
to
fc5fbcf
Compare
fc5fbcf
to
d11f035
Compare
We using a Discovery service we can ensure their calls using `self.mocked_discovery_client`
…ient.discovery.Resource
This client manages file permissions from a given file
d11f035
to
5cfc01f
Compare
@joaodaher PR updated I addressed most of the comments |
This PR adds acouple of Google Drive services to handle basic file operations, such as granting permissions and managing files