← all adapters

gmail-style

simulates Gmail API v1

restadapter v0.1.016 routes

verification

SDKverified with google-api-go-client v0.293.0· surface 16 · not implemented 6 · differs 3

use it

# add to stunt.yaml
services:
  gmail:
    adapter: embedded:gmail-style

# then
$ stunt up

The embedded: source extracts this adapter from the binary — no git clone, fully offline.

how to mock the Gmail API locally

Install stunt, paste the service block above into stunt.yaml, run stunt up — then point your client at localhost instead of Gmail API. It works offline, keeps state across requests and restarts, and every response is synthetic: the route shapes, status codes, pagination, and webhook delivery follow the real Gmail API v1 surface — the data is fake, the behavior is real.

backing stores

messageslabelsdrafts

api surface (16)

generated from the adapter manifest — exactly what boots, nothing more · covers 20% of the real API's 79 routes (derived from sdk google-api-go-client @ v0.293.0)

16 routes
GET/gmail/v1/users/{userId}/labels
POST/gmail/v1/users/{userId}/labels
DELETE/gmail/v1/users/{userId}/labels/{id}
POST/gmail/v1/users/{userId}/messages/send
GET/gmail/v1/users/{userId}/messages
POST/gmail/v1/users/{userId}/messages
POST/gmail/v1/users/{userId}/messages/batchModify
POST/gmail/v1/users/{userId}/messages/{messageId}/trash
POST/gmail/v1/users/{userId}/messages/{messageId}/modify
GET/gmail/v1/users/{userId}/messages/{messageId}/attachments/{attachmentId}
GET/gmail/v1/users/{userId}/messages/{messageId}
DELETE/gmail/v1/users/{userId}/messages/{messageId}
GET/gmail/v1/users/{userId}/drafts
POST/gmail/v1/users/{userId}/drafts
DELETE/gmail/v1/users/{userId}/drafts/{id}
GET/gmail/v1/users/{userId}/threads/{threadId}

SDK-verified behaviors (9)

  • Labels.List returns seeded system labels
  • Labels.Create + Labels.List round-trip
  • Messages.Send raw rfc822 -> id + threadId
  • Messages.Get parses the sent raw message into payload headers
  • Messages.List includes sent messages
  • Messages.List MaxResults + PageToken walk pages
  • Messages.Modify AddLabelIds applies
  • Messages.Get Format=metadata returns headers without body
  • Messages.Delete then Get -> googleapi 404

Not implemented (6)

  • No Gmail search operators (from:, to:, after:, has:attachment) in q
  • No threads.list, history.list, or watch/stop push endpoints
  • No drafts send/update/get or threads modify/trash endpoints
  • No messages.import, untrash, or batchDelete endpoints
  • No labels get/patch or users.getProfile endpoints
  • No settings surface: filters, sendAs, forwardingAddresses, vacation

Differs from the real API (3)

  • q is substring match on snippet + Subject header only
  • Omitted/0 maxResults returns everything; real API defaults to 100
  • Label create is idempotent on existing name; real Gmail returns 409
want more of the Gmail API surface? adapters are YAML + Starlark — the authoring guide covers adding routes, fixtures, and state machines. Open an issue for anything big first, or just file a PR — merged routes ship in the next release.