Repository navigation
Add a Google Drive template with file content and uploads - #327
Merged
Merged
Conversation
tnkuehne
force-pushed
the
feat/google-drive-template
branch
from
November 23, 2026 01:08
41a6d99 to
3bff403
Compare
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
widefleet-docs | 3c06f40 | Nov 23 2026, 10:35 AM |
tnkuehne
force-pushed
the
feat/google-drive-template
branch
from
November 23, 2026 01:23
3bff403 to
2d42791
Compare
tnkuehne
force-pushed
the
feat/google-drive-template
branch
from
November 23, 2026 01:33
2d42791 to
d59d8b8
Compare
tnkuehne
force-pushed
the
feat/google-drive-template
branch
from
November 23, 2026 01:44
d59d8b8 to
c51628f
Compare
tnkuehne
force-pushed
the
feat/google-drive-template
branch
from
November 23, 2026 02:01
c51628f to
f7055f6
Compare
tnkuehne
force-pushed
the
feat/google-drive-template
branch
from
November 23, 2026 02:25
f7055f6 to
19635bf
Compare
tnkuehne
force-pushed
the
feat/google-drive-template
branch
2 times, most recently
from
November 23, 2026 08:32
246a9a5 to
995e16a
Compare
tnkuehne
force-pushed
the
feat/google-drive-template
branch
from
November 23, 2026 09:16
995e16a to
c7a406c
Compare
tnkuehne
force-pushed
the
feat/google-drive-template
branch
2 times, most recently
from
November 23, 2026 09:33
bcfe4a5 to
37bfec4
Compare
tnkuehne
force-pushed
the
feat/google-drive-template
branch
2 times, most recently
from
November 23, 2026 10:16
17e1197 to
ddf5eb5
Compare
tnkuehne
force-pushed
the
feat/google-drive-template
branch
from
November 23, 2026 10:30
ddf5eb5 to
c624f27
Compare
The new template offers every method of the Google Drive API as a typed method with field selections: files and folders, shared drives, sharing, comments and replies, revisions, approvals and change tracking. The discovery generator now offers file content: methods that read content get a ...Content method that returns it, and exports return it directly. Methods that accept uploads get a ...WithContent method that sends the metadata and the content, as text or base64, in one multipart request. Gmail gains such methods for sending and importing raw MIME messages. The content helpers move into a runtime file that discovery and OpenAPI templates share. Sharing with people, who are emailed by default, and starting an approval count as send; changes ask for approval by each user's level.
A comment on an approval notifies its initiator and reviewers, so it counts as send and asks at the default level.
…en media types A reply can resolve or reopen its comment, so it counts as an update. Discovery rules can let map entries be null where Google documents null as removal, as Drive does for file properties. Upload media types may not contain line breaks anywhere, and a schema named like an import of the generated file stops generation.
tnkuehne
force-pushed
the
feat/google-drive-template
branch
from
November 23, 2026 10:34
c624f27 to
3c06f40
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Google Drive is the file store of most Google Workspace organizations, and no template covers it yet. Unlike Calendar and Sheets, Drive is about file content: downloading, exporting Docs as text or PDF, and uploading. The discovery generator offered only JSON methods, so it needs media support first.
What changes
Google Drive template (
templates/google-drive)filesGetContentandrevisionsGetContentreturn a file's content with itscontentType: astextfor text media types (text/*, JSON, XML), asbase64otherwise, so results stay JSON for apps and MCP.filesExportreturns an exported Google Docs, Sheets or Slides file, for example astext/plainorapplication/pdf.filesCreateWithContentandfilesUpdateWithContentupload metadata and content together.too_large.permissionsCreateissend: it emails the people it shares with unlesssendNotificationEmailis false. Starting an approval issendtoo.filesDownloadstarts a download through a POST and never asks.send.https://www.googleapis.com/auth/drive. Google classifies it as restricted, like Gmail's scopes. An account connected with fewer scopes getspermission_required.template.mddescribes setup, selections, file content and uploads, approvals, results and how to regenerate.More discovery rules
nullableValues: lets map entries be null where Google documents null as removal. Drive uses it forFile.propertiesandFile.appProperties.BinaryContentandUploadContentare reserved type names.Discovery generator: file content
...Content, which addsalt=mediaand returnsBinaryContent. A method without other results, such asfiles.export, returns the content itself....WithContent. It sends the metadata (optional) andcontent: { mimeType, text }or{ mimeType, base64 }as onemultipart/relatedrequest to the upload path.base64must be valid.draftsCreate/Update/SendWithContentandmessagesSend/Insert/ImportWithContent, which send raw MIME messages.BinaryContent,UploadContentand the bounded content reader move fromrest.tsinto a sharedcontent.tsruntime file, which discovery and OpenAPI templates both get.run.tsreturns content results, bounded like JSON responses.Connection page
New page, connected state, with the same approval form as the other templates.
Testing
pnpm check...Content, content-only methods and...WithContentwith their runtime table entries.alt=media, the multipart body for base64 content, and rejected content: missing text or base64, line breaks in the media type, invalid base64.fieldsURLs;send, and replacing content with base64 asking as an update;

Confidence Score: 5/5 
The PR appears safe to merge; no new blocking issue was established.Summary
Adds a Google Drive template with typed methods, file reads, exports, uploads, and per-user approvals.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Typed API call] --> B[Check arguments and build request] B --> C{Approval required?} C -->|Yes| D[Ask the user] D -->|Declined| E[Return declined] D -->|Accepted| F[Load current user's Google token] C -->|No| F F --> G[Send Google request] G --> H{Response kind} H -->|JSON| I[Return selected fields] H -->|Content| J[Read up to 8 MiB] J --> K[Return text or base64]Reviews (17) · Last reviewed commit: "Send upload text as UTF-8 only and other..." · Reviewed by Greptile