Method Signature
Parameters
ListFilesConfig
Optional configuration for the list request.Available options:
page_size: Number of files per page (default varies)page_token: Token for fetching a specific pagehttp_options: Custom HTTP request options
Returns
Pager[File]
A Pager object that automatically handles pagination.When you iterate over the pager, it automatically fetches additional pages as needed.Each File in the pager contains:
name: Resource nameuri: URI for API callsdisplay_name: Human-readable namemime_type: File typesize_bytes: File sizecreate_time: Upload timeexpiration_time: When the file expiresstate: Processing state
Examples
List All Files
List with Page Size
Count Total Files
Filter Active Files
List by File Type
Calculate Total Storage
List Files Expiring Soon
Async List
Export File List to JSON
Find Specific File
List and Delete Old Files
Display File Summary
Manual Pagination
Pagination
The
list() method returns a Pager that automatically handles pagination. You can iterate over it directly without worrying about page tokens.The pager fetches additional pages automatically as you iterate through the results.Error Handling
API Availability
Related Methods
- files.upload - Upload a new file
- files.get - Get file metadata
- files.delete - Delete a file