platypush/plugins/google/drive/__init__.py
def update(self,
               file_id: str,
               name: Optional[str] = None,
               description: Optional[str] = None,
               add_parents: Optional[List[str]] = None,
               remove_parents: Optional[List[str]] = None,
               mime_type: Optional[str] = None,
               starred: bool = None,
               trashed: bool = None) -> GoogleDriveFile:
        """
        Update the metadata or the content of a file.

        :param file_id: File ID.
        :param name: Set the file name.
        :param description: Set the file description.
        :param add_parents: Add the file to these parent folder IDs.
        :param remove_parents: Remove the file from these parent folder IDs.
        :param mime_type: Set the file MIME type.
        :param starred: Change the starred flag.
        :param trashed: Move/remove from trash.
        """
        metadata = {}
        if name:
            metadata['name'] = name
        if description is not None:
            metadata['description'] = description
        if add_parents:
            metadata['add_parents'] = add_parents
        if remove_parents:
            metadata['remove_parents'] = remove_parents
        if mime_type:
            metadata['mimeType'] = mime_type
        if starred is not None:
            metadata['starred'] = starred
        if trashed is not None:
            metadata['trashed'] = trashed

        service = self.get_service()
        file = service.files().update(
            fileId=file_id,
            body=metadata,
            fields='*'
        ).execute()

        return GoogleDriveFile(
            type=file.get('kind').split('#')[1],
            id=file.get('id'),
            name=file.get('name'),
            mime_type=file.get('mimeType'),
        )

        Update the metadata or the content of a file.

        :param file_id: File ID.
        :param name: Set the file name.
        :param description: Set the file description.
        :param add_parents: Add the file to these parent folder IDs.
        :param remove_parents: Remove the file from these parent folder IDs.
        :param mime_type: Set the file MIME type.
        :param starred: Change the starred flag.
        :param trashed: Move/remove from trash.
        
Update the metadata or the content of a file.
Update the metadata or the content of a file .
def update(self,
               file_id: str,
               name: Optional[str] = None,
               description: Optional[str] = None,
               add_parents: Optional[List[str]] = None,
               remove_parents: Optional[List[str]] = None,
               mime_type: Optional[str] = None,
               starred: bool = None,
               trashed: bool = None) -> GoogleDriveFile:
        metadata = {}
        if name:
            metadata['name'] = name
        if description is not None:
            metadata['description'] = description
        if add_parents:
            metadata['add_parents'] = add_parents
        if remove_parents:
            metadata['remove_parents'] = remove_parents
        if mime_type:
            metadata['mimeType'] = mime_type
        if starred is not None:
            metadata['starred'] = starred
        if trashed is not None:
            metadata['trashed'] = trashed
        service = self.get_service()
        file = service.files().update(
            fileId=file_id,
            body=metadata,
            fields='*'
        ).execute()
        return GoogleDriveFile(
            type=file.get('kind').split('#')[1],
            id=file.get('id'),
            name=file.get('name'),
            mime_type=file.get('mimeType'),
        )
def update ( self , file_id : str , name : Optional [ str ] = None , description : Optional [ str ] = None , add_parents : Optional [ List [ str ] ] = None , remove_parents : Optional [ List [ str ] ] = None , mime_type : Optional [ str ] = None , starred : bool = None , trashed : bool = None ) -> GoogleDriveFile : metadata = { } if name : metadata [ 'name' ] = name if description is not None : metadata [ 'description' ] = description if add_parents : metadata [ 'add_parents' ] = add_parents if remove_parents : metadata [ 'remove_parents' ] = remove_parents if mime_type : metadata [ 'mimeType' ] = mime_type if starred is not None : metadata [ 'starred' ] = starred if trashed is not None : metadata [ 'trashed' ] = trashed service = self . get_service ( ) file = service . files ( ) . update ( fileId = file_id , body = metadata , fields = '*' ) . execute ( ) return GoogleDriveFile ( type = file . get ( 'kind' ) . split ( '#' ) [ 1 ] , id = file . get ( 'id' ) , name = file . get ( 'name' ) , mime_type = file . get ( 'mimeType' ) , )
Update the metadata or the content of a file.
Update the metadata or the content of a file .
"""
        Update the metadata or the content of a file.

        :param file_id: File ID.
        :param name: Set the file name.
        :param description: Set the file description.
        :param add_parents: Add the file to these parent folder IDs.
        :param remove_parents: Remove the file from these parent folder IDs.
        :param mime_type: Set the file MIME type.
        :param starred: Change the starred flag.
        :param trashed: Move/remove from trash.
        """
self
file_id
str
None
name
Optional[str]
Set the file name.
Set the file name .
description
Optional[str]
Set the file description.
Set the file description .
add_parents
Optional[List[str]]
Add the file to these parent folder IDs.
Add the file to these parent folder IDs .
remove_parents
Optional[List[str]]
Remove the file from these parent folder IDs.
Remove the file from these parent folder IDs .
mime_type
Optional[str]
Set the file MIME type.
Set the file MIME type .
starred
bool
Change the starred flag.
Change the starred flag .
trashed
bool
Move/remove from trash.
Move / remove from trash .