Bulk operations on /adsApi/v1 do not return 200. They return 207, and the
body carries per-item outcomes:
{
"success": [ ... ],
"partialSuccess": [ ... ],
"error": [ ... ]
}
:raise_error only fires at status >= 400, so a create_campaign call where 300
of 1000 campaigns failed returns a perfectly healthy HTTP::Response. Nothing in
the client signals that anything went wrong. The caller has to know to inspect
three arrays, and nothing in the generated signature tells them so.
Declared responses for POST /adsApi/v1/create/campaigns:
207 CreateCampaign 207 response
400 BadRequest
401 Unauthorized
403 Forbidden
404 NotFound
413 ContentTooLarge
429 TooManyRequests
500 502 503 504
Options
- Leave
HTTP::Response as the return value and document the 207 shape. Cheapest,
keeps the client thin, but the footgun stays.
- Return a small result object for multi-status operations exposing
#success, #partial_success, #errors, and a #success? predicate.
- Raise when
error is non-empty. Probably wrong: partial success is a legitimate
outcome the API is deliberately modelling, not an exception.
Leaning toward 2, with the generator emitting it only for operations that declare
a 207.
Out of scope
Auto-chunking bulk arrays. The limits are maxItems: 1000, minItems: 1, and
exceeding them returns a documented 413 with CONTENT_TOO_LARGE
("The request is too large. Consider splitting it into multiple requests."),
so oversized requests fail loudly rather than silently truncating. At 1000 items
per call, chunking is a nicety rather than a correctness issue.
Bulk operations on
/adsApi/v1do not return 200. They return 207, and thebody carries per-item outcomes:
{ "success": [ ... ], "partialSuccess": [ ... ], "error": [ ... ] }:raise_erroronly fires at status >= 400, so acreate_campaigncall where 300of 1000 campaigns failed returns a perfectly healthy
HTTP::Response. Nothing inthe client signals that anything went wrong. The caller has to know to inspect
three arrays, and nothing in the generated signature tells them so.
Declared responses for
POST /adsApi/v1/create/campaigns:Options
HTTP::Responseas the return value and document the 207 shape. Cheapest,keeps the client thin, but the footgun stays.
#success,#partial_success,#errors, and a#success?predicate.erroris non-empty. Probably wrong: partial success is a legitimateoutcome the API is deliberately modelling, not an exception.
Leaning toward 2, with the generator emitting it only for operations that declare
a 207.
Out of scope
Auto-chunking bulk arrays. The limits are
maxItems: 1000, minItems: 1, andexceeding them returns a documented 413 with
CONTENT_TOO_LARGE("The request is too large. Consider splitting it into multiple requests."),
so oversized requests fail loudly rather than silently truncating. At 1000 items
per call, chunking is a nicety rather than a correctness issue.