Skip to main content

Module create

Module create 

Source
Expand description

drive docs create engine — creates a Google Doc, optionally seeded with text (issue #1615, ADR-0076 §9).

Owns its verb rather than composing drive create’s public engine, which logs internally and unconditionally — composing it would emit a phantom ["drive","create"] record for a command the user never typed, alongside the docs-create one. Same reasoning as sheets/create.rs.

One of ADR-0073 §11’s arguments is stronger here, and it is worth stating plainly: documents.create accepts only a title and drops the new document in the caller’s My Drive root — it cannot set a parent folder. Since the folder is the write gate’s entire input, going through FilesApi::create is not merely the tidier option, it is the only shape the gate can evaluate at all.

The optional --text seed costs a second documents.get, purely to mint a lease for a document created milliseconds earlier. That round-trip is paid deliberately rather than adding a “we just made it, nobody can have touched it” unleased write path — which is exactly the escape hatch the next caller reaches for, and whose existence would void both the type fence and the grep guard in write_types.rs/api.rs.

Structs§

CreateOptions
Per-call options.
CreateOutcome
The full outcome of one attempt.

Enums§

CreateResult
What happened (or, under --dry-run, would happen).

Functions§

create
Creates a document, optionally seeding it, logging every non-dry attempt.
describe
Renders an outcome as a single human-readable line.