Skip to main content

Module api

Module api 

Source
Expand description

Docs v1 API façade — typed wrappers over the endpoints the CLI needs, mirroring crate::drive::sheets::api::SheetsApi’s shape.

Free build_*_url functions take a literal base_url so they are unit-testable without a client, exactly like sheets/api.rs’s and files_api.rs’s.

§Why there is no fields mask

spreadsheets.get is always masked, because unmasked it embeds every cell of every sheet. The mirror-image decision here is the opposite one, and it is deliberate rather than an omission — there is a test pinning it. Three reasons:

  1. A Docs mask cannot be made recursion-safe. A fields mask spells nesting depth out literally, and a table may contain a table to arbitrary depth. Any fixed-depth mask therefore silently drops document text below its deepest named level — partial content indistinguishable from complete content, which is exactly the failure mode MAX_SHEETS_PER_READ refuses rather than tolerates.
  2. It would have to be written twice. With includeTabsContent=true the content lives under tabs.documentTab.body.content…, not body.content…, so the mask’s root depends on a query parameter. Two masks that must agree is two masks that will diverge.
  3. The payload is bounded in a way a spreadsheet’s is not. Google caps a Doc at roughly a million characters, so the worst-case response is large but bounded; a spreadsheet’s cell count has no comparable ceiling.

[MAX_DOCUMENT_BYTES] is the guard that replaces it. If payload size ever does become a problem, a mask belongs on the info path only (which needs a shallow skeleton and no recursion) and must never be applied to read.

Structs§

DocsApi
Docs API façade.

Enums§

SuggestionsViewMode
How the API should render pending suggestions.