diff --git a/client.gen.go b/client.gen.go index e75aaa4..308704b 100644 --- a/client.gen.go +++ b/client.gen.go @@ -3385,8 +3385,8 @@ type CreatePluginResponse struct { Body []byte HTTPResponse *http.Response JSON201 *Plugin + JSON400 *BadRequest JSON403 *Forbidden - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -3409,10 +3409,10 @@ func (r CreatePluginResponse) StatusCode() int { type DeletePluginByTeamAndPluginNameResponse struct { Body []byte HTTPResponse *http.Response + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON403 *Forbidden JSON404 *NotFound - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -3461,8 +3461,8 @@ type UpdatePluginResponse struct { Body []byte HTTPResponse *http.Response JSON200 *Plugin + JSON400 *BadRequest JSON403 *Forbidden - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -3540,10 +3540,10 @@ type UpdatePluginVersionResponse struct { Body []byte HTTPResponse *http.Response JSON200 *PluginVersion + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON403 *Forbidden JSON404 *NotFound - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -3568,9 +3568,9 @@ type CreatePluginVersionResponse struct { HTTPResponse *http.Response JSON200 *PluginVersion JSON201 *PluginVersion + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON403 *Forbidden - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -3643,10 +3643,10 @@ func (r UploadPluginAssetResponse) StatusCode() int { type DeletePluginVersionDocsResponse struct { Body []byte HTTPResponse *http.Response + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON403 *Forbidden JSON404 *NotFound - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -3701,10 +3701,10 @@ type CreatePluginVersionDocsResponse struct { JSON201 *struct { Names *[]PluginDocsPageName `json:"names,omitempty"` } + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON403 *Forbidden JSON404 *NotFound - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -3727,10 +3727,10 @@ func (r CreatePluginVersionDocsResponse) StatusCode() int { type DeletePluginVersionTablesResponse struct { Body []byte HTTPResponse *http.Response + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON403 *Forbidden JSON404 *NotFound - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -3785,10 +3785,10 @@ type CreatePluginVersionTablesResponse struct { JSON201 *struct { Names *[]PluginTableName `json:"names,omitempty"` } + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON403 *Forbidden JSON404 *NotFound - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -3844,7 +3844,6 @@ type ListTeamsResponse struct { JSON401 *RequiresAuthentication JSON403 *Forbidden JSON404 *NotFound - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -3868,9 +3867,9 @@ type CreateTeamResponse struct { Body []byte HTTPResponse *http.Response JSON201 *Team + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON403 *Forbidden - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -3894,10 +3893,10 @@ type GetTeamByNameResponse struct { Body []byte HTTPResponse *http.Response JSON200 *Team + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON403 *Forbidden JSON404 *NotFound - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -3921,10 +3920,10 @@ type UpdateTeamResponse struct { Body []byte HTTPResponse *http.Response JSON200 *Team + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON403 *Forbidden JSON404 *NotFound - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -3975,8 +3974,8 @@ type CreateTeamAPIKeyResponse struct { Body []byte HTTPResponse *http.Response JSON201 *APIKey + JSON400 *BadRequest JSON401 *RequiresAuthentication - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -3999,9 +3998,9 @@ func (r CreateTeamAPIKeyResponse) StatusCode() int { type DeleteTeamAPIKeyResponse struct { Body []byte HTTPResponse *http.Response + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON404 *NotFound - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -4052,8 +4051,8 @@ type EmailTeamInvitationResponse struct { Body []byte HTTPResponse *http.Response JSON200 *Invitation + JSON400 *BadRequest JSON403 *Forbidden - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -4101,10 +4100,10 @@ func (r AcceptTeamInvitationResponse) StatusCode() int { type CancelTeamInvitationResponse struct { Body []byte HTTPResponse *http.Response + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON403 *Forbidden JSON404 *NotFound - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -4131,10 +4130,10 @@ type GetTeamMembershipsResponse struct { Items []Membership `json:"items"` Metadata ListMetadata `json:"metadata"` } + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON403 *Forbidden JSON404 *NotFound - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -4157,10 +4156,10 @@ func (r GetTeamMembershipsResponse) StatusCode() int { type DeletePluginsByTeamResponse struct { Body []byte HTTPResponse *http.Response + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON403 *Forbidden JSON404 *NotFound - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -4215,10 +4214,10 @@ type ListUsersByTeamResponse struct { Items []User `json:"items"` Metadata ListMetadata `json:"metadata"` } + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON403 *Forbidden JSON404 *NotFound - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -4290,10 +4289,10 @@ type UpdateCurrentUserResponse struct { Body []byte HTTPResponse *http.Response JSON200 *User + JSON400 *BadRequest JSON401 *RequiresAuthentication JSON403 *Forbidden JSON405 *MethodNotAllowed - JSON422 *UnprocessableEntity JSON500 *InternalError } @@ -4909,19 +4908,19 @@ func ParseCreatePluginResponse(rsp *http.Response) (*CreatePluginResponse, error } response.JSON201 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest Forbidden + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON403 = &dest + response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON422 = &dest + response.JSON403 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError @@ -4949,6 +4948,13 @@ func ParseDeletePluginByTeamAndPluginNameResponse(rsp *http.Response) (*DeletePl } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest RequiresAuthentication if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -4970,13 +4976,6 @@ func ParseDeletePluginByTeamAndPluginNameResponse(rsp *http.Response) (*DeletePl } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5057,19 +5056,19 @@ func ParseUpdatePluginResponse(rsp *http.Response) (*UpdatePluginResponse, error } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest Forbidden + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON403 = &dest + response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON422 = &dest + response.JSON403 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError @@ -5208,6 +5207,13 @@ func ParseUpdatePluginVersionResponse(rsp *http.Response) (*UpdatePluginVersionR } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest RequiresAuthentication if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5229,13 +5235,6 @@ func ParseUpdatePluginVersionResponse(rsp *http.Response) (*UpdatePluginVersionR } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5276,6 +5275,13 @@ func ParseCreatePluginVersionResponse(rsp *http.Response) (*CreatePluginVersionR } response.JSON201 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest RequiresAuthentication if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5290,13 +5296,6 @@ func ParseCreatePluginVersionResponse(rsp *http.Response) (*CreatePluginVersionR } response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5417,6 +5416,13 @@ func ParseDeletePluginVersionDocsResponse(rsp *http.Response) (*DeletePluginVers } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest RequiresAuthentication if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5438,13 +5444,6 @@ func ParseDeletePluginVersionDocsResponse(rsp *http.Response) (*DeletePluginVers } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5537,6 +5536,13 @@ func ParseCreatePluginVersionDocsResponse(rsp *http.Response) (*CreatePluginVers } response.JSON201 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest RequiresAuthentication if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5558,13 +5564,6 @@ func ParseCreatePluginVersionDocsResponse(rsp *http.Response) (*CreatePluginVers } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5591,6 +5590,13 @@ func ParseDeletePluginVersionTablesResponse(rsp *http.Response) (*DeletePluginVe } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest RequiresAuthentication if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5612,13 +5618,6 @@ func ParseDeletePluginVersionTablesResponse(rsp *http.Response) (*DeletePluginVe } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5711,6 +5710,13 @@ func ParseCreatePluginVersionTablesResponse(rsp *http.Response) (*CreatePluginVe } response.JSON201 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest RequiresAuthentication if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5732,13 +5738,6 @@ func ParseCreatePluginVersionTablesResponse(rsp *http.Response) (*CreatePluginVe } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5850,13 +5849,6 @@ func ParseListTeamsResponse(rsp *http.Response) (*ListTeamsResponse, error) { } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5890,6 +5882,13 @@ func ParseCreateTeamResponse(rsp *http.Response) (*CreateTeamResponse, error) { } response.JSON201 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest RequiresAuthentication if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5904,13 +5903,6 @@ func ParseCreateTeamResponse(rsp *http.Response) (*CreateTeamResponse, error) { } response.JSON403 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5944,6 +5936,13 @@ func ParseGetTeamByNameResponse(rsp *http.Response) (*GetTeamByNameResponse, err } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest RequiresAuthentication if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -5965,13 +5964,6 @@ func ParseGetTeamByNameResponse(rsp *http.Response) (*GetTeamByNameResponse, err } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6005,6 +5997,13 @@ func ParseUpdateTeamResponse(rsp *http.Response) (*UpdateTeamResponse, error) { } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest RequiresAuthentication if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6026,13 +6025,6 @@ func ParseUpdateTeamResponse(rsp *http.Response) (*UpdateTeamResponse, error) { } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6109,19 +6101,19 @@ func ParseCreateTeamAPIKeyResponse(rsp *http.Response) (*CreateTeamAPIKeyRespons } response.JSON201 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: - var dest RequiresAuthentication + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON401 = &dest + response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: + var dest RequiresAuthentication if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON422 = &dest + response.JSON401 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError @@ -6149,6 +6141,13 @@ func ParseDeleteTeamAPIKeyResponse(rsp *http.Response) (*DeleteTeamAPIKeyRespons } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest RequiresAuthentication if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6163,13 +6162,6 @@ func ParseDeleteTeamAPIKeyResponse(rsp *http.Response) (*DeleteTeamAPIKeyRespons } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6246,19 +6238,19 @@ func ParseEmailTeamInvitationResponse(rsp *http.Response) (*EmailTeamInvitationR } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest Forbidden + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON403 = &dest + response.JSON400 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Forbidden if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON422 = &dest + response.JSON403 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError @@ -6333,6 +6325,13 @@ func ParseCancelTeamInvitationResponse(rsp *http.Response) (*CancelTeamInvitatio } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest RequiresAuthentication if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6354,13 +6353,6 @@ func ParseCancelTeamInvitationResponse(rsp *http.Response) (*CancelTeamInvitatio } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6397,6 +6389,13 @@ func ParseGetTeamMembershipsResponse(rsp *http.Response) (*GetTeamMembershipsRes } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest RequiresAuthentication if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6418,13 +6417,6 @@ func ParseGetTeamMembershipsResponse(rsp *http.Response) (*GetTeamMembershipsRes } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6451,6 +6443,13 @@ func ParseDeletePluginsByTeamResponse(rsp *http.Response) (*DeletePluginsByTeamR } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest RequiresAuthentication if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6472,13 +6471,6 @@ func ParseDeletePluginsByTeamResponse(rsp *http.Response) (*DeletePluginsByTeamR } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6565,6 +6557,13 @@ func ParseListUsersByTeamResponse(rsp *http.Response) (*ListUsersByTeamResponse, } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest RequiresAuthentication if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6586,13 +6585,6 @@ func ParseListUsersByTeamResponse(rsp *http.Response) (*ListUsersByTeamResponse, } response.JSON404 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: var dest InternalError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6706,6 +6698,13 @@ func ParseUpdateCurrentUserResponse(rsp *http.Response) (*UpdateCurrentUserRespo } response.JSON200 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest BadRequest + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401: var dest RequiresAuthentication if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -6727,13 +6726,6 @@ func ParseUpdateCurrentUserResponse(rsp *http.Response) (*UpdateCurrentUserRespo } response.JSON405 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422: - var dest UnprocessableEntity - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON422 = &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/models.gen.go b/models.gen.go index be9f26a..fecb171 100644 --- a/models.gen.go +++ b/models.gen.go @@ -5,6 +5,8 @@ package cloudquery_api import ( "time" + + openapi_types "github.com/deepmap/oapi-codegen/pkg/types" ) const ( @@ -82,6 +84,12 @@ const ( CreateTeamAPIKeyJSONBodyScopeReadWrite CreateTeamAPIKeyJSONBodyScope = "read-write" ) +// Defines values for EmailTeamInvitationJSONBodyRole. +const ( + Admin EmailTeamInvitationJSONBodyRole = "admin" + Member EmailTeamInvitationJSONBodyRole = "member" +) + // APIKey API Key to interact with CloudQuery Cloud under specific team type APIKey struct { CreatedAt *time.Time `json:"created_at,omitempty"` @@ -101,6 +109,14 @@ type APIKey struct { // APIKeyScope Scope of permissions for the API key. `read-only` API keys are used for downloading a plugin while `read-write` API keys are used for uploading a plugin. type APIKeyScope string +// BadRequestError defines model for BadRequestError. +type BadRequestError struct { + Errors *[]string `json:"errors,omitempty"` + FieldErrors *map[string]string `json:"field_errors,omitempty"` + Message string `json:"message"` + Status int `json:"status"` +} + // BasicError Basic Error type BasicError struct { Message string `json:"message"` @@ -108,7 +124,7 @@ type BasicError struct { } // Email defines model for Email. -type Email = string +type Email = openapi_types.Email // ImageURL defines model for ImageURL. type ImageURL struct { @@ -457,14 +473,6 @@ type User struct { // UserName The unique name for the user. type UserName = string -// ValidationError defines model for ValidationError. -type ValidationError struct { - Errors *[]string `json:"errors,omitempty"` - FieldErrors *map[string]string `json:"field_errors,omitempty"` - Message string `json:"message"` - Status int `json:"status"` -} - // VersionName The version in semantic version format. type VersionName = string @@ -492,6 +500,9 @@ type TargetName = string // VersionSortBy defines model for version_sort_by. type VersionSortBy string +// BadRequest defines model for BadRequest. +type BadRequest = BadRequestError + // Forbidden Basic Error type Forbidden = BasicError @@ -507,9 +518,6 @@ type NotFound = BasicError // RequiresAuthentication Basic Error type RequiresAuthentication = BasicError -// UnprocessableEntity defines model for UnprocessableEntity. -type UnprocessableEntity = ValidationError - // ListPluginsParams defines parameters for ListPlugins. type ListPluginsParams struct { // SortBy The field to sort by @@ -658,10 +666,13 @@ type ListTeamInvitationsParams struct { // EmailTeamInvitationJSONBody defines parameters for EmailTeamInvitation. type EmailTeamInvitationJSONBody struct { - Email string `json:"email"` - Role string `json:"role"` + Email openapi_types.Email `json:"email"` + Role EmailTeamInvitationJSONBodyRole `json:"role"` } +// EmailTeamInvitationJSONBodyRole defines parameters for EmailTeamInvitation. +type EmailTeamInvitationJSONBodyRole string + // GetTeamMembershipsParams defines parameters for GetTeamMemberships. type GetTeamMembershipsParams struct { // Page Page number of the results to fetch diff --git a/spec.json b/spec.json index 09af10c..8a5f21c 100644 --- a/spec.json +++ b/spec.json @@ -183,12 +183,12 @@ }, "description": "Created" }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "403": { "$ref": "#/components/responses/Forbidden" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -276,12 +276,12 @@ } } }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "403": { "$ref": "#/components/responses/Forbidden" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -305,6 +305,9 @@ "204": { "description": "Response" }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/RequiresAuthentication" }, @@ -314,9 +317,6 @@ "404": { "$ref": "#/components/responses/NotFound" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -474,6 +474,8 @@ "properties": { "message": { "type": "string", + "minLength": 1, + "maxLength": 30000, "description": "A message describing what's new or changed in this version.\nThis message will be displayed to users in the plugin's changelog.\nSupports limited markdown syntax.\n" }, "protocols": { @@ -536,15 +538,15 @@ } } }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/RequiresAuthentication" }, "403": { "$ref": "#/components/responses/Forbidden" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -591,6 +593,9 @@ } } }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/RequiresAuthentication" }, @@ -600,9 +605,6 @@ "404": { "$ref": "#/components/responses/NotFound" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -736,6 +738,9 @@ } } }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/RequiresAuthentication" }, @@ -745,9 +750,6 @@ "404": { "$ref": "#/components/responses/NotFound" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -797,6 +799,9 @@ "204": { "description": "The resource was deleted successfully." }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/RequiresAuthentication" }, @@ -806,9 +811,6 @@ "404": { "$ref": "#/components/responses/NotFound" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -941,6 +943,9 @@ } } }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/RequiresAuthentication" }, @@ -950,9 +955,6 @@ "404": { "$ref": "#/components/responses/NotFound" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -1002,6 +1004,9 @@ "204": { "description": "The resource was deleted successfully." }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/RequiresAuthentication" }, @@ -1011,9 +1016,6 @@ "404": { "$ref": "#/components/responses/NotFound" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -1222,9 +1224,6 @@ "404": { "$ref": "#/components/responses/NotFound" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -1254,7 +1253,9 @@ }, "display_name": { "type": "string", - "description": "The team's display name" + "description": "The team's display name", + "minLength": 1, + "maxLength": 255 } } } @@ -1272,15 +1273,15 @@ }, "description": "Created" }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/RequiresAuthentication" }, "403": { "$ref": "#/components/responses/Forbidden" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -1310,6 +1311,9 @@ } } }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/RequiresAuthentication" }, @@ -1319,9 +1323,6 @@ "404": { "$ref": "#/components/responses/NotFound" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -1365,6 +1366,9 @@ } } }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/RequiresAuthentication" }, @@ -1374,9 +1378,6 @@ "404": { "$ref": "#/components/responses/NotFound" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -1455,7 +1456,6 @@ "$ref": "#/components/responses/InternalError" } }, - "security": [], "tags": [ "plugins" ] @@ -1472,6 +1472,9 @@ "204": { "description": "Response" }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/RequiresAuthentication" }, @@ -1481,9 +1484,6 @@ "404": { "$ref": "#/components/responses/NotFound" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -1550,6 +1550,9 @@ }, "description": "Response" }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/RequiresAuthentication" }, @@ -1559,9 +1562,6 @@ "404": { "$ref": "#/components/responses/NotFound" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -1647,10 +1647,15 @@ ], "properties": { "email": { - "type": "string" + "type": "string", + "format": "email" }, "role": { - "type": "string" + "type": "string", + "enum": [ + "admin", + "member" + ] } } } @@ -1668,12 +1673,12 @@ } } }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "403": { "$ref": "#/components/responses/Forbidden" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -1744,6 +1749,9 @@ "204": { "description": "Response" }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/RequiresAuthentication" }, @@ -1753,9 +1761,6 @@ "404": { "$ref": "#/components/responses/NotFound" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -1802,6 +1807,9 @@ } } }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/RequiresAuthentication" }, @@ -1811,9 +1819,6 @@ "404": { "$ref": "#/components/responses/NotFound" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -1867,7 +1872,9 @@ "properties": { "name": { "type": "string", - "description": "The user's name" + "description": "The user's name", + "minLength": 1, + "maxLength": 255 } } } @@ -1885,6 +1892,9 @@ } } }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/RequiresAuthentication" }, @@ -1894,9 +1904,6 @@ "405": { "$ref": "#/components/responses/MethodNotAllowed" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -2096,7 +2103,8 @@ ], "properties": { "name": { - "type": "string" + "type": "string", + "maxLength": 255 }, "expires_at": { "type": "string", @@ -2125,12 +2133,12 @@ } } }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/RequiresAuthentication" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -2156,15 +2164,15 @@ "204": { "description": "Deleted" }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, "401": { "$ref": "#/components/responses/RequiresAuthentication" }, "404": { "$ref": "#/components/responses/NotFound" }, - "422": { - "$ref": "#/components/responses/UnprocessableEntity" - }, "500": { "$ref": "#/components/responses/InternalError" } @@ -2288,6 +2296,8 @@ "display_name": { "description": "The plugin's display name", "type": "string", + "minLength": 1, + "maxLength": 50, "example": "AWS Source Plugin" }, "official": { @@ -2300,6 +2310,8 @@ }, "short_description": { "type": "string", + "minLength": 1, + "maxLength": 512, "example": "Sync data from AWS to any destination" }, "tier": { @@ -2365,11 +2377,15 @@ }, "display_name": { "type": "string", + "minLength": 1, + "maxLength": 50, "description": "The plugin's display name, as shown in the CloudQuery Hub.", "example": "AWS Source Plugin" }, "short_description": { "type": "string", + "minLength": 1, + "maxLength": 512, "description": "Short description of the plugin. This will be shown in the CloudQuery Hub.", "example": "Sync data from AWS to any destination" }, @@ -2394,7 +2410,7 @@ } } }, - "ValidationError": { + "BadRequestError": { "allOf": [ { "$ref": "#/components/schemas/BasicError" @@ -2436,11 +2452,15 @@ }, "display_name": { "type": "string", + "minLength": 1, + "maxLength": 50, "description": "The plugin's display name, as shown in the CloudQuery Hub.", "example": "AWS Source Plugin" }, "short_description": { "type": "string", + "minLength": 1, + "maxLength": 512, "description": "Short description of the plugin. This will be shown in the CloudQuery Hub.", "example": "Sync data from AWS to any destination" }, @@ -2896,7 +2916,8 @@ }, "Email": { "type": "string", - "example": "user@cloudquery.io" + "example": "user@cloudquery.io", + "format": "email" }, "UserName": { "description": "The unique name for the user.", @@ -3056,15 +3077,15 @@ }, "description": "Forbidden" }, - "UnprocessableEntity": { + "BadRequest": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ValidationError" + "$ref": "#/components/schemas/BadRequestError" } } }, - "description": "Unprocessable Entity" + "description": "Bad request" }, "NotFound": { "content": { @@ -3212,7 +3233,9 @@ "required": true, "schema": { "type": "string", - "example": "cli-api-key" + "example": "cli-api-key", + "maxLength": 255, + "minLength": 1 }, "x-go-name": "APIKeyName" }