GetCalendar/UpdateCalendar: the top-level calendar pair (#12321)

Merged
JE
4mo ago
+2615-28

C8 of the post-v0.11.0 absorption sprint — the last pre-C4 absorption.

BC3 #12321 shipped the intentionally small calendar scope: show + update on /calendars/:id.json (a top-level BC5 bucketable keyed by its own bucket id, distinct from a project).

What

  • Spec: CalendarsService (tag Calendars, default-fallback mapping) with GetCalendar + UpdateCalendar. 233 → 235 operations. Shape derived from doc/api/sections/calendars.md at the pinned revision — verified drift-free since e83b2733 — per the gap's shape-discovery warning: id, type, name, color, created_at, updated_at, url, app_url, schedule_url, all required non-nullable.
  • 422 contract: inspected the pinned controller rather than guessing — unknown colors are rejected up front with a field-keyed payload ({"errors": {"color": ["is not a valid color"]}}), same shape as the RecordInvalid path. Documented on the operation and pinned in per-SDK 422 tests.
  • Update body: nested {calendar: {color}} envelope; wire body pinned byte-for-byte in TS/Ruby/Python.
  • UpdateCalendar is a flagged idempotent PUT with an idempotency conformance case (Ruby skip).
  • Smithy gotcha for the record: a trailing label can't carry .json in the same segment (Literal segments must not contain { or }), so the URIs use the established suffix-less-id form.
  • Wiring: Go wrapper + accessor, TS/Ruby/Python(sync+async); getCalendar method-name override in TS/Kotlin/Swift.
  • Counts: 235 total / 122 read-only / 75 idempotent / 197 retry-eligible — the sprint's planned pre-C4 end state, matching behavior-model exactly.

Verification

Full make green (exit 0) + make kt-check-generated-drift clean; 11 Calendar conformance passes + Ruby's justified skip. Live-canary fixture for GetCalendar stays a follow-up (needs a stable dock-walk fixture-id path), noted in the registry entry.


Summary by cubic

Adds the top‑level calendars API with GetCalendar and UpdateCalendar across all SDKs, matching BC3 #12321’s show+update scope. UpdateCalendar is an idempotent PUT with 503 retries, and 422 validation is now modeled as the field‑keyed payload.

  • New Features
    • Added CalendarsService with getCalendar(id) and updateCalendar(id, { calendar: { color } }) in TypeScript, Swift, Kotlin, Go, Python, and Ruby.
    • Calendar is top‑level; URIs use /calendars/{calendarId} and expose id, type, name, color, created_at, updated_at, url, app_url, schedule_url.
    • 422 for invalid color returns {"errors":{"color":["is not a valid color"]}}, now modeled as FieldValidationError/FieldKeyedErrors; tests pin the exact wire shape.
    • UpdateCalendar flagged idempotent with an idempotency conformance case; getCalendar method-name override added; operation counts: 235 total / 122 read‑only / 75 idempotent / 197 retry‑eligible.