Validate a bring-your-own-key idempotency_key up front and return a
{ idempotency_key } fragment to spread into a mutating request.
Useful when the caller persists keys across process restarts (e.g., key
stored in a DB alongside a campaign row) and wants to catch drift before
the round-trip — the server would reject a malformed key with
INVALID_REQUEST, but failing locally produces a faster, cleaner error.
Throws when the key doesn't match IDEMPOTENCY_KEY_PATTERN
(^[A-Za-z0-9_.:-]{16,255}$).
Validate a bring-your-own-key
idempotency_keyup front and return a{ idempotency_key }fragment to spread into a mutating request.Useful when the caller persists keys across process restarts (e.g., key stored in a DB alongside a campaign row) and wants to catch drift before the round-trip — the server would reject a malformed key with
INVALID_REQUEST, but failing locally produces a faster, cleaner error.Throws when the key doesn't match
IDEMPOTENCY_KEY_PATTERN(^[A-Za-z0-9_.:-]{16,255}$).