From b1fed93553173b74cd0b59a547b91d8aa0048431 Mon Sep 17 00:00:00 2001 From: cq-bot Date: Wed, 4 Sep 2024 10:48:41 +0000 Subject: [PATCH] fix: Generate CloudQuery Go API Client from `spec.json` --- client.gen.go | 8 ++++++++ spec.json | 3 +++ 2 files changed, 11 insertions(+) diff --git a/client.gen.go b/client.gen.go index 477a96a..092afcf 100644 --- a/client.gen.go +++ b/client.gen.go @@ -15536,6 +15536,7 @@ type SendAnonymousEventResponse struct { HTTPResponse *http.Response JSON400 *BadRequest JSON404 *NotFound + JSON429 *TooManyRequests JSON500 *InternalError } @@ -25156,6 +25157,13 @@ func ParseSendAnonymousEventResponse(rsp *http.Response) (*SendAnonymousEventRes } response.JSON404 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429: + var dest TooManyRequests + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON429 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError if err := json.Unmarshal(bodyBytes, &dest); err != nil { diff --git a/spec.json b/spec.json index 41c5393..5492310 100644 --- a/spec.json +++ b/spec.json @@ -3894,6 +3894,9 @@ "404" : { "$ref" : "#/components/responses/NotFound" }, + "429" : { + "$ref" : "#/components/responses/TooManyRequests" + }, "500" : { "$ref" : "#/components/responses/InternalError" }