google-api-python-client
google-api-python-client copied to clipboard
'alt' Parameter Does Not Work in 'files().get()'
The alt option does not work on files().get(): alt as [json, media or proto] always returns the json metadata format.
There is no error, but it ignores the parameter.
Environment details
- Alpine Linux 3.18.2
- Python 3.11.4
- Pip 23.1.2
- google-api-python-client 2.94.0
Steps to reproduce
- Normally Use the Library;
- After successfully auth and get the file id;
- Use any of the following lines of code to get the file content:
Code example
If You Pass Whatever Accepted Option, The Reponse is Always the Metadata
file = drive.files().get(alt="media", fileId=id).execute()
file = drive.files().get(alt="proto", fileId=id).execute()
file = drive.files().get(alt="json", fileId=id).execute()
The response:
{
"id": "dfjjh1394hf1eijdhf1s",
"kind": "drive#file",
"mimeType": "text/plain",
"name": "Filename"
}
But if You Try a Wrong Option, It Throws the Error as It Should
file = drive.files().get(alt="nonexistante", fileId=id).execute()
The Error:
TypeError: Parameter "alt" value "nonexistante" is not an allowed value in "['json', 'media', 'proto']"