Field masks
Many Google REST APIs accept a fields parameter. It asks Google to return only the response fields needed by the caller.
Use it whenever an agent or script needs a small, predictable payload:
gum read drive.files.list \
--args '{"pageSize":10,"fields":"files(id,name,mimeType),nextPageToken"}' \
--output jsonField masks run upstream at Google. That makes them different from local output formatting: omitted fields are never downloaded by gum for that request.
Pattern
- Run
gum describe <op_id>to check the operation and example arguments. - Start with the smallest field list that can answer the task.
- Keep pagination tokens when listing resources.
- Use
--output jsonwhen another program will parse the result.
Notes
- Field names come from the Google API response schema, not from gum-specific
- A bad
fieldsexpression is rejected by the upstream API. - Some operations do not support partial response. For those, use gum output
aliases.
shaping after the full response is returned.
